summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSrdjan Grubor <sgnn7@sgnn7.org>2013-08-28 16:29:24 -0700
committerSrdjan Grubor <sgnn7@sgnn7.org>2013-08-28 16:29:24 -0700
commit1fe432a7c2c2eef4bfda3f81e5b323758a17bb29 (patch)
tree141447b777013448f87d383a44b28f3909b15e54
parent67b53c7fa1e29fe3f8a545c849af2936215e3a68 (diff)
parent85a29272d2cba4a6d7d5e5021f0631b289900deb (diff)
Merge pull request #277 from endlessm/shell-issues/853
Set WM_CLASS to application ID
-rw-r--r--endless/eoswindow.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/endless/eoswindow.c b/endless/eoswindow.c
index f6451e2..37216f3 100644
--- a/endless/eoswindow.c
+++ b/endless/eoswindow.c
@@ -369,6 +369,26 @@ eos_window_get_property (GObject *object,
}
static void
+set_application (EosWindow *self,
+ EosApplication *application)
+{
+ self->priv->application = application;
+ gtk_window_set_application (GTK_WINDOW (self),
+ GTK_APPLICATION (self->priv->application));
+ if (self->priv->application == NULL)
+ {
+ g_error ("In order to create a window, you must have an application "
+ "for it to connect to.");
+ return;
+ }
+
+ /* Application's WM_CLASS hint should be the application ID */
+ const gchar *id;
+ id = g_application_get_application_id (G_APPLICATION (application));
+ gtk_window_set_wmclass (GTK_WINDOW (self), id, id);
+}
+
+static void
eos_window_set_property (GObject *object,
guint property_id,
const GValue *value,
@@ -379,12 +399,7 @@ eos_window_set_property (GObject *object,
switch (property_id)
{
case PROP_APPLICATION:
- self->priv->application = g_value_get_object (value);
- gtk_window_set_application (GTK_WINDOW (self),
- GTK_APPLICATION (self->priv->application));
- if (self->priv->application == NULL)
- g_error ("In order to create a window, you must have an application "
- "for it to connect to.");
+ set_application (self, g_value_get_object (value));
break;
case PROP_PAGE_MANAGER: