Commit 786b589d authored by Alexander Larsson's avatar Alexander Larsson

Fix up _gdk_windowing_window_at_pointer coordinate reporting

We need to do a final XQueryWindow to get the coordinates inside the
windows rather than in the parent window.

This fixes bug #597386, "Cannot click buttons more than once...", which
failed due to the grab tracking stuff getting the wrong coordinates as
per the above.
parent 45814323
......@@ -3252,12 +3252,15 @@ _gdk_windowing_window_at_pointer (GdkDisplay *display,
while (xwindow)
{
xwindow_last = xwindow;
if (get_toplevel &&
(window = gdk_window_lookup_for_display (display, xwindow)) != NULL &&
GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN)
break;
XQueryPointer (xdisplay, xwindow,
&root, &xwindow, &rootx, &rooty, &winx, &winy, &xmask);
if (get_toplevel &&
(window = gdk_window_lookup_for_display (display, xwindow_last)) != NULL &&
GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN)
{
xwindow = xwindow_last;
break;
}
}
}
else
......@@ -3315,16 +3318,16 @@ _gdk_windowing_window_at_pointer (GdkDisplay *display,
while (xwindow)
{
xwindow_last = xwindow;
if (get_toplevel &&
(window = gdk_window_lookup_for_display (display, xwindow)) != NULL &&
GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN)
break;
gdk_error_trap_push ();
XQueryPointer (xdisplay, xwindow,
&root, &xwindow, &rootx, &rooty, &winx, &winy, &xmask);
gdk_flush ();
if (gdk_error_trap_pop ())
break;
if (get_toplevel &&
(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