From cd0ef08783376cccd166ee771115ea212367baac Mon Sep 17 00:00:00 2001 From: Tomas Frydrych Date: Tue, 17 Mar 2009 12:27:13 +0000 Subject: [PATCH] Added MetaWindow::fullscreen property (read only). --- src/core/window-props.c | 8 +++++++- src/core/window.c | 22 +++++++++++++++++++--- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/core/window-props.c b/src/core/window-props.c index 39d407675..716c3aa27 100644 --- a/src/core/window-props.c +++ b/src/core/window-props.c @@ -583,7 +583,13 @@ reload_net_wm_state (MetaWindow *window, else if (value->v.atom_list.atoms[i] == window->display->atom__NET_WM_STATE_SKIP_PAGER) window->wm_state_skip_pager = TRUE; else if (value->v.atom_list.atoms[i] == window->display->atom__NET_WM_STATE_FULLSCREEN) - window->fullscreen = TRUE; + { + if (!window->fullscreen) + { + window->fullscreen = TRUE; + g_object_notify (G_OBJECT (window), "fullscreen"); + } + } else if (value->v.atom_list.atoms[i] == window->display->atom__NET_WM_STATE_ABOVE) window->wm_state_above = TRUE; else if (value->v.atom_list.atoms[i] == window->display->atom__NET_WM_STATE_BELOW) diff --git a/src/core/window.c b/src/core/window.c index 6042a8123..94be7a5c4 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -139,6 +139,7 @@ enum { PROP_ICON, PROP_MINI_ICON, PROP_DECORATED, + PROP_FULLSCREEN, }; enum @@ -198,6 +199,9 @@ meta_window_get_property(GObject *object, case PROP_DECORATED: g_value_set_boolean (value, win->decorated); break; + case PROP_FULLSCREEN: + g_value_set_boolean (value, win->fullscreen); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -259,6 +263,14 @@ meta_window_class_init (MetaWindowClass *klass) TRUE, G_PARAM_READABLE)); + g_object_class_install_property (object_class, + PROP_FULLSCREEN, + g_param_spec_boolean ("fullscreen", + "Fullscreen", + "Whether windos is fullscreened", + FALSE, + G_PARAM_READABLE)); + window_signals[WORKSPACE_CHANGED] = g_signal_new ("workspace-changed", G_TYPE_FROM_CLASS (object_class), @@ -3086,6 +3098,8 @@ meta_window_make_fullscreen_internal (MetaWindow *window) recalc_window_features (window); set_net_wm_state (window); + + g_object_notify (G_OBJECT (window), "fullscreen"); } } @@ -3130,6 +3144,8 @@ meta_window_unmake_fullscreen (MetaWindow *window) recalc_window_features (window); set_net_wm_state (window); + + g_object_notify (G_OBJECT (window), "fullscreen"); } } @@ -3270,10 +3286,10 @@ window_activate (MetaWindow *window, if (workspace == NULL) workspace = window->screen->active_workspace; - /* For non-transient windows, we just set up a pulsing indicator, + /* For non-transient windows, we just set up a pulsing indicator, rather than move windows or workspaces. See http://bugzilla.gnome.org/show_bug.cgi?id=482354 */ - if (window->xtransient_for == None && + if (window->xtransient_for == None && !meta_window_located_on_workspace (window, workspace)) { meta_window_set_demands_attention (window); @@ -3282,7 +3298,7 @@ window_activate (MetaWindow *window, } else if (window->xtransient_for != None) { - /* Move transients to current workspace - preference dialogs should appear over + /* Move transients to current workspace - preference dialogs should appear over the source window. */ meta_window_change_workspace (window, workspace); }