unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Francis Litterio <flitterio@gmail.com>
Subject: Re: Bug in CVS Emacs frame positioning under X
Date: Thu, 23 Mar 2006 14:53:34 +0000 (UTC)	[thread overview]
Message-ID: <loom.20060323T154252-244@post.gmane.org> (raw)

On 3/22/06, I (Fran Litterio) wrote:

> On 3/22/06, Richard Stallman wrote:
>
> > In the latest CVS Emacs under X, there seems to be a frame positioning bug
> > that is timing related.
> >
> > Does it happen in older CVS versions too?  For instance,
> > did it happen a month ago?  6 months ago?
>
> Unknown. I'll check-out the older sources and rebuild. I'll let you know.

I have checked out the CVS Emacs source code from October 1, 2005, and
the bug existed at that time.  Additionally, I have found a simple way
to reproduce the problem:

  1. Start Emacs under the X Window system using the command: emacs -q

  2. Evaluate the following Elisp:

	(dolist (i '(1 2 3 4 5 6 7 8 9 a b c))
	  (let ((frame (make-frame '((top . 50) (left . 50)))))
	    (set-frame-position frame 200 200)
	    (set-frame-position frame 300 300)
	    (sit-for 0.5)))

You may have to evaluate the above Elisp more than once to see the
malfunction (although I see it every time).

The symptom is that not all of the frames end up positioned at x/y
coordinates 300/300.  Some frames are positioned at 300+A/300+B, where
A is the width of the left border drawn by the window manager and B is
the height of the top border drawn by the window manager.  Some frames
even end up at 400/400 !

I think the cause of this problem is the fact that src/xterm.c assumes
(incorrectly) that, after calling XMoveWindow() for a given frame, the next
ConfigureNotify event to be received for that frame will contain the position
data from the call to XMoveWindow().  In fact, the ConfigureNotify event can
sometimes contain the position of the frame before the call to XMoveWindow()
(this may be a race condition, but I'm not sure).

This incorrect assumption interacts badly with the code in
x_check_expected_move(), which attempts to use the position data from the most
recently received ConfigureNotify to validate that the most recent XMoveWindow()
call correctly positioned the frame.

I don't yet know how to fix this.
--
Fran Litterio

             reply	other threads:[~2006-03-23 14:53 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-23 14:53 Francis Litterio [this message]
     [not found] <loom.20060322T040148-762@post.gmane.org>
2006-03-22 13:44 ` Bug in CVS Emacs frame positioning under X Richard Stallman
2006-03-22 13:56   ` Fran Litterio
2006-03-22 21:02     ` Fran Litterio
2006-03-26  0:21       ` Richard Stallman
2006-03-27  6:48         ` Jan Djärv
2006-03-28 16:38         ` Fran Litterio
2006-03-28 16:59           ` Jan Djärv
2006-03-29 23:01           ` Richard Stallman
2006-04-01 15:38             ` Fran Litterio
2006-04-02 20:38               ` Richard Stallman
2006-04-03  7:11               ` Jan D.
2006-04-03  7:32                 ` Jan D.
2006-04-03 18:24                   ` Richard Stallman
2006-04-04  0:42                     ` Fran Litterio
2006-04-04  6:49                       ` Jan D.
2006-04-04 19:57                       ` Richard Stallman
2006-05-08 14:17                         ` Fran Litterio
2006-05-09  4:44                           ` Richard Stallman
2006-05-17 10:13                             ` Fran Litterio
2006-05-17 20:09                               ` Richard Stallman
2006-04-04  6:34                     ` Jan D.

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=loom.20060323T154252-244@post.gmane.org \
    --to=flitterio@gmail.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).