summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2011-07-03 21:16:28 +0200
committerCarlos Garnacho <carlosg@gnome.org>2011-10-30 18:20:29 +0100
commit0b841f89404d5c37976a015026977a44f8cf32f1 (patch)
tree56eaf67ae3c8e1d7ffe420510b1a76fd312d9809
parent61b120d08c8ecedbc26003690c9102be66bd1636 (diff)
downloadmutter-0b841f89404d5c37976a015026977a44f8cf32f1.tar.gz
display: Use the grab pointer for delayed window raising
-rw-r--r--src/core/display.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/core/display.c b/src/core/display.c
index 1a6213af9..29c18fcd3 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -48,6 +48,7 @@
#include "xprops.h"
#include "workspace-private.h"
#include "bell.h"
+#include "device-pointer.h"
#include "device-keyboard.h"
#include "device-private.h"
#include "input-events.h"
@@ -1469,22 +1470,26 @@ window_raise_with_delay_callback (void *data)
if (window == NULL)
return FALSE;
+ if (window->cur_grab == NULL)
+ return FALSE;
+
/* If we aren't already on top, check whether the pointer is inside
* the window and raise the window if so.
*/
if (meta_stack_get_top (window->screen->stack) != window)
{
- int x, y, root_x, root_y;
- Window root, child;
- unsigned int mask;
+ int root_x, root_y;
gboolean same_screen;
gboolean point_in_window;
+ MetaDevicePointer *pointer;
meta_error_trap_push (window->display);
- same_screen = XQueryPointer (window->display->xdisplay,
- window->xwindow,
- &root, &child,
- &root_x, &root_y, &x, &y, &mask);
+ pointer = META_DEVICE_POINTER (window->cur_grab->grab_pointer);
+ same_screen = meta_device_pointer_query_position (pointer,
+ window->xwindow,
+ NULL, NULL,
+ &root_x, &root_y,
+ NULL, NULL, NULL);
meta_error_trap_pop (window->display);
point_in_window =