summaryrefslogtreecommitdiffstats
path: root/sway/handlers.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/handlers.c')
-rw-r--r--sway/handlers.c19
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
88static bool handle_view_created(wlc_handle handle) { 88static 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);