From 697a88958e9d51c2b393398bbc0e13a5206ceabd Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Thu, 5 May 2016 18:29:35 +0200 Subject: [PATCH] client_manage: Check for _NET_STARTUP_ID on WM_CLIENT_LEADER Apparently the spec allows to set the _NET_STARTUP_ID value on the property that WM_CLIENT_LEADER points to instead of the window itself. Thus, if we don't find a _NET_STARTUP_ID on the window itself, check again on the client leader window. Apparently GTK even does this (for whatever reason...)... Signed-off-by: Uli Schlachter --- objects/client.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/objects/client.c b/objects/client.c index b1ae5c4da..656fd953e 100644 --- a/objects/client.c +++ b/objects/client.c @@ -1241,8 +1241,19 @@ HANDLE_GEOM(height) xcb_get_property_reply(globalconf.connection, startup_id_q, NULL); /* Say spawn that a client has been started, with startup id as argument */ char *startup_id = xutil_get_text_property_from_reply(reply); - c->startup_id = startup_id; p_delete(&reply); + + if (startup_id == NULL && c->leader_window != XCB_NONE) { + /* GTK hides this property elsewhere. No idea why. */ + startup_id_q = xcb_get_property(globalconf.connection, false, + c->leader_window, _NET_STARTUP_ID, + XCB_GET_PROPERTY_TYPE_ANY, 0, UINT_MAX); + reply = xcb_get_property_reply(globalconf.connection, startup_id_q, NULL); + startup_id = xutil_get_text_property_from_reply(reply); + p_delete(&reply); + } + c->startup_id = startup_id; + spawn_start_notify(c, startup_id); luaA_class_emit_signal(L, &client_class, "list", 0);