diff options
author | Drew DeVault <sir@cmpwn.com> | 2016-08-01 22:33:37 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-01 22:33:37 -0400 |
commit | a4096b73c948e7f8496810df70842c54b2988d5e (patch) | |
tree | bd25bf981361c7e518d66df7ededf23d38cc165f | |
parent | Merge pull request #811 from acrisci/feature/focus-container (diff) | |
parent | Remove dead global locked_view_focus (diff) | |
download | sway-a4096b73c948e7f8496810df70842c54b2988d5e.tar.gz sway-a4096b73c948e7f8496810df70842c54b2988d5e.tar.zst sway-a4096b73c948e7f8496810df70842c54b2988d5e.zip |
Merge pull request #813 from acrisci/bug/remove-dead-lock-var
Remove dead global locked_view_focus
-rw-r--r-- | include/focus.h | 1 | ||||
-rw-r--r-- | sway/focus.c | 16 | ||||
-rw-r--r-- | sway/handlers.c | 6 |
3 files changed, 5 insertions, 18 deletions
diff --git a/include/focus.h b/include/focus.h index 236d050b..b532edc2 100644 --- a/include/focus.h +++ b/include/focus.h | |||
@@ -33,7 +33,6 @@ bool set_focused_container_for(swayc_t *ancestor, swayc_t *container); | |||
33 | // and unlocked when they are destroyed | 33 | // and unlocked when they are destroyed |
34 | 34 | ||
35 | extern bool locked_container_focus; | 35 | extern bool locked_container_focus; |
36 | extern bool locked_view_focus; | ||
37 | 36 | ||
38 | // Prevents wss from being destroyed on focus switch | 37 | // Prevents wss from being destroyed on focus switch |
39 | extern bool suspend_workspace_cleanup; | 38 | extern bool suspend_workspace_cleanup; |
diff --git a/sway/focus.c b/sway/focus.c index 45ec43e9..6583f802 100644 --- a/sway/focus.c +++ b/sway/focus.c | |||
@@ -10,7 +10,6 @@ | |||
10 | #include "border.h" | 10 | #include "border.h" |
11 | 11 | ||
12 | bool locked_container_focus = false; | 12 | bool locked_container_focus = false; |
13 | bool locked_view_focus = false; | ||
14 | bool suspend_workspace_cleanup = false; | 13 | bool suspend_workspace_cleanup = false; |
15 | 14 | ||
16 | // switches parent focus to c. will switch it accordingly | 15 | // switches parent focus to c. will switch it accordingly |
@@ -151,12 +150,9 @@ bool set_focused_container(swayc_t *c) { | |||
151 | wlc_view_set_state(c->handle, WLC_BIT_ACTIVATED, true); | 150 | wlc_view_set_state(c->handle, WLC_BIT_ACTIVATED, true); |
152 | } | 151 | } |
153 | // set focus if view_focus is unlocked | 152 | // set focus if view_focus is unlocked |
154 | if (!locked_view_focus) { | 153 | wlc_view_focus(c->handle); |
155 | wlc_view_focus(c->handle); | 154 | if (c->parent->layout != L_TABBED && c->parent->layout != L_STACKED) { |
156 | if (c->parent->layout != L_TABBED | 155 | update_container_border(c); |
157 | && c->parent->layout != L_STACKED) { | ||
158 | update_container_border(c); | ||
159 | } | ||
160 | } | 156 | } |
161 | 157 | ||
162 | // rearrange if parent container is tabbed/stacked | 158 | // rearrange if parent container is tabbed/stacked |
@@ -167,10 +163,8 @@ bool set_focused_container(swayc_t *c) { | |||
167 | } | 163 | } |
168 | } else if (c->type == C_WORKSPACE) { | 164 | } else if (c->type == C_WORKSPACE) { |
169 | // remove previous focus if view_focus is unlocked | 165 | // remove previous focus if view_focus is unlocked |
170 | if (!locked_view_focus) { | 166 | update_container_border(c); |
171 | update_container_border(c); | 167 | wlc_view_focus(0); |
172 | wlc_view_focus(0); | ||
173 | } | ||
174 | } | 168 | } |
175 | 169 | ||
176 | if (active_ws != workspace) { | 170 | if (active_ws != workspace) { |
diff --git a/sway/handlers.c b/sway/handlers.c index 684e45ba..80692371 100644 --- a/sway/handlers.c +++ b/sway/handlers.c | |||
@@ -343,7 +343,6 @@ static bool handle_view_created(wlc_handle handle) { | |||
343 | // Dmenu keeps viewfocus, but others with this flag don't, for now simulate | 343 | // Dmenu keeps viewfocus, but others with this flag don't, for now simulate |
344 | // dmenu | 344 | // dmenu |
345 | case WLC_BIT_OVERRIDE_REDIRECT: | 345 | case WLC_BIT_OVERRIDE_REDIRECT: |
346 | // locked_view_focus = true; | ||
347 | wlc_view_focus(handle); | 346 | wlc_view_focus(handle); |
348 | wlc_view_set_state(handle, WLC_BIT_ACTIVATED, true); | 347 | wlc_view_set_state(handle, WLC_BIT_ACTIVATED, true); |
349 | wlc_view_bring_to_front(handle); | 348 | wlc_view_bring_to_front(handle); |
@@ -437,7 +436,6 @@ static void handle_view_destroyed(wlc_handle handle) { | |||
437 | // DMENU has this flag, and takes view_focus, but other things with this | 436 | // DMENU has this flag, and takes view_focus, but other things with this |
438 | // flag don't | 437 | // flag don't |
439 | case WLC_BIT_OVERRIDE_REDIRECT: | 438 | case WLC_BIT_OVERRIDE_REDIRECT: |
440 | // locked_view_focus = false; | ||
441 | break; | 439 | break; |
442 | case WLC_BIT_OVERRIDE_REDIRECT|WLC_BIT_UNMANAGED: | 440 | case WLC_BIT_OVERRIDE_REDIRECT|WLC_BIT_UNMANAGED: |
443 | locked_container_focus = false; | 441 | locked_container_focus = false; |
@@ -646,10 +644,6 @@ static bool handle_key(wlc_handle view, uint32_t time, const struct wlc_modifier | |||
646 | return EVENT_PASSTHROUGH; | 644 | return EVENT_PASSTHROUGH; |
647 | } | 645 | } |
648 | 646 | ||
649 | if (locked_view_focus && state == WLC_KEY_STATE_PRESSED) { | ||
650 | return EVENT_PASSTHROUGH; | ||
651 | } | ||
652 | |||
653 | // reset pointer mode on keypress | 647 | // reset pointer mode on keypress |
654 | if (state == WLC_KEY_STATE_PRESSED && pointer_state.mode) { | 648 | if (state == WLC_KEY_STATE_PRESSED && pointer_state.mode) { |
655 | pointer_mode_reset(); | 649 | pointer_mode_reset(); |