diff options
author | 2015-08-23 14:34:20 -0400 | |
---|---|---|
committer | 2015-08-23 14:34:20 -0400 | |
commit | 663f53b22a0d97a300345090a92b8567b6a0af82 (patch) | |
tree | 45f2c39c1f883e1b80877c29848003c8ee2c1efc /sway/handlers.c | |
parent | Prefix log events from wlc with [wlc] (diff) | |
parent | Minor fix (diff) | |
download | sway-663f53b22a0d97a300345090a92b8567b6a0af82.tar.gz sway-663f53b22a0d97a300345090a92b8567b6a0af82.tar.zst sway-663f53b22a0d97a300345090a92b8567b6a0af82.zip |
Merge pull request #123 from Luminarys/master
Added in output disabling
Diffstat (limited to 'sway/handlers.c')
-rw-r--r-- | sway/handlers.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sway/handlers.c b/sway/handlers.c index e4018811..23db5c15 100644 --- a/sway/handlers.c +++ b/sway/handlers.c | |||
@@ -86,6 +86,10 @@ 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 | |||
89 | // Switch to workspace if we need to | 93 | // Switch to workspace if we need to |
90 | if (swayc_active_workspace() == NULL) { | 94 | if (swayc_active_workspace() == NULL) { |
91 | swayc_t *ws = op->children->items[0]; | 95 | swayc_t *ws = op->children->items[0]; |
@@ -104,6 +108,8 @@ static void handle_output_destroyed(wlc_handle output) { | |||
104 | } | 108 | } |
105 | if (i < list->length) { | 109 | if (i < list->length) { |
106 | destroy_output(list->items[i]); | 110 | destroy_output(list->items[i]); |
111 | } else { | ||
112 | return; | ||
107 | } | 113 | } |
108 | if (list->length > 0) { | 114 | if (list->length > 0) { |
109 | // switch to other outputs active workspace | 115 | // switch to other outputs active workspace |