gdk: Remove gdk_window_[gs]et_event_compression()
authorCarlos Garnacho <carlosg@gnome.org>
Tue, 31 Oct 2017 12:18:49 +0000 (13:18 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Thu, 14 Dec 2017 00:05:48 +0000 (01:05 +0100)
Motion compression is now the unmodifiable default, callers may
call gdk_event_get_motion_history() to check the uncoalesced
motion history.

gdk/gdkevents.c
gdk/gdkinternals.h
gdk/gdkwindow.c
gdk/gdkwindow.h
tests/testinput.c

index 8b3b98144a8d53b32f2349ffd39856ac08612162..823b39487bcce33022b2db62496358281a3b1edf 100644 (file)
@@ -392,9 +392,6 @@ _gdk_event_queue_handle_motion_compression (GdkDisplay *display)
           pending_motion_device != event->any.device)
         break;
 
-      if (!event->any.window->event_compression)
-        break;
-
       if (!last_motion)
         last_motion = event;
 
index 8e96d203ed1bd3bbdb3d9edc6951a05b3d0d21da..f3f269224fa2c2f9b9a964b41a604e073b0a922f 100644 (file)
@@ -235,7 +235,6 @@ struct _GdkWindow
   guint applied_shape : 1;
   guint in_update : 1;
   guint geometry_dirty : 1;
-  guint event_compression : 1;
   guint frame_clock_events_paused : 1;
 
   /* The GdkWindow that has the impl, ref:ed if another window.
index f950596412b4c242036d8d5523e0bdcbe60a86ef..c65c34eda6903f6a2d84881bb7c845eedebcdf5e 100644 (file)
@@ -881,7 +881,6 @@ gdk_window_new (GdkDisplay    *display,
 
   window->accept_focus = TRUE;
   window->focus_on_map = TRUE;
-  window->event_compression = TRUE;
 
   window->x = attributes->x;
   window->y = attributes->y;
@@ -6232,49 +6231,6 @@ gdk_window_set_focus_on_map (GdkWindow *window,
   GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_focus_on_map (window, focus_on_map);
 }
 
-/**
- * gdk_window_set_event_compression:
- * @window: a #GdkWindow
- * @event_compression: %TRUE if motion events should be compressed
- *
- * Determines whether or not extra unprocessed motion events in
- * the event queue can be discarded. If %TRUE only the most recent
- * event will be delivered.
- *
- * Some types of applications, e.g. paint programs, need to see all
- * motion events and will benefit from turning off event compression.
- *
- * By default, event compression is enabled.
- *
- * Since: 3.12
- **/
-void
-gdk_window_set_event_compression (GdkWindow *window,
-                                  gboolean   event_compression)
-{
-  g_return_if_fail (GDK_IS_WINDOW (window));
-
-  window->event_compression = !!event_compression;
-}
-
-/**
- * gdk_window_get_event_compression:
- * @window: a #GdkWindow
- *
- * Get the current event compression setting for this window.
- *
- * Returns: %TRUE if motion events will be compressed
- *
- * Since: 3.12
- **/
-gboolean
-gdk_window_get_event_compression (GdkWindow *window)
-{
-  g_return_val_if_fail (GDK_IS_WINDOW (window), TRUE);
-
-  return window->event_compression;
-}
-
 /**
  * gdk_window_set_icon_list:
  * @window: The #GdkWindow toplevel window to set the icon of.
index 61f66ce19c28b8ea2d531ad3e85c6eb5e22b1541..62f3490c88a0bf1beb079b36587bada51ee38bd4 100644 (file)
@@ -877,12 +877,6 @@ GDK_AVAILABLE_IN_3_10
 void       gdk_window_set_opaque_region        (GdkWindow      *window,
                                                 cairo_region_t *region);
 
-GDK_AVAILABLE_IN_3_12
-void       gdk_window_set_event_compression    (GdkWindow      *window,
-                                                gboolean        event_compression);
-GDK_AVAILABLE_IN_3_12
-gboolean   gdk_window_get_event_compression    (GdkWindow      *window);
-
 GDK_AVAILABLE_IN_3_12
 void       gdk_window_set_shadow_width         (GdkWindow      *window,
                                                 gint            left,
index b47037b86d1d6c872782cb34c1fbf1a8b41a131c..20358f893f71781cbe2ac6f5295d213f6306490e 100644 (file)
@@ -256,7 +256,6 @@ main (int argc, char *argv[])
   GtkWidget *drawing_area;
   GtkWidget *vbox;
   GtkWidget *button;
-  GdkWindow *gdk_win;
 
   gtk_init ();
 
@@ -314,10 +313,6 @@ main (int argc, char *argv[])
 
   gtk_widget_show (window);
 
-  /* request all motion events */
-  gdk_win = gtk_widget_get_window (drawing_area);
-  gdk_window_set_event_compression (gdk_win, FALSE);
-
   gtk_main ();
 
   return 0;