From 6a5d5612356d8c40a8ce4034813239eddb7e2044 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ingo=20B=C3=BCrk?= Date: Sat, 28 Mar 2015 18:29:34 +0100 Subject: [PATCH] Move urgency hint when moving container When an urgent container is moved to another workspace, the urgency hint 1) is unset on the source workspace and 2) set on the target workspace fixes #1187 --- src/con.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/con.c b/src/con.c index b610b0c6..41dd0196 100644 --- a/src/con.c +++ b/src/con.c @@ -736,6 +736,9 @@ void con_move_to_workspace(Con *con, Con *workspace, bool fix_coordinates, bool } } + /* Save the urgency state so that we can restore it. */ + bool urgent = con->urgent; + /* Save the current workspace. So we can call workspace_show() by the end * of this function. */ Con *current_ws = con_get_workspace(focused); @@ -843,7 +846,7 @@ void con_move_to_workspace(Con *con, Con *workspace, bool fix_coordinates, bool if (source_ws == current_ws) con_focus(con_descend_focused(focus_next)); - /* If anything within the container is associated with a startup sequence, + /* 9. If anything within the container is associated with a startup sequence, * delete it so child windows won't be created on the old workspace. */ struct Startup_Sequence *sequence; xcb_get_property_cookie_t cookie; @@ -877,6 +880,12 @@ void con_move_to_workspace(Con *con, Con *workspace, bool fix_coordinates, bool CALL(parent, on_remove_child); + /* 10. If the container was marked urgent, move the urgency hint. */ + if (urgent) { + workspace_update_urgent_flag(source_ws); + con_set_urgency(con, true); + } + ipc_send_window_event("move", con); } -- 2.39.5