aboutsummaryrefslogtreecommitdiff
path: root/sway/handlers.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2015-08-16 21:29:52 -0400
committerDrew DeVault <sir@cmpwn.com>2015-08-16 21:29:52 -0400
commit0de5b535d0d818c1e47bed7111ab88a1c154886a (patch)
tree33d6e363beb1f5f1d1e3ad805586397402621635 /sway/handlers.c
parentcf6df324a8a12aef4573628d9c5de84119933d5a (diff)
parent498cf268f712e0bc8d00cf9ef7e3886129904c67 (diff)
Merge pull request #51 from taiyu-len/master
unmanaged views handled better
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) {
static bool handle_view_created(wlc_handle handle) {
swayc_t *focused = get_focused_container(&root_container);
- swayc_t *view = new_view(focused, handle);
- if (view) {
+ uint32_t type = wlc_view_get_type(handle);
+ //If override_redirect/unmanaged/popup/modal/splach
+ if (type) {
+ sway_log(L_DEBUG,"Unmanaged window of type %x left alone", type);
+ wlc_view_set_state(handle, WLC_BIT_ACTIVATED, true);
+ if (type & WLC_BIT_UNMANAGED) {
+ return true;
+ }
+ //for things like Dmenu
+ if (type & WLC_BIT_OVERRIDE_REDIRECT) {
+ wlc_view_focus(handle);
+ }
+ } else {
+ swayc_t *view = new_view(focused, handle);
//Set maximize flag for windows.
//TODO: floating windows have this unset
wlc_view_set_state(handle, WLC_BIT_MAXIMIZED, true);
unfocus_all(&root_container);
focus_view(view);
arrange_windows(view->parent, -1, -1);
- } else { //Unmanaged view
- wlc_view_set_state(handle, WLC_BIT_ACTIVATED, true);
- wlc_view_focus(handle);
}
if (wlc_view_get_state(focused->handle) & WLC_BIT_FULLSCREEN) {
unfocus_all(&root_container);