summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Geiger <sbastig@gmx.net>2018-01-07 18:45:58 +0100
committerMarco Trevisan (TreviƱo) <mail@3v1n0.net>2018-01-09 22:24:48 -0500
commit16cda4ba7ffb1674c12f0b7d45444a43d917e779 (patch)
treeb47866291b28757c071afb0cfb9606c4055efb4b
parent6ddcd45450446b1adeb2b4eedaa116b8773b4781 (diff)
downloadlibwnck-16cda4ba7ffb1674c12f0b7d45444a43d917e779.tar.gz
util: allow setting the same client type again
https://bugzilla.gnome.org/show_bug.cgi?id=792304
-rw-r--r--libwnck/util.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libwnck/util.c b/libwnck/util.c
index d90f585..c8e0e6e 100644
--- a/libwnck/util.c
+++ b/libwnck/util.c
@@ -636,6 +636,11 @@ static WnckClientType client_type = 0;
* tasklists, it is important to set the role to %WNCK_CLIENT_TYPE_PAGER for
* libwnck to properly work.
*
+ * This function should only be called once per program. Additional calls
+ * with the same client type will be silently ignored. An attempt to change
+ * the client type to a differnet value after it has already been set will
+ * be ignored and a critical warning will be logged.
+ *
* Since: 2.14
*/
void
@@ -644,8 +649,8 @@ wnck_set_client_type (WnckClientType ewmh_sourceindication_client_type)
/* Clients constantly switching types makes no sense; this should only be
* set once.
*/
- if (client_type != 0)
- g_critical ("wnck_set_client_type got called multiple times.\n");
+ if (client_type != 0 && client_type != ewmh_sourceindication_client_type)
+ g_critical ("wnck_set_client_type: changing the client type is not supported.\n");
else
client_type = ewmh_sourceindication_client_type;
}