[gtk+] Fix up _gdk_windowing_window_at_pointer coordinate reporting
- From: Alexander Larsson <alexl src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk+] Fix up _gdk_windowing_window_at_pointer coordinate reporting
- Date: Mon, 5 Oct 2009 09:45:36 +0000 (UTC)
commit 786b589d95077b465dcc2311ff2489ee7bb9a49f
Author: Alexander Larsson <alexl redhat com>
Date: Mon Oct 5 11:39:29 2009 +0200
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.
gdk/x11/gdkwindow-x11.c | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index c65a0d4..a8dd83b 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -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;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]