summaryrefslogtreecommitdiff
path: root/src/xmenu.c
diff options
context:
space:
mode:
authorDmitry Antipov <dmantipov@yandex.ru>2014-06-22 09:00:14 +0400
committerDmitry Antipov <dmantipov@yandex.ru>2014-06-22 09:00:14 +0400
commitb0358ef86903ac021110b54ee1acce11211c200f (patch)
treea57eaedb410d4ba6d838fcf1fb188716f08a1eed /src/xmenu.c
parent38852a76958ec456e01420ae2b26240d9f3bc63c (diff)
downloademacs-b0358ef86903ac021110b54ee1acce11211c200f.tar.gz
* xmenu.c (mouse_position_for_popup):
* xselect.c (mouse_position_for_drop): Do not duplicate ... * xfns.c (x_relative_mouse_position): ... and prefer this function. * menu.c (Fx_popup_menu): * xselect.c (x_handle_dnd_message): Adjust users. * menu.h (mouse_position_for_popup): Remove prototype. * xterm.h (x_relative_mouse_position): Add prototype. * xterm.c (x_find_topmost_parent): Break from the loop and do not call XFree if XQueryTree returns zero.
Diffstat (limited to 'src/xmenu.c')
-rw-r--r--src/xmenu.c47
1 files changed, 0 insertions, 47 deletions
diff --git a/src/xmenu.c b/src/xmenu.c
index 2d41350e737..e04a801ef71 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -139,53 +139,6 @@ menubar_id_to_frame (LWLIB_ID id)
}
#endif
-
-#ifdef HAVE_X_WINDOWS
-/* Return the mouse position in *X and *Y. The coordinates are window
- relative for the edit window in frame F.
- This is for Fx_popup_menu. The mouse_position_hook can not
- be used for X, as it returns window relative coordinates
- for the window where the mouse is in. This could be the menu bar,
- the scroll bar or the edit window. Fx_popup_menu needs to be
- sure it is the edit window. */
-void
-mouse_position_for_popup (struct frame *f, int *x, int *y)
-{
- Window root, dummy_window;
- int dummy;
-
- eassert (FRAME_X_P (f));
-
- block_input ();
-
- XQueryPointer (FRAME_X_DISPLAY (f),
- DefaultRootWindow (FRAME_X_DISPLAY (f)),
-
- /* The root window which contains the pointer. */
- &root,
-
- /* Window pointer is on, not used */
- &dummy_window,
-
- /* The position on that root window. */
- x, y,
-
- /* x/y in dummy_window coordinates, not used. */
- &dummy, &dummy,
-
- /* Modifier keys and pointer buttons, about which
- we don't care. */
- (unsigned int *) &dummy);
-
- unblock_input ();
-
- /* x_menu_show expects window coordinates, not root window
- coordinates. Translate. */
- *x -= f->left_pos + FRAME_OUTER_TO_INNER_DIFF_X (f);
- *y -= f->top_pos + FRAME_OUTER_TO_INNER_DIFF_Y (f);
-}
-
-#endif /* HAVE_X_WINDOWS */
#ifndef MSDOS