aboutsummaryrefslogtreecommitdiffstats
path: root/sway
diff options
context:
space:
mode:
authorLibravatar Zandr Martin <zandrmartin@gmail.com>2016-09-17 15:54:45 -0500
committerLibravatar Zandr Martin <zandrmartin@gmail.com>2016-09-17 15:54:45 -0500
commite18b7cdfa920d536e4911a7ccbc2d6da5ae759f4 (patch)
tree8d64bd01413c08c5250085e8666cb4bef75efc97 /sway
parentMerge pull request #903 from RyanDwyer/fix-swaybar-output (diff)
downloadsway-e18b7cdfa920d536e4911a7ccbc2d6da5ae759f4.tar.gz
sway-e18b7cdfa920d536e4911a7ccbc2d6da5ae759f4.tar.zst
sway-e18b7cdfa920d536e4911a7ccbc2d6da5ae759f4.zip
add global `current_focus` pointer
Diffstat (limited to 'sway')
-rw-r--r--sway/focus.c4
-rw-r--r--sway/layout.c2
2 files changed, 6 insertions, 0 deletions
diff --git a/sway/focus.c b/sway/focus.c
index 02e61ac2..b94dcbc7 100644
--- a/sway/focus.c
+++ b/sway/focus.c
@@ -120,6 +120,10 @@ bool set_focused_container(swayc_t *c) {
120 // dispatch a window event 120 // dispatch a window event
121 ipc_event_window(c, "focus"); 121 ipc_event_window(c, "focus");
122 } 122 }
123
124 // update the global pointer
125 current_focus = c;
126
123 // update container focus from here to root, making necessary changes along 127 // update container focus from here to root, making necessary changes along
124 // the way 128 // the way
125 swayc_t *p = c; 129 swayc_t *p = c;
diff --git a/sway/layout.c b/sway/layout.c
index 2d29340e..7802c412 100644
--- a/sway/layout.c
+++ b/sway/layout.c
@@ -15,6 +15,7 @@
15#include "log.h" 15#include "log.h"
16 16
17swayc_t root_container; 17swayc_t root_container;
18swayc_t *current_focus;
18list_t *scratchpad; 19list_t *scratchpad;
19 20
20int min_sane_h = 60; 21int min_sane_h = 60;
@@ -27,6 +28,7 @@ void init_layout(void) {
27 root_container.children = create_list(); 28 root_container.children = create_list();
28 root_container.handle = -1; 29 root_container.handle = -1;
29 root_container.visible = true; 30 root_container.visible = true;
31 current_focus = &root_container;
30 scratchpad = create_list(); 32 scratchpad = create_list();
31} 33}
32 34