all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 1348@emacsbugs.donarmstrong.com, grishka@gmx.de, jasonr@f2s.com
Subject: bug#1348: set-frame-width and set-frame-position seem buggy on at least MSWindows
Date: Thu, 04 Dec 2008 19:00:25 +0100	[thread overview]
Message-ID: <49381AB9.3030602@gmx.at> (raw)
In-Reply-To: <uk5ahnm7h.fsf@gnu.org>

> I don't see a need for giving an example for something that is so
> blatantly wrong: it calls one thread's code from within another.
> Since the Emacs input thread was written _specifically_ to overcome
> problems with delivering input asynchronously, it should be clear to
> anyone that mixing such threads is dead wrong, period.

I can only _speculate_ on how Emacs is supposed to handle a frame size
change requested by a Lisp routine.

(1) Calculate (and internally store) the new size and send the WM
     (window manager) an appropriate request.

(2) Continue the calling routine with the size calculated in (1).

(3) When the WM confirmation finally arrives treat it as a resize
     request initiated by the WM.

The idea seems that the sizes calculated in (1) and the size request in
(3) coincide and no further resizing is necessary thereafter.

Apparently Jason changed (1) on Windows in the sense that it does not
internally store the new size.  So if a Lisp routine issues another
resize request before (3) is handled, (1) starts calculations with the
values as they were before the Lisp routine started.  The request that
eventually gets processed by the Windows WM is the last
resize/positioning request issued by the Lisp routine, with the values
valid before the Lisp routine started.

Now grischka's proposal seems to wait for the WM's confirmation within
(1), that is embed (3) in (1), and have (2) proceed with the values
promised (or confirmed) by the WM.  This apparently runs counter to the
ideology that the processing of asynchronous input should not happen in
certain occasions and apparently a step like (1) is one of these.

So the first thing we'd have to agree upon is whether we want a function
like `set-frame-height' process messages of the WM.  If we don't want
that, we have to find another way to make `set-frame-height' DTRT which
seems non-trivial to me.

If we want that, we have to decide how to synchronize the handling of a
confirmation message with the rest of system messages arriving around
that time.  For this purpose, we have to determine what can be safely
processed and what must be processed to ensure liveness while waiting
for the confirmation.  (I suppose that's what Jason's "inter-thread
synchronization" amounts to, though I don't understand the term "thread"
in the present context - sorry.  But maybe that's what ATTACH_THREADS
was about.)

Till we agree on something here I can test grischka's patches to know
whether his approach can handle the problem at all - that is whether the
confirmation gets through and is handled.

martin








  reply	other threads:[~2008-12-04 18:00 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-26 21:22 bug#1348: set-frame-width and set-frame-position seem buggy on at least MSWindows grischka
2008-11-27 13:41 ` martin rudalics
2008-11-27 17:45   ` grischka
2008-11-27 19:48     ` martin rudalics
2008-11-29 19:42       ` grischka
2008-11-30  9:19         ` martin rudalics
2008-11-30 17:40           ` grischka
2008-11-30 20:02             ` martin rudalics
2008-11-30 22:04               ` grischka
2008-11-30 22:50                 ` martin rudalics
2008-11-30 23:08                   ` grischka
2008-11-30 23:54           ` jasonr
2008-12-01  7:28             ` martin rudalics
2008-12-01  8:22               ` jasonr
2008-12-01  9:34                 ` martin rudalics
2008-12-02  6:11                   ` grischka
2008-12-02  7:42                     ` jasonr
2008-12-02 14:11                       ` grischka
2008-12-02 15:54                     ` martin rudalics
2008-12-02 20:04                       ` Eli Zaretskii
2008-12-03 10:17                         ` martin rudalics
2008-12-03 18:32                           ` Eli Zaretskii
2008-12-04 18:00                             ` martin rudalics [this message]
2008-12-16 17:11                               ` grischka
2008-12-03  0:09                       ` grischka
2008-12-03 10:17                         ` martin rudalics
2008-12-03 17:24                           ` grischka
2008-12-03 21:41                             ` Stefan Monnier
2008-12-04 17:58                             ` martin rudalics
2008-12-04 23:24                               ` grischka
2008-12-05  6:20                                 ` Eli Zaretskii
2008-12-05 15:58                                   ` Stefan Monnier
  -- strict thread matches above, loose matches on Subject: below --
2008-12-03 21:43 grischka
2008-12-04  4:07 ` Eli Zaretskii
2008-11-17 15:06 grischka
2008-11-14 22:46 Themba Fletcher
2008-11-15  9:40 ` Eli Zaretskii
2008-11-15 10:04   ` Eli Zaretskii
2008-11-15 14:12     ` martin rudalics
2008-11-17 20:50   ` Themba Fletcher
2008-11-18 13:03     ` martin rudalics
2014-09-21 18:02 ` martin rudalics

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49381AB9.3030602@gmx.at \
    --to=rudalics@gmx.at \
    --cc=1348@emacsbugs.donarmstrong.com \
    --cc=eliz@gnu.org \
    --cc=grishka@gmx.de \
    --cc=jasonr@f2s.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.