unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Jan D." <jan.h.d@swipnet.se>
Cc: emacs-devel@gnu.org
Subject: Re: x-popup-menu pops up at funny positions
Date: Sat, 4 Jan 2003 14:25:26 +0100 (CET)	[thread overview]
Message-ID: <200301041432.h04EWje8032078@stubby.bodenonline.com> (raw)
In-Reply-To: <E18Ufn0-0003pW-00@fencepost.gnu.org> "from Richard Stallman at Jan 3, 2003 11:20:02 pm"

> Your patch changes two things:
> 
> 1. It offsets the values for x_root and y_root but not for dummy.x and
> dummy.y.

When popping up a menu, only x_root and y_root are actually used.
But for correctnes sake, these should not be the same.

> 2. It deletes the code to read the current position.
> 
> Why did you do #2?

Because it did not in fact read the current position.  It read
the position of the inner window in coordinates that are valid
for the parent window.  Now, if the parent window is the root
window, then it reads the current position.  But in all other
cases it does not.  For example, a window manager may put
any number of windows between the root window and the inner
window.  It may even put a window that is identical to the
inner window in size and placement as a parent to the inner
window (as the window manager I was running while testing does).

One could replace parent_desc with the root window, but it
seemd pointless to do a query to the X server when Emacs
has all the information already and a simple addition finds
the current position.

But I found more problems when x-popup-menu is supposed
to pop up at the mouse position.  It works if the mouse is in
the Emacs edit window, but not for any other case.  This is
because mouse_position_hook is called to get the pointer
position.  If the pointer is in the menu bar, x/y is the
position in the menu bar, not in the edit window.  So
if the pointer is in 1/1 in the menu bar, the code thinks
it is in 1/1 in the edit widget.  Similar errors occur
when the pointer is outside any Emacs window, or in the title
bar of the X window.

Replacing mouse_position_hook with a simple XQueryPointer
cures this.

	Jan D.

  reply	other threads:[~2003-01-04 13:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-03 16:15 x-popup-menu pops up at funny positions Jan D.
2003-01-03 17:14 ` Jan D.
2003-01-04  4:20 ` Richard Stallman
2003-01-04 13:25   ` Jan D. [this message]
2003-01-05 18:33     ` Richard Stallman
2003-01-05 22:05       ` Jan D.
2003-01-06  0:13         ` Jan D.
2003-01-06 17:13         ` Richard Stallman
2003-01-06 18:41           ` Jan D.
2003-01-07 13:40             ` Richard Stallman
2003-01-07 17:47               ` Jan D.
2003-01-08  8:00                 ` Richard Stallman
2003-01-08 20:07                   ` Jan D.
  -- strict thread matches above, loose matches on Subject: below --
2003-01-06 18:46 Jan D.
2003-01-09  7:27 ` Richard Stallman
2003-01-09 21:02   ` 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=200301041432.h04EWje8032078@stubby.bodenonline.com \
    --to=jan.h.d@swipnet.se \
    --cc=emacs-devel@gnu.org \
    /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).