[gtk+] win32: Remove some unused input stuff to make win32 build again



commit 74305597366d92a54692542078f653262041ebab
Author: Alexander Larsson <alexl redhat com>
Date:   Tue Mar 6 12:03:13 2012 +0100

    win32: Remove some unused input stuff to make win32 build again
    
    Input events doesn't quite seem to work though, so it needs some fixing.

 gdk/gdkinternals.h           |    1 -
 gdk/win32/gdkdevice-wintab.c |   34 ++++++++++---------------------
 gdk/win32/gdkdevice-wintab.h |    1 +
 gdk/win32/gdkevents-win32.c  |   43 ++++-----------------------------------
 gdk/win32/gdkinput.c         |   45 ------------------------------------------
 gdk/win32/gdkwindow-win32.c  |    2 -
 gdk/win32/gdkwindow-win32.h  |    2 -
 7 files changed, 17 insertions(+), 111 deletions(-)
---
diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h
index 1a4466f..35bbb7f 100644
--- a/gdk/gdkinternals.h
+++ b/gdk/gdkinternals.h
@@ -184,7 +184,6 @@ struct _GdkWindow
   gint y;
 
   GdkEventMask event_mask;
-  gint extension_events;
 
   GList *filters;
   GList *children;
diff --git a/gdk/win32/gdkdevice-wintab.c b/gdk/win32/gdkdevice-wintab.c
index 0c01307..122787d 100644
--- a/gdk/win32/gdkdevice-wintab.c
+++ b/gdk/win32/gdkdevice-wintab.c
@@ -250,6 +250,17 @@ gdk_device_wintab_select_window_events (GdkDevice    *device,
     }
 }
 
+gboolean
+_gdk_device_wintab_wants_events (GdkWindow       *window)
+{
+  GdkWindowInputInfo *info;
+
+  info = g_object_get_qdata (G_OBJECT (window),
+                             quark_window_input_info);
+
+  return info != NULL;
+}
+
 GdkEventMask
 _gdk_device_wintab_get_events (GdkDeviceWintab *device,
                                GdkWindow       *window)
@@ -359,26 +370,3 @@ _gdk_device_wintab_translate_axes (GdkDeviceWintab *device_wintab,
   if (y)
     *y = temp_y;
 }
-
-void
-_gdk_input_check_extension_events (GdkDevice *device)
-{
-  GSList *l;
-
-  if (!GDK_IS_DEVICE_WINTAB (device))
-    return;
-
-  for (l = input_windows; l; l = l->next)
-    {
-      GdkWindow *window_private;
-      GdkEventMask event_mask = 0;
-
-      window_private = l->data;
-
-      if (gdk_device_get_mode (device) != GDK_MODE_DISABLED)
-        event_mask = window_private->extension_events;
-
-      gdk_window_set_device_events (GDK_WINDOW (window_private),
-                                    device, event_mask);
-    }
-}
diff --git a/gdk/win32/gdkdevice-wintab.h b/gdk/win32/gdkdevice-wintab.h
index f085557..987d8bf 100644
--- a/gdk/win32/gdkdevice-wintab.h
+++ b/gdk/win32/gdkdevice-wintab.h
@@ -59,6 +59,7 @@ struct _GdkDeviceWintabClass
 
 GType gdk_device_wintab_get_type (void) G_GNUC_CONST;
 
+gboolean     _gdk_device_wintab_wants_events (GdkWindow *window);
 GdkEventMask _gdk_device_wintab_get_events (GdkDeviceWintab *device,
                                             GdkWindow       *window);
 gboolean     _gdk_device_wintab_get_window_coords (GdkWindow *window,
diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c
index 05a68c3..7088600 100644
--- a/gdk/win32/gdkevents-win32.c
+++ b/gdk/win32/gdkevents-win32.c
@@ -1135,7 +1135,7 @@ send_crossing_event (GdkDisplay                 *display,
   _gdk_win32_append_event (event);
 
   if (type == GDK_ENTER_NOTIFY &&
-      window->extension_events != 0)
+      _gdk_device_wintab_wants_events (window))
     _gdk_device_wintab_update_window_coords (window);
 }
 
@@ -1320,23 +1320,12 @@ propagate (GdkWindow  **window,
 	   gboolean     grab_owner_events,
 	   gint	        grab_mask,
 	   gboolean   (*doesnt_want_it) (gint mask,
-					 MSG *msg),
-	   gboolean    	check_extended)
+					 MSG *msg))
 {
   if (grab_window != NULL && !grab_owner_events)
     {
       /* Event source is grabbed with owner_events FALSE */
 
-      /* See if the event should be ignored because an extended input
-       * device is used
-       */
-      if (check_extended &&
-	  grab_window->extension_events != 0 &&
-	  _gdk_input_ignore_core)
-	{
-	  GDK_NOTE (EVENTS, g_print (" (ignored for grabber)"));
-	  return FALSE;
-	}
       if ((*doesnt_want_it) (grab_mask, msg))
 	{
 	  GDK_NOTE (EVENTS, g_print (" (grabber doesn't want it)"));
@@ -1355,13 +1344,6 @@ propagate (GdkWindow  **window,
    */
   while (TRUE)
     {
-      if (check_extended &&
-	  (*window)->extension_events != 0 &&
-	  _gdk_input_ignore_core)
-	{
-	  GDK_NOTE (EVENTS, g_print (" (ignored)"));
-	  return FALSE;
-	}
       if ((*doesnt_want_it) ((*window)->event_mask, msg))
 	{
 	  /* Owner doesn't want it, propagate to parent. */
@@ -1373,13 +1355,6 @@ propagate (GdkWindow  **window,
 		{
 		  /* Event source is grabbed with owner_events TRUE */
 
-		  if (check_extended &&
-		      grab_window->extension_events != 0 &&
-		      _gdk_input_ignore_core)
-		    {
-		      GDK_NOTE (EVENTS, g_print (" (ignored for grabber)"));
-		      return FALSE;
-		    }
 		  if ((*doesnt_want_it) (grab_mask, msg))
 		    {
 		      /* Grabber doesn't want it either */
@@ -2061,7 +2036,7 @@ gdk_event_translate (MSG  *msg,
 		      keyboard_grab->window,
 		      keyboard_grab->owner_events,
 		      GDK_ALL_EVENTS_MASK,
-		      doesnt_want_key, FALSE))
+		      doesnt_want_key))
 	break;
 
       if (GDK_WINDOW_DESTROYED (window))
@@ -2171,7 +2146,7 @@ gdk_event_translate (MSG  *msg,
 		      keyboard_grab->window,
 		      keyboard_grab->owner_events,
 		      GDK_ALL_EVENTS_MASK,
-		      doesnt_want_char, FALSE))
+		      doesnt_want_char))
 	break;
 
       if (GDK_WINDOW_DESTROYED (window))
@@ -2276,14 +2251,6 @@ gdk_event_translate (MSG  *msg,
 			 GET_X_LPARAM (msg->lParam), GET_Y_LPARAM (msg->lParam)));
 
       assign_object (&window, find_window_for_mouse_event (window, msg));
-#if 0
-      if (window->extension_events != 0 &&
-	  _gdk_input_ignore_core)
-	{
-	  GDK_NOTE (EVENTS, g_print (" (ignored)"));
-	  break;
-	}
-#endif
 
       if (pointer_grab != NULL && pointer_grab->implicit)
 	{
@@ -2797,7 +2764,7 @@ gdk_event_translate (MSG  *msg,
 	      !GDK_WINDOW_DESTROYED (window))
 	    _gdk_win32_emit_configure_event (window);
 
-	  if (window->extension_events != 0)
+	  if (_gdk_device_wintab_wants_events (window))
 	    _gdk_device_wintab_update_window_coords (window);
 	}
 
diff --git a/gdk/win32/gdkinput.c b/gdk/win32/gdkinput.c
index 31b7d41..223cf46 100644
--- a/gdk/win32/gdkinput.c
+++ b/gdk/win32/gdkinput.c
@@ -57,51 +57,6 @@ _gdk_win32_display_list_devices (GdkDisplay *dpy)
   return _gdk_input_devices;
 }
 
-/* FIXME: this routine currently needs to be called between creation
-   and the corresponding configure event (because it doesn't get the
-   root_relative_geometry).  This should work with
-   gtk_window_set_extension_events, but will likely fail in other
-   cases */
-
-void
-gdk_input_set_extension_events (GdkWindow *window, gint mask,
-                                GdkExtensionMode mode)
-{
-  GdkDeviceManager *device_manager;
-  GList *devices, *d;
-
-  g_return_if_fail (GDK_IS_WINDOW (window));
-
-  if (GDK_WINDOW_DESTROYED (window))
-    return;
-
-  if (mode == GDK_EXTENSION_EVENTS_NONE)
-    mask = 0;
-
-  window->extension_events = mask;
-
-  device_manager = gdk_display_get_device_manager (_gdk_display);
-  devices = gdk_device_manager_list_devices (device_manager,
-                                             GDK_DEVICE_TYPE_FLOATING);
-
-  for (d = devices; d; d = d->next)
-    {
-      GdkDevice *dev;
-      gint dev_mask;
-
-      dev = d->data;
-      dev_mask = mask;
-
-      if (gdk_device_get_mode (dev) == GDK_MODE_DISABLED ||
-          (!gdk_device_get_has_cursor (dev) && mode == GDK_EXTENSION_EVENTS_CURSOR))
-        dev_mask = 0;
-
-      gdk_window_set_device_events (window, dev, mask);
-    }
-
-  g_list_free (devices);
-}
-
 void
 _gdk_input_init (GdkDisplay *display)
 {
diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c
index 4baaf96..92b8839 100644
--- a/gdk/win32/gdkwindow-win32.c
+++ b/gdk/win32/gdkwindow-win32.c
@@ -135,7 +135,6 @@ gdk_window_impl_win32_init (GdkWindowImplWin32 *impl)
   impl->hicon_small = NULL;
   impl->hint_flags = 0;
   impl->type_hint = GDK_WINDOW_TYPE_HINT_NORMAL;
-  impl->extension_events_selected = FALSE;
   impl->transient_owner = NULL;
   impl->transient_children = NULL;
   impl->num_transients = 0;
@@ -490,7 +489,6 @@ _gdk_win32_display_create_window_impl (GdkDisplay    *display,
   if (attributes_mask & GDK_WA_VISUAL)
     g_assert (gdk_screen_get_system_visual (screen) == attributes->visual);
 
-  impl->extension_events_selected = FALSE;
   impl->override_redirect = override_redirect;
 
   /* wclass is not any longer set always, but if is ... */
diff --git a/gdk/win32/gdkwindow-win32.h b/gdk/win32/gdkwindow-win32.h
index fc2cc03..b4960cb 100644
--- a/gdk/win32/gdkwindow-win32.h
+++ b/gdk/win32/gdkwindow-win32.h
@@ -67,8 +67,6 @@ struct _GdkWindowImplWin32
 
   GdkWindowTypeHint type_hint;
 
-  gboolean extension_events_selected;
-
   GdkWindow *transient_owner;
   GSList    *transient_children;
   gint       num_transients;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]