From 8c0ae7be839e4fb4d0bb2ff27b403acc87bd31c3 Mon Sep 17 00:00:00 2001 From: Tomas Frydrych Date: Wed, 11 Feb 2009 12:16:41 +0000 Subject: [PATCH] Turned window decorated flag into MetaWindow::decorated property. This allows things like the compositor to easily track decoration status. --- src/core/window-props.c | 4 ++++ src/core/window.c | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/core/window-props.c b/src/core/window-props.c index 602d29561..b940855da 100644 --- a/src/core/window-props.c +++ b/src/core/window-props.c @@ -608,6 +608,7 @@ reload_mwm_hints (MetaWindow *window, MetaPropValue *value) { MotifWmHints *hints; + gboolean old_decorated = window->decorated; window->mwm_decorated = TRUE; window->mwm_border_only = FALSE; @@ -724,6 +725,9 @@ reload_mwm_hints (MetaWindow *window, META_QUEUE_MOVE_RESIZE | /* because ensure/destroy frame may unmap: */ META_QUEUE_CALC_SHOWING); + + if (old_decorated != window->decorated) + g_object_notify (G_OBJECT (window), "decorated"); } } diff --git a/src/core/window.c b/src/core/window.c index a9a0d9099..2f7d60fc1 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -140,6 +140,7 @@ enum { PROP_TITLE, PROP_ICON, PROP_MINI_ICON, + PROP_DECORATED, }; enum @@ -196,6 +197,9 @@ meta_window_get_property(GObject *object, case PROP_MINI_ICON: g_value_set_object (value, win->mini_icon); break; + case PROP_DECORATED: + g_value_set_boolean (value, win->decorated); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -249,6 +253,14 @@ meta_window_class_init (MetaWindowClass *klass) GDK_TYPE_PIXBUF, G_PARAM_READABLE)); + g_object_class_install_property (object_class, + PROP_DECORATED, + g_param_spec_boolean ("decorated", + "Decorated", + "Whether windos is decorated", + TRUE, + G_PARAM_READABLE)); + window_signals[WORKSPACE_CHANGED] = g_signal_new ("workspace-changed", G_TYPE_FROM_CLASS (object_class), @@ -6564,6 +6576,8 @@ recalc_window_type (MetaWindow *window) if (old_type != window->type) { + gboolean old_decorated = window->decorated; + recalc_window_features (window); if (!window->override_redirect) @@ -6579,6 +6593,9 @@ recalc_window_type (MetaWindow *window) meta_window_update_layer (window); meta_window_grab_keys (window); + + if (old_decorated != window->decorated) + g_object_notify (G_OBJECT (window), "decorated"); } }