diff options
author | 2015-08-17 11:24:45 -0700 | |
---|---|---|
committer | 2015-08-17 11:24:45 -0700 | |
commit | d2995d1eb2f541db845c60c11420bf81ee0143ab (patch) | |
tree | f20d82edbe6336415596ba841c0e6cb284765e52 /sway | |
parent | fixed when views dont have names. (diff) | |
download | sway-d2995d1eb2f541db845c60c11420bf81ee0143ab.tar.gz sway-d2995d1eb2f541db845c60c11420bf81ee0143ab.tar.zst sway-d2995d1eb2f541db845c60c11420bf81ee0143ab.zip |
fixed handling of views with override_redirect (dmenu)
Diffstat (limited to 'sway')
-rw-r--r-- | sway/handlers.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sway/handlers.c b/sway/handlers.c index b166b7a6..78ca7438 100644 --- a/sway/handlers.c +++ b/sway/handlers.c | |||
@@ -13,6 +13,8 @@ | |||
13 | #include "container.h" | 13 | #include "container.h" |
14 | 14 | ||
15 | static struct wlc_origin mouse_origin; | 15 | static struct wlc_origin mouse_origin; |
16 | //Keyboard input is being overrided by window (dmenu) | ||
17 | static bool override_redirect = false; | ||
16 | 18 | ||
17 | static bool pointer_test(swayc_t *view, void *_origin) { | 19 | static bool pointer_test(swayc_t *view, void *_origin) { |
18 | const struct wlc_origin *origin = _origin; | 20 | const struct wlc_origin *origin = _origin; |
@@ -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 | ||
@@ -134,14 +137,14 @@ static void handle_view_destroyed(wlc_handle handle) { | |||
134 | wlc_view_set_state(handle, WLC_BIT_ACTIVATED, true); | 137 | wlc_view_set_state(handle, WLC_BIT_ACTIVATED, true); |
135 | sway_log(L_DEBUG,"Unmanaged window of type %x was destroyed", type); | 138 | sway_log(L_DEBUG,"Unmanaged window of type %x was destroyed", type); |
136 | if (type & WLC_BIT_UNMANAGED) { | 139 | if (type & WLC_BIT_UNMANAGED) { |
137 | focus_view(focus_pointer()); | 140 | focus_pointer(); |
138 | arrange_windows(active_workspace, -1, -1); | 141 | arrange_windows(active_workspace, -1, -1); |
139 | return; | 142 | return; |
140 | } | 143 | } |
141 | 144 | ||
142 | if (type & WLC_BIT_OVERRIDE_REDIRECT) { | 145 | if (type & WLC_BIT_OVERRIDE_REDIRECT) { |
143 | focus_view(focus_pointer()); | 146 | override_redirect = false; |
144 | arrange_windows(active_workspace, -1, -1); | 147 | focus_pointer(); |
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 | |||
221 | static bool handle_key(wlc_handle view, uint32_t time, const struct wlc_modifiers | 224 | static 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; |