diff options
Diffstat (limited to 'sway/handlers.c')
-rw-r--r-- | sway/handlers.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/sway/handlers.c b/sway/handlers.c index 9944be33..6f4cb477 100644 --- a/sway/handlers.c +++ b/sway/handlers.c | |||
@@ -88,22 +88,22 @@ static void handle_output_focused(wlc_handle output, bool focus) { | |||
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 | swayc_t *view = new_view(focused, handle); |
91 | //Leave unamanaged windows alone | ||
91 | if (view) { | 92 | if (view) { |
92 | //Set maximize flag for windows. | ||
93 | //TODO: floating windows have this unset | ||
94 | wlc_view_set_state(handle, WLC_BIT_MAXIMIZED, true); | ||
95 | unfocus_all(&root_container); | ||
96 | focus_view(view); | ||
97 | arrange_windows(view->parent, -1, -1); | 93 | arrange_windows(view->parent, -1, -1); |
98 | } else { //Unmanaged view | 94 | wlc_view_set_state(handle, WLC_BIT_MAXIMIZED, true); |
95 | if (!(wlc_view_get_state(focused->handle) & WLC_BIT_FULLSCREEN)) { | ||
96 | unfocus_all(&root_container); | ||
97 | focus_view(view); | ||
98 | } | ||
99 | else { | ||
100 | wlc_view_set_state(handle, WLC_BIT_ACTIVATED, true); | ||
101 | wlc_view_focus(handle); | ||
102 | } | ||
103 | } else { | ||
99 | wlc_view_set_state(handle, WLC_BIT_ACTIVATED, true); | 104 | wlc_view_set_state(handle, WLC_BIT_ACTIVATED, true); |
100 | wlc_view_focus(handle); | 105 | wlc_view_focus(handle); |
101 | } | 106 | } |
102 | if (wlc_view_get_state(focused->handle) & WLC_BIT_FULLSCREEN) { | ||
103 | unfocus_all(&root_container); | ||
104 | focus_view(focused); | ||
105 | arrange_windows(focused, -1, -1); | ||
106 | } | ||
107 | return true; | 107 | return true; |
108 | } | 108 | } |
109 | 109 | ||