]> Pileus Git - ~andy/gtk/commitdiff
When emulating X11's automatic grab on button down, pass owner_events as
authorTor Lillqvist <tml@iki.fi>
Sun, 22 Jun 2003 00:21:03 +0000 (00:21 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Sun, 22 Jun 2003 00:21:03 +0000 (00:21 +0000)
2003-06-21  Tor Lillqvist  <tml@iki.fi>

* gdk/win32/gdkevents-win32.c (gdk_event_translate): When
emulating X11's automatic grab on button down, pass owner_events
as FALSE. According to the XLib spec, automatic grabs use True for
owner_events when OwnerGrabButtonMask is selected, and I don't see
the X11 backend doing that. (#110271)
(find_window_for_pointer_event): Improve debugging output.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gdk/win32/gdkevents-win32.c

index a4fe42f5040008ee104fe642db3f59ef8f0b8156..ef0b4f8f04630976b4a9a04c4c05cd6d8e00dffe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2003-06-21  Tor Lillqvist  <tml@iki.fi>
+
+       * gdk/win32/gdkevents-win32.c (gdk_event_translate): When
+       emulating X11's automatic grab on button down, pass owner_events
+       as FALSE. According to the XLib spec, automatic grabs use True for
+       owner_events when OwnerGrabButtonMask is selected, and I don't see
+       the X11 backend doing that. (#110271)
+       (find_window_for_pointer_event): Improve debugging output.
+
 2003-06-17  Tor Lillqvist  <tml@iki.fi>
 
        * gtk-zip.sh.in (DLLDIR): Look for DLLs also in the bin
index a4fe42f5040008ee104fe642db3f59ef8f0b8156..ef0b4f8f04630976b4a9a04c4c05cd6d8e00dffe 100644 (file)
@@ -1,3 +1,12 @@
+2003-06-21  Tor Lillqvist  <tml@iki.fi>
+
+       * gdk/win32/gdkevents-win32.c (gdk_event_translate): When
+       emulating X11's automatic grab on button down, pass owner_events
+       as FALSE. According to the XLib spec, automatic grabs use True for
+       owner_events when OwnerGrabButtonMask is selected, and I don't see
+       the X11 backend doing that. (#110271)
+       (find_window_for_pointer_event): Improve debugging output.
+
 2003-06-17  Tor Lillqvist  <tml@iki.fi>
 
        * gtk-zip.sh.in (DLLDIR): Look for DLLs also in the bin
index a4fe42f5040008ee104fe642db3f59ef8f0b8156..ef0b4f8f04630976b4a9a04c4c05cd6d8e00dffe 100644 (file)
@@ -1,3 +1,12 @@
+2003-06-21  Tor Lillqvist  <tml@iki.fi>
+
+       * gdk/win32/gdkevents-win32.c (gdk_event_translate): When
+       emulating X11's automatic grab on button down, pass owner_events
+       as FALSE. According to the XLib spec, automatic grabs use True for
+       owner_events when OwnerGrabButtonMask is selected, and I don't see
+       the X11 backend doing that. (#110271)
+       (find_window_for_pointer_event): Improve debugging output.
+
 2003-06-17  Tor Lillqvist  <tml@iki.fi>
 
        * gtk-zip.sh.in (DLLDIR): Look for DLLs also in the bin
index a4fe42f5040008ee104fe642db3f59ef8f0b8156..ef0b4f8f04630976b4a9a04c4c05cd6d8e00dffe 100644 (file)
@@ -1,3 +1,12 @@
+2003-06-21  Tor Lillqvist  <tml@iki.fi>
+
+       * gdk/win32/gdkevents-win32.c (gdk_event_translate): When
+       emulating X11's automatic grab on button down, pass owner_events
+       as FALSE. According to the XLib spec, automatic grabs use True for
+       owner_events when OwnerGrabButtonMask is selected, and I don't see
+       the X11 backend doing that. (#110271)
+       (find_window_for_pointer_event): Improve debugging output.
+
 2003-06-17  Tor Lillqvist  <tml@iki.fi>
 
        * gtk-zip.sh.in (DLLDIR): Look for DLLs also in the bin
index a4fe42f5040008ee104fe642db3f59ef8f0b8156..ef0b4f8f04630976b4a9a04c4c05cd6d8e00dffe 100644 (file)
@@ -1,3 +1,12 @@
+2003-06-21  Tor Lillqvist  <tml@iki.fi>
+
+       * gdk/win32/gdkevents-win32.c (gdk_event_translate): When
+       emulating X11's automatic grab on button down, pass owner_events
+       as FALSE. According to the XLib spec, automatic grabs use True for
+       owner_events when OwnerGrabButtonMask is selected, and I don't see
+       the X11 backend doing that. (#110271)
+       (find_window_for_pointer_event): Improve debugging output.
+
 2003-06-17  Tor Lillqvist  <tml@iki.fi>
 
        * gtk-zip.sh.in (DLLDIR): Look for DLLs also in the bin
index ff70323ab97d119a6f5d6d15034fe3101e0d4a3e..5d2cc50f62df0492e72d1664cd1ce699c52fb071 100644 (file)
@@ -551,7 +551,7 @@ gdk_pointer_grab (GdkWindow    *window,
                                     hcursor,
                                     event_mask_string (event_mask)));
          p_grab_mask = event_mask;
-         p_grab_owner_events = (owner_events != 0);
+         p_grab_owner_events = owner_events;
          p_grab_automatic = FALSE;
          
 #if USE_SETCAPTURE
@@ -629,7 +629,7 @@ find_window_for_pointer_event (GdkWindow*  reported_window,
   HWND hwnd;
   POINTS points;
   POINT pt;
-  GdkWindow* other_window;
+  GdkWindow* other_window = NULL;
 
   if (p_grab_window == NULL || !p_grab_owner_events)
     return reported_window;
@@ -643,13 +643,16 @@ find_window_for_pointer_event (GdkWindow*  reported_window,
                              pt.x, pt.y));
 
   hwnd = WindowFromPoint (pt);
-  if (hwnd == NULL)
-    return reported_window;
-  other_window = gdk_win32_handle_table_lookup ((GdkNativeWindow) hwnd);
+  if (hwnd != NULL)
+    other_window = gdk_win32_handle_table_lookup ((GdkNativeWindow) hwnd);
+
   if (other_window == NULL)
-    return reported_window;
+    {
+      GDK_NOTE (EVENTS, g_print ("...none, using original\n"));
+      return reported_window;
+    }
 
-  GDK_NOTE (EVENTS, g_print ("Found window %p for point (%ld, %ld)\n",
+  GDK_NOTE (EVENTS, g_print ("...found %p for (%ld, %ld)\n",
                             hwnd, pt.x, pt.y));
 
   gdk_window_unref (reported_window);
@@ -1573,7 +1576,7 @@ propagate (GdkWindow  **window,
              *window = GDK_WINDOW (GDK_WINDOW_OBJECT (*window)->parent);
              gdk_drawable_ref (*window);
              GDK_NOTE (EVENTS, g_print ("%s %p",
-                                        (in_propagation ? "," : " ...propagating to"),
+                                        (in_propagation ? "," : "...propagating to"),
                                         GDK_WINDOW_HWND (*window)));
              /* The only branch where we actually continue the loop */
              in_propagation = TRUE;
@@ -2574,11 +2577,9 @@ gdk_event_translate (GdkDisplay *display,
       if (!p_grab_window)
        {
          /* No explicit active grab, let's start one automatically */
-         gint owner_events = (private->event_mask & (GDK_BUTTON_PRESS_MASK|GDK_BUTTON_RELEASE_MASK));
-         
          GDK_NOTE (EVENTS, g_print ("...automatic grab started\n"));
          gdk_pointer_grab (window,
-                           owner_events,
+                           FALSE,
                            private->event_mask,
                            NULL, NULL, 0);
          p_grab_automatic = TRUE;