diff options
Diffstat (limited to 'sway/handlers.c')
-rw-r--r-- | sway/handlers.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sway/handlers.c b/sway/handlers.c index e4018811..9fca6387 100644 --- a/sway/handlers.c +++ b/sway/handlers.c | |||
@@ -86,11 +86,22 @@ swayc_t *container_under_pointer(void) { | |||
86 | static bool handle_output_created(wlc_handle output) { | 86 | static bool handle_output_created(wlc_handle output) { |
87 | swayc_t *op = new_output(output); | 87 | swayc_t *op = new_output(output); |
88 | 88 | ||
89 | if (!op) { | ||
90 | return false; | ||
91 | } | ||
92 | |||
93 | wlc_output_focus(output); | ||
89 | // Switch to workspace if we need to | 94 | // Switch to workspace if we need to |
90 | if (swayc_active_workspace() == NULL) { | 95 | if (swayc_active_workspace() == NULL) { |
96 | sway_log(L_INFO, "Focus switch"); | ||
91 | swayc_t *ws = op->children->items[0]; | 97 | swayc_t *ws = op->children->items[0]; |
92 | workspace_switch(ws); | 98 | workspace_switch(ws); |
93 | } | 99 | } |
100 | /* | ||
101 | if (wlc_output_get_sleep(wlc_get_focused_output())) { | ||
102 | wlc_output_focus(output); | ||
103 | } | ||
104 | */ | ||
94 | return true; | 105 | return true; |
95 | } | 106 | } |
96 | 107 | ||