From 47d56306c3c0578daf705e1421b79791be85428e Mon Sep 17 00:00:00 2001 From: emersion Date: Mon, 2 Jul 2018 20:24:17 +0100 Subject: [PATCH 1/2] Fix xwayland floating views unclickable Some xwayland views are first configured with a 1x1 size, and then resized. Since the view size isn't updated, they are unclickable. Fixes #2195 --- sway/desktop/xwayland.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c index 0669a485..ace290ef 100644 --- a/sway/desktop/xwayland.c +++ b/sway/desktop/xwayland.c @@ -284,6 +284,11 @@ static void handle_commit(struct wl_listener *listener, void *data) { transaction_notify_view_ready_by_size(view, surface_state->width, surface_state->height); } + + if (container_is_floating(view->swayc)) { + view_update_size(view, surface_state->width, surface_state->height); + } + view_damage_from(view); } From 9a9d9116be4109f733a3309d7f9a7c9edd8db4ae Mon Sep 17 00:00:00 2001 From: emersion Date: Fri, 6 Jul 2018 19:33:10 +0100 Subject: [PATCH 2/2] Make view_update_* update live props as well --- sway/desktop/xwayland.c | 4 +--- sway/tree/view.c | 4 ++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c index ace290ef..b2874cfe 100644 --- a/sway/desktop/xwayland.c +++ b/sway/desktop/xwayland.c @@ -283,9 +283,7 @@ static void handle_commit(struct wl_listener *listener, void *data) { if (view->swayc->instructions->length) { transaction_notify_view_ready_by_size(view, surface_state->width, surface_state->height); - } - - if (container_is_floating(view->swayc)) { + } else if (container_is_floating(view->swayc)) { view_update_size(view, surface_state->width, surface_state->height); } diff --git a/sway/tree/view.c b/sway/tree/view.c index bca8ef8a..e46cb327 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c @@ -574,6 +574,8 @@ void view_update_position(struct sway_view *view, double lx, double ly) { container_damage_whole(view->swayc); view->x = lx; view->y = ly; + view->swayc->current.view_x = lx; + view->swayc->current.view_y = ly; if (container_is_floating(view->swayc)) { container_set_geometry_from_floating_view(view->swayc); } @@ -587,6 +589,8 @@ void view_update_size(struct sway_view *view, int width, int height) { container_damage_whole(view->swayc); view->width = width; view->height = height; + view->swayc->current.view_width = width; + view->swayc->current.view_height = height; if (container_is_floating(view->swayc)) { container_set_geometry_from_floating_view(view->swayc); }