aboutsummaryrefslogtreecommitdiff
path: root/sway/focus.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2015-12-21 20:37:55 -0500
committerDrew DeVault <sir@cmpwn.com>2015-12-21 20:37:55 -0500
commit5a13d19d4967cd90def4c29cd5ebfbaaa43bc1da (patch)
treeebf8c63bfb812a5d8bd7ab455a5b68ef81054dd2 /sway/focus.c
parent442a54c38bb60d92bd4383f0d80ca55b876399e8 (diff)
parent50b04884b65b7e04234e8fa794a4e6db48c133a4 (diff)
Merge pull request #391 from mikkeloscar/trigger-workspace-ipc
Trigger ipc_event_workspace in all cases
Diffstat (limited to 'sway/focus.c')
-rw-r--r--sway/focus.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sway/focus.c b/sway/focus.c
index c1170ca4..cf0ee7f6 100644
--- a/sway/focus.c
+++ b/sway/focus.c
@@ -34,7 +34,7 @@ static void update_focus(swayc_t *c) {
// Case where workspace changes
case C_WORKSPACE:
if (prev) {
- ipc_event_workspace(prev, c);
+ ipc_event_workspace(prev, c, "focus");
// update visibility of old workspace
update_visibility(prev);
@@ -122,11 +122,6 @@ bool set_focused_container(swayc_t *c) {
p = p->parent;
p->is_focused = false;
}
- // active_ws might have been destroyed by now
- // (focus swap away from empty ws = destroy ws)
- if (active_ws_child_count == 0) {
- active_ws = NULL;
- }
// get new focused view and set focus to it.
p = get_focused_view(c);
@@ -146,7 +141,13 @@ bool set_focused_container(swayc_t *c) {
}
if (active_ws != workspace) {
- ipc_event_workspace(active_ws, workspace);
+ // active_ws might have been destroyed by now
+ // (focus swap away from empty ws = destroy ws)
+ if (active_ws_child_count == 0) {
+ active_ws = NULL;
+ }
+
+ ipc_event_workspace(active_ws, workspace, "focus");
}
return true;
}