diff options
author | 2015-08-16 18:24:46 -0700 | |
---|---|---|
committer | 2015-08-16 18:24:46 -0700 | |
commit | 498cf268f712e0bc8d00cf9ef7e3886129904c67 (patch) | |
tree | 33d6e363beb1f5f1d1e3ad805586397402621635 /sway/handlers.c | |
parent | Merge pull request #49 from taiyu-len/master (diff) | |
download | sway-498cf268f712e0bc8d00cf9ef7e3886129904c67.tar.gz sway-498cf268f712e0bc8d00cf9ef7e3886129904c67.tar.zst sway-498cf268f712e0bc8d00cf9ef7e3886129904c67.zip |
unmanaged views handled better
Diffstat (limited to 'sway/handlers.c')
-rw-r--r-- | sway/handlers.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/sway/handlers.c b/sway/handlers.c index e57b791b..817f197e 100644 --- a/sway/handlers.c +++ b/sway/handlers.c | |||
@@ -87,17 +87,26 @@ static void handle_output_focused(wlc_handle output, bool focus) { | |||
87 | 87 | ||
88 | static bool handle_view_created(wlc_handle handle) { | 88 | static bool handle_view_created(wlc_handle handle) { |
89 | swayc_t *focused = get_focused_container(&root_container); | 89 | swayc_t *focused = get_focused_container(&root_container); |
90 | swayc_t *view = new_view(focused, handle); | 90 | uint32_t type = wlc_view_get_type(handle); |
91 | if (view) { | 91 | //If override_redirect/unmanaged/popup/modal/splach |
92 | if (type) { | ||
93 | sway_log(L_DEBUG,"Unmanaged window of type %x left alone", type); | ||
94 | wlc_view_set_state(handle, WLC_BIT_ACTIVATED, true); | ||
95 | if (type & WLC_BIT_UNMANAGED) { | ||
96 | return true; | ||
97 | } | ||
98 | //for things like Dmenu | ||
99 | if (type & WLC_BIT_OVERRIDE_REDIRECT) { | ||
100 | wlc_view_focus(handle); | ||
101 | } | ||
102 | } else { | ||
103 | swayc_t *view = new_view(focused, handle); | ||
92 | //Set maximize flag for windows. | 104 | //Set maximize flag for windows. |
93 | //TODO: floating windows have this unset | 105 | //TODO: floating windows have this unset |
94 | wlc_view_set_state(handle, WLC_BIT_MAXIMIZED, true); | 106 | wlc_view_set_state(handle, WLC_BIT_MAXIMIZED, true); |
95 | unfocus_all(&root_container); | 107 | unfocus_all(&root_container); |
96 | focus_view(view); | 108 | focus_view(view); |
97 | arrange_windows(view->parent, -1, -1); | 109 | arrange_windows(view->parent, -1, -1); |
98 | } else { //Unmanaged view | ||
99 | wlc_view_set_state(handle, WLC_BIT_ACTIVATED, true); | ||
100 | wlc_view_focus(handle); | ||
101 | } | 110 | } |
102 | if (wlc_view_get_state(focused->handle) & WLC_BIT_FULLSCREEN) { | 111 | if (wlc_view_get_state(focused->handle) & WLC_BIT_FULLSCREEN) { |
103 | unfocus_all(&root_container); | 112 | unfocus_all(&root_container); |