[metacity] window: add decorated property



commit 1f560e465e431ef8772bddb2dbc2efbe4abd8c2a
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Fri Mar 17 17:16:52 2017 +0200

    window: add decorated property

 src/core/window-props.c |    5 +++++
 src/core/window.c       |   16 ++++++++++++++++
 2 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/src/core/window-props.c b/src/core/window-props.c
index 07c47fb..4407d31 100644
--- a/src/core/window-props.c
+++ b/src/core/window-props.c
@@ -869,6 +869,7 @@ reload_mwm_hints (MetaWindow    *window,
                   gboolean       initial)
 {
   MotifWmHints *hints;
+  gboolean decorated;
 
   window->mwm_decorated = TRUE;
   window->mwm_border_only = FALSE;
@@ -886,6 +887,7 @@ reload_mwm_hints (MetaWindow    *window,
     }
 
   hints = value->v.motif_hints;
+  decorated = window->decorated;
 
   /* We support those MWM hints deemed non-stupid */
 
@@ -985,6 +987,9 @@ reload_mwm_hints (MetaWindow    *window,
                          META_QUEUE_MOVE_RESIZE |
                          /* because ensure/destroy frame may unmap: */
                          META_QUEUE_CALC_SHOWING);
+
+      if (decorated != window->decorated)
+        g_object_notify (G_OBJECT (window), "decorated");
     }
 }
 
diff --git a/src/core/window.c b/src/core/window.c
index fa968ee..76ec1ea 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -133,6 +133,7 @@ enum
   PROP_0,
 
   PROP_APPEARS_FOCUSED,
+  PROP_DECORATED,
 
   LAST_PROP
 };
@@ -6641,6 +6642,10 @@ recalc_window_type (MetaWindow *window)
 
   if (old_type != window->type)
     {
+      gboolean decorated;
+
+      decorated = window->decorated;
+
       window->attached = meta_window_should_attach_to_parent (window);
       recalc_window_features (window);
 
@@ -6657,6 +6662,9 @@ recalc_window_type (MetaWindow *window)
       meta_window_update_layer (window);
 
       meta_window_grab_keys (window);
+
+      if (decorated != window->decorated)
+        g_object_notify_by_pspec (G_OBJECT (window), properties[PROP_DECORATED]);
     }
 }
 
@@ -9266,6 +9274,10 @@ meta_window_get_property (GObject    *object,
         g_value_set_boolean (value, meta_window_appears_focused (window));
         break;
 
+      case PROP_DECORATED:
+        g_value_set_boolean (value, window->decorated);
+        break;
+
       default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
         break;
@@ -9279,6 +9291,10 @@ install_properties (GObjectClass *object_class)
     g_param_spec_boolean ("appears-focused", "appears-focused", "appears-focused",
                           FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
 
+  properties[PROP_DECORATED] =
+    g_param_spec_boolean ("decorated", "decorated", "decorated",
+                          TRUE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+
   g_object_class_install_properties (object_class, LAST_PROP, properties);
 }
 


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