]> git.sur5r.net Git - i3/i3/commitdiff
i3bar: Set `mapped` flag on trayclient creation
authorTony Crisci <tony@dubstepdish.com>
Thu, 26 Dec 2013 05:30:21 +0000 (00:30 -0500)
committerMichael Stapelberg <michael@stapelberg.de>
Wed, 1 Jan 2014 10:10:21 +0000 (11:10 +0100)
When a trayclient is first created as a structure in memory, explicitly
set the `mapped` flag to false. Otherwise it may initialize to `true` in
some circumstances without actually being mapped, causing a request to
be mapped from the client to be ignored.

Create the trayclient in memory before handling a request to be mapped
immediately.

fixes #1138

i3bar/src/xcb.c

index d3dc948e4c0d8014a35e7421dc39ba7ea01209d3..828610394dfe64dabb3059a9e6badece41b3aeb8 100644 (file)
@@ -603,17 +603,18 @@ static void handle_client_message(xcb_client_message_event_t* event) {
              * exits/crashes. */
             xcb_change_save_set(xcb_connection, XCB_SET_MODE_INSERT, client);
 
+            trayclient *tc = smalloc(sizeof(trayclient));
+            tc->win = client;
+            tc->xe_version = xe_version;
+            tc->mapped = false;
+            TAILQ_INSERT_TAIL(output->trayclients, tc, tailq);
+
             if (map_it) {
                 DLOG("Mapping dock client\n");
                 xcb_map_window(xcb_connection, client);
             } else {
                 DLOG("Not mapping dock client yet\n");
             }
-            trayclient *tc = smalloc(sizeof(trayclient));
-            tc->win = client;
-            tc->xe_version = xe_version;
-            TAILQ_INSERT_TAIL(output->trayclients, tc, tailq);
-
             /* Trigger an update to copy the statusline text to the appropriate
              * position */
             configure_trayclients();