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.
This commit is contained in:
@ -3252,12 +3252,15 @@ _gdk_windowing_window_at_pointer (GdkDisplay *display,
|
|||||||
while (xwindow)
|
while (xwindow)
|
||||||
{
|
{
|
||||||
xwindow_last = 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,
|
XQueryPointer (xdisplay, xwindow,
|
||||||
&root, &xwindow, &rootx, &rooty, &winx, &winy, &xmask);
|
&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
|
else
|
||||||
@ -3315,16 +3318,16 @@ _gdk_windowing_window_at_pointer (GdkDisplay *display,
|
|||||||
while (xwindow)
|
while (xwindow)
|
||||||
{
|
{
|
||||||
xwindow_last = 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 ();
|
gdk_error_trap_push ();
|
||||||
XQueryPointer (xdisplay, xwindow,
|
XQueryPointer (xdisplay, xwindow,
|
||||||
&root, &xwindow, &rootx, &rooty, &winx, &winy, &xmask);
|
&root, &xwindow, &rootx, &rooty, &winx, &winy, &xmask);
|
||||||
gdk_flush ();
|
gdk_flush ();
|
||||||
if (gdk_error_trap_pop ())
|
if (gdk_error_trap_pop ())
|
||||||
break;
|
break;
|
||||||
|
if (get_toplevel &&
|
||||||
|
(window = gdk_window_lookup_for_display (display, xwindow_last)) != NULL &&
|
||||||
|
GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user