summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2015-08-17 14:53:34 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2015-08-17 14:53:34 -0400
commit3b1bc2c11ed1073db5ac9299429a162d955878df (patch)
treed7bc33bbff31777d8c6f57352459c62e9675a0de
parentFix segfault from focus_view (diff)
parentput back (diff)
downloadsway-3b1bc2c11ed1073db5ac9299429a162d955878df.tar.gz
sway-3b1bc2c11ed1073db5ac9299429a162d955878df.tar.zst
sway-3b1bc2c11ed1073db5ac9299429a162d955878df.zip
Merge pull request #56 from taiyu-len/master
fixed handling of views with override_redirect (dmenu)
-rw-r--r--sway/handlers.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sway/handlers.c b/sway/handlers.c
index b166b7a6..5c673697 100644
--- a/sway/handlers.c
+++ b/sway/handlers.c
@@ -13,6 +13,8 @@
13#include "container.h" 13#include "container.h"
14 14
15static struct wlc_origin mouse_origin; 15static struct wlc_origin mouse_origin;
16//Keyboard input is being overrided by window (dmenu)
17static bool override_redirect = false;
16 18
17static bool pointer_test(swayc_t *view, void *_origin) { 19static bool pointer_test(swayc_t *view, void *_origin) {
18 const struct wlc_origin *origin = _origin; 20 const struct wlc_origin *origin = _origin;
@@ -36,7 +38,7 @@ swayc_t *focus_pointer(void) {
36 if (pointer && focused != pointer) { 38 if (pointer && focused != pointer) {
37 unfocus_all(&root_container); 39 unfocus_all(&root_container);
38 focus_view(pointer); 40 focus_view(pointer);
39 } else if (!focused){ 41 } else if (!focused) {
40 focus_view(active_workspace); 42 focus_view(active_workspace);
41 } 43 }
42 focused = pointer; 44 focused = pointer;
@@ -98,6 +100,7 @@ static bool handle_view_created(wlc_handle handle) {
98 } 100 }
99 // For things like Dmenu 101 // For things like Dmenu
100 if (type & WLC_BIT_OVERRIDE_REDIRECT) { 102 if (type & WLC_BIT_OVERRIDE_REDIRECT) {
103 override_redirect = true;
101 wlc_view_focus(handle); 104 wlc_view_focus(handle);
102 } 105 }
103 106
@@ -140,8 +143,8 @@ static void handle_view_destroyed(wlc_handle handle) {
140 } 143 }
141 144
142 if (type & WLC_BIT_OVERRIDE_REDIRECT) { 145 if (type & WLC_BIT_OVERRIDE_REDIRECT) {
146 override_redirect = false;
143 focus_view(focus_pointer()); 147 focus_view(focus_pointer());
144 arrange_windows(active_workspace, -1, -1);
145 return; 148 return;
146 } 149 }
147 if (type & WLC_BIT_POPUP) { 150 if (type & WLC_BIT_POPUP) {
@@ -221,6 +224,9 @@ static void handle_view_state_request(wlc_handle view, enum wlc_view_state_bit s
221static bool handle_key(wlc_handle view, uint32_t time, const struct wlc_modifiers 224static bool handle_key(wlc_handle view, uint32_t time, const struct wlc_modifiers
222 *modifiers, uint32_t key, uint32_t sym, enum wlc_key_state state) { 225 *modifiers, uint32_t key, uint32_t sym, enum wlc_key_state state) {
223 enum { QSIZE = 32 }; 226 enum { QSIZE = 32 };
227 if (override_redirect) {
228 return false;
229 }
224 static uint8_t head = 0; 230 static uint8_t head = 0;
225 static uint32_t array[QSIZE]; 231 static uint32_t array[QSIZE];
226 bool cmd_success = false; 232 bool cmd_success = false;