[gtk+/wip/carlosg/event-as-object: 17/23] gdk: Remove gdk_window_[gs]et_event_compression()



commit 01ad34c88dd33b463848e40f44a690f38d193dda
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Oct 31 13:18:49 2017 +0100

    gdk: Remove gdk_window_[gs]et_event_compression()
    
    Motion compression is now the unmodifiable default, callers may
    call gdk_event_get_motion_history() to check the uncoalesced
    motion history.

 gdk/gdkevents.c    |    3 ---
 gdk/gdkinternals.h |    1 -
 gdk/gdkwindow.c    |   44 --------------------------------------------
 gdk/gdkwindow.h    |    6 ------
 tests/testinput.c  |    5 -----
 5 files changed, 0 insertions(+), 59 deletions(-)
---
diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c
index 2deb1a2..2eb27de 100644
--- a/gdk/gdkevents.c
+++ b/gdk/gdkevents.c
@@ -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;
 
diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h
index b60ca5a..bd11f3d 100644
--- a/gdk/gdkinternals.h
+++ b/gdk/gdkinternals.h
@@ -233,7 +233,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.
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 2818ab9..c1760f5 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -1005,7 +1005,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;
@@ -6604,49 +6603,6 @@ gdk_window_set_focus_on_map (GdkWindow *window,
 }
 
 /**
- * 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.
  * @surfaces: (transfer none) (element-type cairo_surface_t):
diff --git a/gdk/gdkwindow.h b/gdk/gdkwindow.h
index 72156e1..65d85e6 100644
--- a/gdk/gdkwindow.h
+++ b/gdk/gdkwindow.h
@@ -895,12 +895,6 @@ 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,
                                                 gint            right,
diff --git a/tests/testinput.c b/tests/testinput.c
index b47037b..20358f8 100644
--- a/tests/testinput.c
+++ b/tests/testinput.c
@@ -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;


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