[gtk/readonly-events-1: 34/51] Drop GDK_NOTHING



commit 96726502f89bc1b1fe6ff0f22d29299d3f6bac0f
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Feb 16 00:39:11 2020 -0500

    Drop GDK_NOTHING
    
    Events of type GDK_NOTHING are good for nothing.

 gdk/gdkevents.c             | 10 +---------
 gdk/gdkevents.h             |  2 --
 gdk/gdksurface.c            |  1 -
 gdk/win32/gdkevents-win32.c |  1 -
 gtk/gtkmain.c               |  3 ---
 5 files changed, 1 insertion(+), 16 deletions(-)
---
diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c
index 6547b054b3..b5cd263714 100644
--- a/gdk/gdkevents.c
+++ b/gdk/gdkevents.c
@@ -80,12 +80,6 @@ check_event_sanity (GdkEvent *event)
   surface = gdk_event_get_surface (event);
   device = gdk_event_get_device (event);
 
-  if (gdk_event_get_event_type (event) == GDK_NOTHING)
-    {
-      g_warning ("Ignoring GDK_NOTHING events; they're good for nothing");
-      return FALSE;
-    }
-
   if (surface && display != gdk_surface_get_display (surface))
     {
       char *type = g_enum_to_string (GDK_TYPE_EVENT_TYPE, event->any.type);
@@ -552,7 +546,6 @@ gdk_event_get_time (const GdkEvent *event)
         return event->pad_group_mode.time;
       case GDK_CONFIGURE:
       case GDK_FOCUS_CHANGE:
-      case GDK_NOTHING:
       case GDK_DELETE:
       case GDK_GRAB_BROKEN:
       case GDK_EVENT_LAST:
@@ -624,7 +617,6 @@ gdk_event_get_state (const GdkEvent  *event,
       case GDK_DRAG_LEAVE:
       case GDK_DRAG_MOTION:
       case GDK_DROP_START:
-      case GDK_NOTHING:
       case GDK_DELETE:
       case GDK_GRAB_BROKEN:
       case GDK_PAD_BUTTON_PRESS:
@@ -1542,7 +1534,7 @@ G_DEFINE_BOXED_TYPE (GdkEventSequence, gdk_event_sequence,
 GdkEventType
 gdk_event_get_event_type (const GdkEvent *event)
 {
-  g_return_val_if_fail (event != NULL, GDK_NOTHING);
+  g_return_val_if_fail (event != NULL, 0);
 
   return event->any.type;
 }
diff --git a/gdk/gdkevents.h b/gdk/gdkevents.h
index 4a9724487e..03d7aa28b9 100644
--- a/gdk/gdkevents.h
+++ b/gdk/gdkevents.h
@@ -124,7 +124,6 @@ typedef union  _GdkEvent        GdkEvent;
 
 /**
  * GdkEventType:
- * @GDK_NOTHING: a special code to indicate a null event.
  * @GDK_DELETE: the window manager has requested that the toplevel surface be
  *   hidden or destroyed, usually when the user clicks on a special icon in the
  *   title bar.
@@ -181,7 +180,6 @@ typedef union  _GdkEvent        GdkEvent;
  */
 typedef enum
 {
-  GDK_NOTHING,
   GDK_DELETE,
   GDK_MOTION_NOTIFY,
   GDK_BUTTON_PRESS,
diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c
index 9a5633960a..1ad61e5ef3 100644
--- a/gdk/gdksurface.c
+++ b/gdk/gdksurface.c
@@ -4111,7 +4111,6 @@ add_event_mark (GdkEvent *event,
     case GDK_FOCUS_CHANGE:
     case GDK_PROXIMITY_IN:
     case GDK_PROXIMITY_OUT:
-    case GDK_NOTHING:
     case GDK_EVENT_LAST:
     default:
       break;
diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c
index af8755be71..c14efa9bd3 100644
--- a/gdk/win32/gdkevents-win32.c
+++ b/gdk/win32/gdkevents-win32.c
@@ -763,7 +763,6 @@ _gdk_win32_print_event (const GdkEvent *event)
   switch (event->any.type)
     {
 #define CASE(x) case x: g_print (#x); break;
-    CASE (GDK_NOTHING);
     CASE (GDK_DELETE);
     CASE (GDK_DESTROY);
     CASE (GDK_MOTION_NOTIFY);
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index 1fe832c30a..a98bae5ca7 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -1833,9 +1833,6 @@ gtk_main_do_event (GdkEvent *event)
    */
   switch ((guint)event->any.type)
     {
-    case GDK_NOTHING:
-      break;
-
     case GDK_DELETE:
       g_object_ref (target_widget);
       if (!gtk_window_group_get_current_grab (window_group) ||


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