]> Pileus Git - ~andy/gtk/blobdiff - gdk/gdkinputgxi.h
Some bug fixes and improvements to the Win32 GDK.
[~andy/gtk] / gdk / gdkinputgxi.h
index b4f331283842dd19a17c72f77438059d1431bd78..773a0436b78b6b679042bc5ee612545063122572 100644 (file)
  * Boston, MA 02111-1307, USA.
  */
 
+/*
+ * Modified by the GTK+ Team and others 1997-1999.  See the AUTHORS
+ * file for a list of people on the GTK+ Team.  See the ChangeLog
+ * files for a list of changes.  These files are distributed with
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
+ */
+
 #ifdef XINPUT_GXI
 
 /* #define DEBUG_SWITCHING */
@@ -591,10 +598,9 @@ gdk_input_gxi_grab_pointer (GdkWindow *     window,
                            GdkWindow *     confine_to,
                            guint32         time)
 {
-  GdkInputWindow *input_window, *new_window;
   GList *tmp_list;
+  GdkInputWindow *input_window;
   GdkDevicePrivate *gdkdev;
-  GList *tmp_list;
 
   tmp_list = gdk_input_windows;
   while (tmp_list)
@@ -602,27 +608,25 @@ gdk_input_gxi_grab_pointer (GdkWindow *     window,
       input_window = (GdkInputWindow *)tmp_list->data;
 
       if (input_window->window == window)
-       new_window = input_window;
-      else (input_window->grabbed)
+       input_window->grabbed = TRUE;
+      else if (input_window->grabbed)
        input_window->grabbed = FALSE;
 
-      tmp_list = gdk_input_devices;
-      while (tmp_list)
-       {
-         gdkdev = (GdkDevicePrivate *)tmp_list->data;
-         if (gdkdev->info.deviceid != GDK_CORE_POINTER && 
-             gdkdev->xdevice &&
-             (gdkdev->button_state != 0))
-           gdkdev->button_state = 0;
-         
-         tmp_list = tmp_list->next;
-       }
-      
+      tmp_list = tmp_list->next;
+    }
+
+  tmp_list = gdk_input_devices;
+  while (tmp_list)
+    {
+      gdkdev = (GdkDevicePrivate *)tmp_list->data;
+      if (gdkdev->info.deviceid != GDK_CORE_POINTER && 
+         gdkdev->xdevice &&
+         (gdkdev->button_state != 0))
+       gdkdev->button_state = 0;
       
       tmp_list = tmp_list->next;
     }
 
-  new_window->grabbed = TRUE;
   return Success;
 }