diff options
-rw-r--r-- | sway/desktop/transaction.c | 10 | ||||
-rw-r--r-- | sway/input/seat.c | 11 | ||||
-rw-r--r-- | sway/tree/container.c | 7 |
3 files changed, 23 insertions, 5 deletions
diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c index ccda1963..7975366e 100644 --- a/sway/desktop/transaction.c +++ b/sway/desktop/transaction.c | |||
@@ -1,4 +1,5 @@ | |||
1 | #define _POSIX_C_SOURCE 200809L | 1 | #define _POSIX_C_SOURCE 200809L |
2 | #include <errno.h> | ||
2 | #include <stdbool.h> | 3 | #include <stdbool.h> |
3 | #include <stdlib.h> | 4 | #include <stdlib.h> |
4 | #include <string.h> | 5 | #include <string.h> |
@@ -316,7 +317,14 @@ static void transaction_commit(struct sway_transaction *transaction) { | |||
316 | // Set up a timer which the views must respond within | 317 | // Set up a timer which the views must respond within |
317 | transaction->timer = wl_event_loop_add_timer(server.wl_event_loop, | 318 | transaction->timer = wl_event_loop_add_timer(server.wl_event_loop, |
318 | handle_timeout, transaction); | 319 | handle_timeout, transaction); |
319 | wl_event_source_timer_update(transaction->timer, txn_timeout_ms); | 320 | if (transaction->timer) { |
321 | wl_event_source_timer_update(transaction->timer, txn_timeout_ms); | ||
322 | } else { | ||
323 | wlr_log(WLR_ERROR, "Unable to create transaction timer (%s). " | ||
324 | "Some imperfect frames might be rendered.", | ||
325 | strerror(errno)); | ||
326 | handle_timeout(transaction); | ||
327 | } | ||
320 | } | 328 | } |
321 | 329 | ||
322 | // The debug tree shows the pending/live tree. Here is a good place to | 330 | // The debug tree shows the pending/live tree. Here is a good place to |
diff --git a/sway/input/seat.c b/sway/input/seat.c index 18d5591d..53a92989 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -1,6 +1,7 @@ | |||
1 | #define _XOPEN_SOURCE 700 | 1 | #define _XOPEN_SOURCE 700 |
2 | #define _POSIX_C_SOURCE 199309L | 2 | #define _POSIX_C_SOURCE 199309L |
3 | #include <assert.h> | 3 | #include <assert.h> |
4 | #include <errno.h> | ||
4 | #ifdef __linux__ | 5 | #ifdef __linux__ |
5 | #include <linux/input-event-codes.h> | 6 | #include <linux/input-event-codes.h> |
6 | #elif __FreeBSD__ | 7 | #elif __FreeBSD__ |
@@ -701,8 +702,14 @@ void seat_set_focus_warp(struct sway_seat *seat, | |||
701 | config->urgent_timeout > 0) { | 702 | config->urgent_timeout > 0) { |
702 | view->urgent_timer = wl_event_loop_add_timer(server.wl_event_loop, | 703 | view->urgent_timer = wl_event_loop_add_timer(server.wl_event_loop, |
703 | handle_urgent_timeout, view); | 704 | handle_urgent_timeout, view); |
704 | wl_event_source_timer_update(view->urgent_timer, | 705 | if (view->urgent_timer) { |
705 | config->urgent_timeout); | 706 | wl_event_source_timer_update(view->urgent_timer, |
707 | config->urgent_timeout); | ||
708 | } else { | ||
709 | wlr_log(WLR_ERROR, "Unable to create urgency timer (%s)", | ||
710 | strerror(errno)); | ||
711 | handle_urgent_timeout(view); | ||
712 | } | ||
706 | } else { | 713 | } else { |
707 | view_set_urgent(view, false); | 714 | view_set_urgent(view, false); |
708 | } | 715 | } |
diff --git a/sway/tree/container.c b/sway/tree/container.c index 2332d81f..b7442002 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c | |||
@@ -142,8 +142,6 @@ struct sway_container *container_create(enum sway_container_type type) { | |||
142 | static void container_workspace_free(struct sway_workspace *ws) { | 142 | static void container_workspace_free(struct sway_workspace *ws) { |
143 | list_foreach(ws->output_priority, free); | 143 | list_foreach(ws->output_priority, free); |
144 | list_free(ws->output_priority); | 144 | list_free(ws->output_priority); |
145 | ws->floating->destroying = true; | ||
146 | container_free(ws->floating); | ||
147 | free(ws); | 145 | free(ws); |
148 | } | 146 | } |
149 | 147 | ||
@@ -196,6 +194,9 @@ void container_free(struct sway_container *cont) { | |||
196 | free(cont); | 194 | free(cont); |
197 | } | 195 | } |
198 | 196 | ||
197 | static struct sway_container *container_destroy_noreaping( | ||
198 | struct sway_container *con); | ||
199 | |||
199 | static struct sway_container *container_workspace_destroy( | 200 | static struct sway_container *container_workspace_destroy( |
200 | struct sway_container *workspace) { | 201 | struct sway_container *workspace) { |
201 | if (!sway_assert(workspace, "cannot destroy null workspace")) { | 202 | if (!sway_assert(workspace, "cannot destroy null workspace")) { |
@@ -240,6 +241,8 @@ static struct sway_container *container_workspace_destroy( | |||
240 | } | 241 | } |
241 | } | 242 | } |
242 | 243 | ||
244 | container_destroy_noreaping(workspace->sway_workspace->floating); | ||
245 | |||
243 | return output; | 246 | return output; |
244 | } | 247 | } |
245 | 248 | ||