Merge pull request #813 from acrisci/bug/remove-dead-lock-var

Remove dead global locked_view_focus
This commit is contained in:
Drew DeVault 2016-08-01 22:33:37 -04:00 committed by GitHub
commit a4096b73c9
3 changed files with 5 additions and 18 deletions

View file

@ -33,7 +33,6 @@ bool set_focused_container_for(swayc_t *ancestor, swayc_t *container);
// and unlocked when they are destroyed // and unlocked when they are destroyed
extern bool locked_container_focus; extern bool locked_container_focus;
extern bool locked_view_focus;
// Prevents wss from being destroyed on focus switch // Prevents wss from being destroyed on focus switch
extern bool suspend_workspace_cleanup; extern bool suspend_workspace_cleanup;

View file

@ -10,7 +10,6 @@
#include "border.h" #include "border.h"
bool locked_container_focus = false; bool locked_container_focus = false;
bool locked_view_focus = false;
bool suspend_workspace_cleanup = false; bool suspend_workspace_cleanup = false;
// switches parent focus to c. will switch it accordingly // switches parent focus to c. will switch it accordingly
@ -151,12 +150,9 @@ bool set_focused_container(swayc_t *c) {
wlc_view_set_state(c->handle, WLC_BIT_ACTIVATED, true); wlc_view_set_state(c->handle, WLC_BIT_ACTIVATED, true);
} }
// set focus if view_focus is unlocked // set focus if view_focus is unlocked
if (!locked_view_focus) { wlc_view_focus(c->handle);
wlc_view_focus(c->handle); if (c->parent->layout != L_TABBED && c->parent->layout != L_STACKED) {
if (c->parent->layout != L_TABBED update_container_border(c);
&& c->parent->layout != L_STACKED) {
update_container_border(c);
}
} }
// rearrange if parent container is tabbed/stacked // rearrange if parent container is tabbed/stacked
@ -167,10 +163,8 @@ bool set_focused_container(swayc_t *c) {
} }
} else if (c->type == C_WORKSPACE) { } else if (c->type == C_WORKSPACE) {
// remove previous focus if view_focus is unlocked // remove previous focus if view_focus is unlocked
if (!locked_view_focus) { update_container_border(c);
update_container_border(c); wlc_view_focus(0);
wlc_view_focus(0);
}
} }
if (active_ws != workspace) { if (active_ws != workspace) {

View file

@ -343,7 +343,6 @@ static bool handle_view_created(wlc_handle handle) {
// Dmenu keeps viewfocus, but others with this flag don't, for now simulate // Dmenu keeps viewfocus, but others with this flag don't, for now simulate
// dmenu // dmenu
case WLC_BIT_OVERRIDE_REDIRECT: case WLC_BIT_OVERRIDE_REDIRECT:
// locked_view_focus = true;
wlc_view_focus(handle); wlc_view_focus(handle);
wlc_view_set_state(handle, WLC_BIT_ACTIVATED, true); wlc_view_set_state(handle, WLC_BIT_ACTIVATED, true);
wlc_view_bring_to_front(handle); wlc_view_bring_to_front(handle);
@ -437,7 +436,6 @@ static void handle_view_destroyed(wlc_handle handle) {
// DMENU has this flag, and takes view_focus, but other things with this // DMENU has this flag, and takes view_focus, but other things with this
// flag don't // flag don't
case WLC_BIT_OVERRIDE_REDIRECT: case WLC_BIT_OVERRIDE_REDIRECT:
// locked_view_focus = false;
break; break;
case WLC_BIT_OVERRIDE_REDIRECT|WLC_BIT_UNMANAGED: case WLC_BIT_OVERRIDE_REDIRECT|WLC_BIT_UNMANAGED:
locked_container_focus = false; locked_container_focus = false;
@ -646,10 +644,6 @@ static bool handle_key(wlc_handle view, uint32_t time, const struct wlc_modifier
return EVENT_PASSTHROUGH; return EVENT_PASSTHROUGH;
} }
if (locked_view_focus && state == WLC_KEY_STATE_PRESSED) {
return EVENT_PASSTHROUGH;
}
// reset pointer mode on keypress // reset pointer mode on keypress
if (state == WLC_KEY_STATE_PRESSED && pointer_state.mode) { if (state == WLC_KEY_STATE_PRESSED && pointer_state.mode) {
pointer_mode_reset(); pointer_mode_reset();