[mutter/wip/carlosg/event-cleanup: 2/11] clutter: Drop CLUTTER_DESTROY_NOTIFY event




commit 0862fd1cd6e34ff2714d1301919221b31bb7fbbf
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Dec 7 18:18:00 2020 +0100

    clutter: Drop CLUTTER_DESTROY_NOTIFY event
    
    Stop propagating this as a Clutter event. DestroyNotify is only
    relevant on nested X11 sessions, so handle it specifically in place.

 clutter/clutter/clutter-actor.c             |  6 ------
 clutter/clutter/clutter-enums.h             |  2 --
 clutter/clutter/clutter-event.c             |  5 -----
 clutter/clutter/clutter-main.c              | 10 ----------
 src/backends/x11/meta-stage-x11.c           |  7 ++++---
 src/core/events.c                           |  3 +--
 src/tests/clutter/interactive/test-events.c |  3 ---
 src/tests/clutter/interactive/test-grab.c   |  3 ---
 8 files changed, 5 insertions(+), 34 deletions(-)
---
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c
index e655900800..75a0ef1b97 100644
--- a/clutter/clutter/clutter-actor.c
+++ b/clutter/clutter/clutter-actor.c
@@ -1085,7 +1085,6 @@ static GQuark quark_pointer_focus = 0;
 static GQuark quark_button = 0;
 static GQuark quark_scroll = 0;
 static GQuark quark_stage = 0;
-static GQuark quark_destroy = 0;
 static GQuark quark_touch = 0;
 static GQuark quark_touchpad = 0;
 static GQuark quark_proximity = 0;
@@ -5904,7 +5903,6 @@ clutter_actor_class_init (ClutterActorClass *klass)
   quark_button = g_quark_from_static_string ("button");
   quark_scroll = g_quark_from_static_string ("scroll");
   quark_stage = g_quark_from_static_string ("stage");
-  quark_destroy = g_quark_from_static_string ("destroy");
   quark_touch = g_quark_from_static_string ("touch");
   quark_touchpad = g_quark_from_static_string ("touchpad");
   quark_proximity = g_quark_from_static_string ("proximity");
@@ -12274,10 +12272,6 @@ clutter_actor_event (ClutterActor       *actor,
       signal_num = -1;
       detail = quark_pad;
       break;
-    case CLUTTER_DESTROY_NOTIFY:
-      signal_num = -1;
-      detail = quark_destroy;
-      break;
     case CLUTTER_STAGE_STATE:
       signal_num = -1;
       detail = quark_stage;
diff --git a/clutter/clutter/clutter-enums.h b/clutter/clutter/clutter-enums.h
index 7a928d4bcb..527513f425 100644
--- a/clutter/clutter/clutter-enums.h
+++ b/clutter/clutter/clutter-enums.h
@@ -817,7 +817,6 @@ typedef enum /*< flags prefix=CLUTTER_EVENT >*/
  * @CLUTTER_BUTTON_RELEASE: Pointer button release event
  * @CLUTTER_SCROLL: Pointer scroll event
  * @CLUTTER_STAGE_STATE: Stage state change event
- * @CLUTTER_DESTROY_NOTIFY: Destroy notification event
  * @CLUTTER_TOUCH_BEGIN: A new touch event sequence has started;
  *   event added in 1.10
  * @CLUTTER_TOUCH_UPDATE: A touch event sequence has been updated;
@@ -853,7 +852,6 @@ typedef enum /*< prefix=CLUTTER >*/
   CLUTTER_BUTTON_RELEASE,
   CLUTTER_SCROLL,
   CLUTTER_STAGE_STATE,
-  CLUTTER_DESTROY_NOTIFY,
   CLUTTER_TOUCH_BEGIN,
   CLUTTER_TOUCH_UPDATE,
   CLUTTER_TOUCH_END,
diff --git a/clutter/clutter/clutter-event.c b/clutter/clutter/clutter-event.c
index 7af9f136d4..99b6765899 100644
--- a/clutter/clutter/clutter-event.c
+++ b/clutter/clutter/clutter-event.c
@@ -385,7 +385,6 @@ clutter_event_get_position (const ClutterEvent *event,
     case CLUTTER_KEY_PRESS:
     case CLUTTER_KEY_RELEASE:
     case CLUTTER_STAGE_STATE:
-    case CLUTTER_DESTROY_NOTIFY:
     case CLUTTER_EVENT_LAST:
     case CLUTTER_PROXIMITY_IN:
     case CLUTTER_PROXIMITY_OUT:
@@ -462,7 +461,6 @@ clutter_event_set_coords (ClutterEvent *event,
     case CLUTTER_KEY_PRESS:
     case CLUTTER_KEY_RELEASE:
     case CLUTTER_STAGE_STATE:
-    case CLUTTER_DESTROY_NOTIFY:
     case CLUTTER_EVENT_LAST:
     case CLUTTER_PROXIMITY_IN:
     case CLUTTER_PROXIMITY_OUT:
@@ -1055,7 +1053,6 @@ clutter_event_set_device (ClutterEvent       *event,
     {
     case CLUTTER_NOTHING:
     case CLUTTER_STAGE_STATE:
-    case CLUTTER_DESTROY_NOTIFY:
     case CLUTTER_EVENT_LAST:
     case CLUTTER_IM_COMMIT:
     case CLUTTER_IM_DELETE:
@@ -1154,7 +1151,6 @@ clutter_event_get_device (const ClutterEvent *event)
     {
     case CLUTTER_NOTHING:
     case CLUTTER_STAGE_STATE:
-    case CLUTTER_DESTROY_NOTIFY:
     case CLUTTER_IM_COMMIT:
     case CLUTTER_IM_DELETE:
     case CLUTTER_IM_PREEDIT:
@@ -1619,7 +1615,6 @@ clutter_event_get_axes (const ClutterEvent *event,
     {
     case CLUTTER_NOTHING:
     case CLUTTER_STAGE_STATE:
-    case CLUTTER_DESTROY_NOTIFY:
     case CLUTTER_ENTER:
     case CLUTTER_LEAVE:
     case CLUTTER_KEY_PRESS:
diff --git a/clutter/clutter/clutter-main.c b/clutter/clutter/clutter-main.c
index e4fcce1df5..fc7254c258 100644
--- a/clutter/clutter/clutter-main.c
+++ b/clutter/clutter/clutter-main.c
@@ -1653,16 +1653,6 @@ _clutter_process_event_details (ClutterActor        *stage,
         emit_crossing_event (event, device);
         break;
 
-      case CLUTTER_DESTROY_NOTIFY:
-        event->any.source = stage;
-
-        if (_clutter_event_process_filters (event))
-          break;
-
-        /* the stage did not handle the event, so we just quit */
-        clutter_stage_event (CLUTTER_STAGE (stage), event);
-        break;
-
       case CLUTTER_MOTION:
         if (clutter_backend_is_display_server (backend) &&
             !(event->any.flags & CLUTTER_EVENT_FLAG_SYNTHETIC))
diff --git a/src/backends/x11/meta-stage-x11.c b/src/backends/x11/meta-stage-x11.c
index 18c64b6ca2..650076c747 100644
--- a/src/backends/x11/meta-stage-x11.c
+++ b/src/backends/x11/meta-stage-x11.c
@@ -734,9 +734,10 @@ meta_stage_x11_translate_event (MetaStageX11 *stage_x11,
       g_debug ("Destroy notification received for stage, win:0x%x",
                (unsigned int) xevent->xany.window);
 
-      event->any.type = CLUTTER_DESTROY_NOTIFY;
-      event->any.stage = stage;
-      res = TRUE;
+      g_return_val_if_fail (META_IS_STAGE_X11_NESTED (stage_x11),
+                            FALSE);
+      meta_quit (META_EXIT_SUCCESS);
+      res = FALSE;
       break;
 
     case ClientMessage:
diff --git a/src/core/events.c b/src/core/events.c
index d6fbdb9f45..8859a342ff 100644
--- a/src/core/events.c
+++ b/src/core/events.c
@@ -110,8 +110,7 @@ handle_idletime_for_event (const ClutterEvent *event)
   if (event->any.flags & CLUTTER_EVENT_FLAG_SYNTHETIC ||
       event->type == CLUTTER_ENTER ||
       event->type == CLUTTER_LEAVE ||
-      event->type == CLUTTER_STAGE_STATE ||
-      event->type == CLUTTER_DESTROY_NOTIFY)
+      event->type == CLUTTER_STAGE_STATE)
     return;
 
   core_monitor = meta_idle_monitor_get_core ();
diff --git a/src/tests/clutter/interactive/test-events.c b/src/tests/clutter/interactive/test-events.c
index 633d71d698..1d1c63dd41 100644
--- a/src/tests/clutter/interactive/test-events.c
+++ b/src/tests/clutter/interactive/test-events.c
@@ -350,9 +350,6 @@ input_cb (ClutterActor *actor,
     case CLUTTER_STAGE_STATE:
       g_print ("[%s] STAGE STATE", clutter_actor_get_name (source_actor));
       break;
-    case CLUTTER_DESTROY_NOTIFY:
-      g_print ("[%s] DESTROY NOTIFY", clutter_actor_get_name (source_actor));
-      break;
     case CLUTTER_TOUCHPAD_PINCH:
       g_print ("[%s] TOUCHPAD PINCH", clutter_actor_get_name (source_actor));
       break;
diff --git a/src/tests/clutter/interactive/test-grab.c b/src/tests/clutter/interactive/test-grab.c
index 3b3a268a6b..fc1912f9f7 100644
--- a/src/tests/clutter/interactive/test-grab.c
+++ b/src/tests/clutter/interactive/test-grab.c
@@ -62,9 +62,6 @@ debug_event_cb (ClutterActor *actor,
     case CLUTTER_STAGE_STATE:
       printf("[%s] STAGE STATE", source);
       break;
-    case CLUTTER_DESTROY_NOTIFY:
-      printf("[%s] DESTROY NOTIFY", source);
-      break;
     case CLUTTER_TOUCH_BEGIN:
       g_print ("[%s] TOUCH BEGIN", source);
       break;


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