diff --git a/src/manage.c b/src/manage.c index 3afde994..de4f6fd7 100644 --- a/src/manage.c +++ b/src/manage.c @@ -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; } } diff --git a/src/render.c b/src/render.c index f996d964..2cc50d57 100644 --- a/src/render.c +++ b/src/render.c @@ -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)