aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1993-08-14 10:30:09 +0000
committerRichard M. Stallman1993-08-14 10:30:09 +0000
commit1658603c0cce81377b4f313c2bf597c84549cd6e (patch)
treea77691ef0de00eee3e0a418b2d67215f2fd26646 /src
parent43626ea48d524e02863127fad847e1e4a771cded (diff)
downloademacs-1658603c0cce81377b4f313c2bf597c84549cd6e.tar.gz
emacs-1658603c0cce81377b4f313c2bf597c84549cd6e.zip
(Fx_popup_menu): Adjust coords so they are relative to the inner window.
Diffstat (limited to 'src')
-rw-r--r--src/xmenu.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/xmenu.c b/src/xmenu.c
index f067b416283..1c17085571a 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -168,6 +168,34 @@ With this form of menu, the return value is VALUE from the chosen item.")
168 but I don't want to make one now. */ 168 but I don't want to make one now. */
169 CHECK_WINDOW (window, 0); 169 CHECK_WINDOW (window, 0);
170 170
171#ifdef HAVE_X11
172 {
173 Window child;
174 int win_x = 0, win_y = 0;
175
176 /* Find the position of the outside upper-left corner of
177 the inner window, with respect to the outer window. */
178 if (f->display.x->parent_desc != ROOT_WINDOW)
179 {
180 BLOCK_INPUT;
181 XTranslateCoordinates (x_current_display,
182
183 /* From-window, to-window. */
184 f->display.x->window_desc,
185 f->display.x->parent_desc,
186
187 /* From-position, to-position. */
188 0, 0, &win_x, &win_y,
189
190 /* Child of window. */
191 &child);
192 UNBLOCK_INPUT;
193 XMenu_xpos += win_x;
194 XMenu_ypos += win_y;
195 }
196 }
197#endif
198
171 XMenu_xpos += FONT_WIDTH (f->display.x->font) * XINT (x); 199 XMenu_xpos += FONT_WIDTH (f->display.x->font) * XINT (x);
172 XMenu_ypos += FONT_HEIGHT (f->display.x->font) * XINT (y); 200 XMenu_ypos += FONT_HEIGHT (f->display.x->font) * XINT (y);
173 201