]> git.sur5r.net Git - i3/i3/commitdiff
handle windows whose WM_TRANSIENT_FOR points to themselve
authorMichael Stapelberg <michael@stapelberg.de>
Thu, 12 Jun 2014 19:16:45 +0000 (21:16 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Thu, 12 Jun 2014 19:16:45 +0000 (21:16 +0200)
I consider this behavior broken and not respecting the standard, but it
happens in real life, and it’s better for i3 to not busy-loop in such a
situation :).

fixes #1259

src/manage.c
src/render.c

index 3afde994325d385c9ddc720a87ba24b604dde076..de4f6fd75ce6391b9bbd004d3a20993f99e8e477 100644 (file)
@@ -407,6 +407,11 @@ void manage_window(xcb_window_t window, xcb_get_window_attributes_cookie_t cooki
                 Con *next_transient = con_by_window_id(transient_win->transient_for);
                 if (next_transient == NULL)
                     break;
+                /* Some clients (e.g. x11-ssh-askpass) actually set
+                 * WM_TRANSIENT_FOR to their own window id, so break instead of
+                 * looping endlessly. */
+                if (transient_win == next_transient->window)
+                    break;
                 transient_win = next_transient->window;
             }
         }
index f996d9641d849bc1cd69f0fe6f93825819505aa6..2cc50d5739c9b83049b64d7b930a14a281e8da50 100644 (file)
@@ -286,7 +286,15 @@ void render_con(Con *con, bool render_fullscreen) {
                             is_transient_for = true;
                             break;
                         }
-                        transient_con = con_by_window_id(transient_con->window->transient_for);
+                        Con *next_transient = con_by_window_id(transient_con->window->transient_for);
+                        if (next_transient == NULL)
+                            break;
+                        /* Some clients (e.g. x11-ssh-askpass) actually set
+                         * WM_TRANSIENT_FOR to their own window id, so break instead of
+                         * looping endlessly. */
+                        if (transient_con == next_transient)
+                            break;
+                        transient_con = next_transient;
                     }
 
                     if (!is_transient_for)