Commit 48fc0f36 authored by Alexander Larsson's avatar Alexander Larsson

Fix mouse pointer handling on multiple screens

The fix in 786b589d for the
"Cannot click buttons more than once without moving the mouse cursor"
did not correctly handle setups with multiple screens in one display.

We need to handle the case where the first XQueryPointer returns
a different root window than the default one.

This fixes bug 597386 (agaion)
parent 3ea51bfe
......@@ -3256,7 +3256,7 @@ _gdk_windowing_window_at_pointer (GdkDisplay *display,
xwindow_last = xwindow;
XQueryPointer (xdisplay, xwindow,
&root, &xwindow, &rootx, &rooty, &winx, &winy, &xmask);
if (get_toplevel &&
if (get_toplevel && xwindow_last != root &&
(window = gdk_window_lookup_for_display (display, xwindow_last)) != NULL &&
GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN)
{
......@@ -3326,7 +3326,7 @@ _gdk_windowing_window_at_pointer (GdkDisplay *display,
gdk_flush ();
if (gdk_error_trap_pop ())
break;
if (get_toplevel &&
if (get_toplevel && xwindow_last != root &&
(window = gdk_window_lookup_for_display (display, xwindow_last)) != NULL &&
GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN)
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment