[mutter] window-x11: Move delete_window to MetaWindowX11Private



commit 3bf80a967c59f14a7c5bc56ee304cc7e0cfb313a
Author: Marco Trevisan (Treviño) <mail 3v1n0 net>
Date:   Wed Jan 30 20:40:17 2019 +0100

    window-x11: Move delete_window to MetaWindowX11Private
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/421

 src/core/window-private.h    |  1 -
 src/core/window.c            |  1 -
 src/x11/window-props.c       |  4 ++--
 src/x11/window-x11-private.h |  1 +
 src/x11/window-x11.c         | 16 +++++++++++++++-
 src/x11/window-x11.h         |  2 ++
 6 files changed, 20 insertions(+), 5 deletions(-)
---
diff --git a/src/core/window-private.h b/src/core/window-private.h
index 4bee88fe6..ffbbf2982 100644
--- a/src/core/window-private.h
+++ b/src/core/window-private.h
@@ -327,7 +327,6 @@ struct _MetaWindow
   guint icon_geometry_set : 1;
 
   /* These are the flags from WM_PROTOCOLS */
-  guint delete_window : 1;
   guint can_ping : 1;
   /* Globally active / No input */
   guint input : 1;
diff --git a/src/core/window.c b/src/core/window.c
index af0423f8d..963ab625b 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -1079,7 +1079,6 @@ _meta_window_shared_new (MetaDisplay         *display,
   window->initial_timestamp_set = FALSE;
   window->net_wm_user_time_set = FALSE;
   window->user_time_window = None;
-  window->delete_window = FALSE;
   window->can_ping = FALSE;
   window->input = TRUE;
   window->calc_placement = FALSE;
diff --git a/src/x11/window-props.c b/src/x11/window-props.c
index 6ad7905f4..dd194d9ea 100644
--- a/src/x11/window-props.c
+++ b/src/x11/window-props.c
@@ -1531,9 +1531,9 @@ reload_wm_protocols (MetaWindow    *window,
 {
   int i;
 
-  window->delete_window = FALSE;
   window->can_ping = FALSE;
   meta_window_x11_set_wm_take_focus (window, FALSE);
+  meta_window_x11_set_wm_delete_window (window, FALSE);
 
   if (value->type == META_PROP_VALUE_INVALID)
     return;
@@ -1546,7 +1546,7 @@ reload_wm_protocols (MetaWindow    *window,
         meta_window_x11_set_wm_take_focus (window, TRUE);
       else if (value->v.atom_list.atoms[i] ==
                window->display->x11_display->atom_WM_DELETE_WINDOW)
-        window->delete_window = TRUE;
+        meta_window_x11_set_wm_delete_window (window, TRUE);
       else if (value->v.atom_list.atoms[i] ==
                window->display->x11_display->atom__NET_WM_PING)
         window->can_ping = TRUE;
diff --git a/src/x11/window-x11-private.h b/src/x11/window-x11-private.h
index 9f0ada728..7a4a7b8f0 100644
--- a/src/x11/window-x11-private.h
+++ b/src/x11/window-x11-private.h
@@ -48,6 +48,7 @@ struct _MetaWindowX11Private
   guint wm_state_skip_taskbar : 1;
   guint wm_state_skip_pager : 1;
   guint wm_take_focus : 1;
+  guint wm_delete_window : 1;
 
   /* Weird "_NET_WM_STATE_MODAL" flag */
   guint wm_state_modal : 1;
diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c
index af5df998b..02920a805 100644
--- a/src/x11/window-x11.c
+++ b/src/x11/window-x11.c
@@ -691,14 +691,28 @@ meta_window_x11_ping (MetaWindow *window,
   send_icccm_message (window, display->x11_display->atom__NET_WM_PING, serial);
 }
 
+void
+meta_window_x11_set_wm_delete_window (MetaWindow *window,
+                                      gboolean    delete_window)
+{
+  MetaWindowX11 *window_x11 = META_WINDOW_X11 (window);
+  MetaWindowX11Private *priv =
+    meta_window_x11_get_instance_private (window_x11);
+
+  priv->wm_delete_window = delete_window;
+}
+
 static void
 meta_window_x11_delete (MetaWindow *window,
                         guint32     timestamp)
 {
+  MetaWindowX11 *window_x11 = META_WINDOW_X11 (window);
+  MetaWindowX11Private *priv =
+    meta_window_x11_get_instance_private (window_x11);
   MetaX11Display *x11_display = window->display->x11_display;
 
   meta_x11_error_trap_push (x11_display);
-  if (window->delete_window)
+  if (priv->wm_delete_window)
     {
       meta_topic (META_DEBUG_WINDOW_OPS,
                   "Deleting %s with delete_window request\n",
diff --git a/src/x11/window-x11.h b/src/x11/window-x11.h
index a28d9dc0e..4a2b33184 100644
--- a/src/x11/window-x11.h
+++ b/src/x11/window-x11.h
@@ -53,6 +53,8 @@ void meta_window_x11_set_net_wm_state            (MetaWindow *window);
 void meta_window_x11_set_wm_state                (MetaWindow *window);
 void meta_window_x11_set_wm_take_focus           (MetaWindow *window,
                                                   gboolean    take_focus);
+void meta_window_x11_set_wm_delete_window        (MetaWindow *window,
+                                                  gboolean    delete_window);
 void meta_window_x11_set_allowed_actions_hint    (MetaWindow *window);
 
 void meta_window_x11_create_sync_request_alarm   (MetaWindow *window);


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