aboutsummaryrefslogtreecommitdiffstats
path: root/sway
diff options
context:
space:
mode:
authorLibravatar Kenny Levinsen <kl@kl.wtf>2020-06-28 19:05:04 +0200
committerLibravatar Simon Ser <contact@emersion.fr>2020-06-30 10:59:33 +0200
commitd0f7e0f481a2b2e03a700d55570a3f85655ef03c (patch)
tree881dfd93f9ec0e76393324346d9fa94712c8f942 /sway
parenttree/view: fix smart borders with tabbed/stacked ancestor (diff)
downloadsway-d0f7e0f481a2b2e03a700d55570a3f85655ef03c.tar.gz
sway-d0f7e0f481a2b2e03a700d55570a3f85655ef03c.tar.zst
sway-d0f7e0f481a2b2e03a700d55570a3f85655ef03c.zip
transaction: Mark client resize immediately ready
If a client commits a new size on its own, we create a transaction for the resize like any other. However, this involves sending a configure and waiting for the ack, and wlroots will not send configure events when there has been no change. This leads to transactions timing out. Instead, just mark the view ready immediately by size when the client is already ready, so that we avoid waiting for an ack that will never come. Closes: https://github.com/swaywm/sway/issues/5490
Diffstat (limited to 'sway')
-rw-r--r--sway/desktop/transaction.c5
-rw-r--r--sway/desktop/xdg_shell.c2
-rw-r--r--sway/desktop/xwayland.c2
3 files changed, 7 insertions, 2 deletions
diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c
index 7b9ab586..2b268e2c 100644
--- a/sway/desktop/transaction.c
+++ b/sway/desktop/transaction.c
@@ -501,7 +501,7 @@ void transaction_notify_view_ready_by_serial(struct sway_view *view,
501 uint32_t serial) { 501 uint32_t serial) {
502 struct sway_transaction_instruction *instruction = 502 struct sway_transaction_instruction *instruction =
503 view->container->node.instruction; 503 view->container->node.instruction;
504 if (instruction->serial == serial) { 504 if (instruction != NULL && instruction->serial == serial) {
505 set_instruction_ready(instruction); 505 set_instruction_ready(instruction);
506 } 506 }
507} 507}
@@ -510,7 +510,8 @@ void transaction_notify_view_ready_by_size(struct sway_view *view,
510 int width, int height) { 510 int width, int height) {
511 struct sway_transaction_instruction *instruction = 511 struct sway_transaction_instruction *instruction =
512 view->container->node.instruction; 512 view->container->node.instruction;
513 if (instruction->container_state.content_width == width && 513 if (instruction != NULL &&
514 instruction->container_state.content_width == width &&
514 instruction->container_state.content_height == height) { 515 instruction->container_state.content_height == height) {
515 set_instruction_ready(instruction); 516 set_instruction_ready(instruction);
516 } 517 }
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c
index 2bf026f7..df751ef6 100644
--- a/sway/desktop/xdg_shell.c
+++ b/sway/desktop/xdg_shell.c
@@ -293,6 +293,8 @@ static void handle_commit(struct wl_listener *listener, void *data) {
293 memcpy(&view->geometry, &new_geo, sizeof(struct wlr_box)); 293 memcpy(&view->geometry, &new_geo, sizeof(struct wlr_box));
294 desktop_damage_view(view); 294 desktop_damage_view(view);
295 transaction_commit_dirty(); 295 transaction_commit_dirty();
296 transaction_notify_view_ready_by_size(view,
297 new_geo.width, new_geo.height);
296 } else { 298 } else {
297 memcpy(&view->geometry, &new_geo, sizeof(struct wlr_box)); 299 memcpy(&view->geometry, &new_geo, sizeof(struct wlr_box));
298 } 300 }
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index 743e85bc..c972fd3a 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -383,6 +383,8 @@ static void handle_commit(struct wl_listener *listener, void *data) {
383 memcpy(&view->geometry, &new_geo, sizeof(struct wlr_box)); 383 memcpy(&view->geometry, &new_geo, sizeof(struct wlr_box));
384 desktop_damage_view(view); 384 desktop_damage_view(view);
385 transaction_commit_dirty(); 385 transaction_commit_dirty();
386 transaction_notify_view_ready_by_size(view,
387 new_geo.width, new_geo.height);
386 } else { 388 } else {
387 memcpy(&view->geometry, &new_geo, sizeof(struct wlr_box)); 389 memcpy(&view->geometry, &new_geo, sizeof(struct wlr_box));
388 } 390 }