window: Add a property for on_all_workspaces

Some plugins and extensions want to be able to know when the sticky
field of a window changes, so add a property for it and allow them
to connect to the notify::on-all-workspaces signal.
This commit is contained in:
Tom Beckmann 2014-06-24 22:05:36 +02:00 committed by Jasper St. Pierre
parent 901901825c
commit 692acbd986

View File

@ -157,7 +157,8 @@ enum {
PROP_GTK_APPLICATION_OBJECT_PATH,
PROP_GTK_WINDOW_OBJECT_PATH,
PROP_GTK_APP_MENU_OBJECT_PATH,
PROP_GTK_MENUBAR_OBJECT_PATH
PROP_GTK_MENUBAR_OBJECT_PATH,
PROP_ON_ALL_WORKSPACES
};
enum
@ -353,6 +354,9 @@ meta_window_get_property(GObject *object,
case PROP_GTK_MENUBAR_OBJECT_PATH:
g_value_set_string (value, win->gtk_menubar_object_path);
break;
case PROP_ON_ALL_WORKSPACES:
g_value_set_boolean (value, win->on_all_workspaces);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@ -581,6 +585,14 @@ meta_window_class_init (MetaWindowClass *klass)
NULL,
G_PARAM_READABLE));
g_object_class_install_property (object_class,
PROP_ON_ALL_WORKSPACES,
g_param_spec_boolean ("on-all-workspaces",
"On all workspaces",
"Whether the window is set to appear on all workspaces",
FALSE,
G_PARAM_READABLE));
window_signals[WORKSPACE_CHANGED] =
g_signal_new ("workspace-changed",
G_TYPE_FROM_CLASS (object_class),
@ -1456,6 +1468,8 @@ meta_window_update_on_all_workspaces (MetaWindow *window)
}
}
meta_window_current_workspace_changed (window);
g_object_notify (G_OBJECT (window), "on-all-workspaces");
}
}