window: Add "skip-taskbar" property

We currently only have a method to query the skip-taskbar hint.
Add a corresponding property to allow listening for change
notifications.

https://bugzilla.gnome.org/show_bug.cgi?id=723307
This commit is contained in:
Florian Müllner 2014-01-30 16:40:59 +01:00
parent 64e09b37ac
commit 52c24c5c71

View File

@ -172,6 +172,7 @@ enum {
PROP_USER_TIME, PROP_USER_TIME,
PROP_DEMANDS_ATTENTION, PROP_DEMANDS_ATTENTION,
PROP_URGENT, PROP_URGENT,
PROP_SKIP_TASKBAR,
PROP_MUTTER_HINTS, PROP_MUTTER_HINTS,
PROP_APPEARS_FOCUSED, PROP_APPEARS_FOCUSED,
PROP_RESIZEABLE, PROP_RESIZEABLE,
@ -305,6 +306,9 @@ meta_window_get_property(GObject *object,
case PROP_URGENT: case PROP_URGENT:
g_value_set_boolean (value, win->wm_hints_urgent); g_value_set_boolean (value, win->wm_hints_urgent);
break; break;
case PROP_SKIP_TASKBAR:
g_value_set_boolean (value, win->skip_taskbar);
break;
case PROP_MUTTER_HINTS: case PROP_MUTTER_HINTS:
g_value_set_string (value, win->mutter_hints); g_value_set_string (value, win->mutter_hints);
break; break;
@ -465,6 +469,14 @@ meta_window_class_init (MetaWindowClass *klass)
FALSE, FALSE,
G_PARAM_READABLE)); G_PARAM_READABLE));
g_object_class_install_property (object_class,
PROP_SKIP_TASKBAR,
g_param_spec_boolean ("skip-taskbar",
"Skip taskbar",
"Whether the skip-taskbar flag of WM_HINTS is set",
FALSE,
G_PARAM_READABLE));
g_object_class_install_property (object_class, g_object_class_install_property (object_class,
PROP_MUTTER_HINTS, PROP_MUTTER_HINTS,
g_param_spec_string ("mutter-hints", g_param_spec_string ("mutter-hints",
@ -8464,6 +8476,7 @@ recalc_window_features (MetaWindow *window)
gboolean old_has_resize_func; gboolean old_has_resize_func;
gboolean old_has_shade_func; gboolean old_has_shade_func;
gboolean old_always_sticky; gboolean old_always_sticky;
gboolean old_skip_taskbar;
old_has_close_func = window->has_close_func; old_has_close_func = window->has_close_func;
old_has_minimize_func = window->has_minimize_func; old_has_minimize_func = window->has_minimize_func;
@ -8471,6 +8484,7 @@ recalc_window_features (MetaWindow *window)
old_has_resize_func = window->has_resize_func; old_has_resize_func = window->has_resize_func;
old_has_shade_func = window->has_shade_func; old_has_shade_func = window->has_shade_func;
old_always_sticky = window->always_sticky; old_always_sticky = window->always_sticky;
old_skip_taskbar = window->skip_taskbar;
/* Use MWM hints initially */ /* Use MWM hints initially */
window->decorated = window->mwm_decorated; window->decorated = window->mwm_decorated;
@ -8658,6 +8672,9 @@ recalc_window_features (MetaWindow *window)
window->skip_taskbar, window->skip_taskbar,
window->skip_pager); window->skip_pager);
if (old_skip_taskbar != window->skip_taskbar)
g_object_notify (G_OBJECT (window), "skip-taskbar");
/* FIXME: /* FIXME:
* Lame workaround for recalc_window_features * Lame workaround for recalc_window_features
* being used overzealously. The fix is to * being used overzealously. The fix is to