mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 09:30:45 -05:00
window: Add wm-class property and notify it when changed.
https://bugzilla.gnome.org/show_bug.cgi?id=649315
This commit is contained in:
parent
7c9f492584
commit
64f37a3769
@ -845,6 +845,8 @@ reload_wm_class (MetaWindow *window,
|
||||
|
||||
if (value->v.class_hint.res_class)
|
||||
window->res_class = g_strdup (value->v.class_hint.res_class);
|
||||
|
||||
g_object_notify (G_OBJECT (window), "wm-class");
|
||||
}
|
||||
|
||||
meta_verbose ("Window %s class: '%s' name: '%s'\n",
|
||||
|
@ -155,7 +155,8 @@ enum {
|
||||
PROP_DEMANDS_ATTENTION,
|
||||
PROP_URGENT,
|
||||
PROP_MUTTER_HINTS,
|
||||
PROP_APPEARS_FOCUSED
|
||||
PROP_APPEARS_FOCUSED,
|
||||
PROP_WM_CLASS
|
||||
};
|
||||
|
||||
enum
|
||||
@ -247,6 +248,9 @@ meta_window_get_property(GObject *object,
|
||||
case PROP_APPEARS_FOCUSED:
|
||||
g_value_set_boolean (value, meta_window_appears_focused (win));
|
||||
break;
|
||||
case PROP_WM_CLASS:
|
||||
g_value_set_string (value, win->res_class);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
@ -382,6 +386,14 @@ meta_window_class_init (MetaWindowClass *klass)
|
||||
FALSE,
|
||||
G_PARAM_READABLE));
|
||||
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_WM_CLASS,
|
||||
g_param_spec_string ("wm-class",
|
||||
"WM_CLASS",
|
||||
"Contents of the WM_CLASS property of this window",
|
||||
NULL,
|
||||
G_PARAM_READABLE));
|
||||
|
||||
window_signals[WORKSPACE_CHANGED] =
|
||||
g_signal_new ("workspace-changed",
|
||||
G_TYPE_FROM_CLASS (object_class),
|
||||
|
Loading…
Reference in New Issue
Block a user