aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/xwayland.c
diff options
context:
space:
mode:
authorLibravatar Tudor Brindus <me@tbrindus.ca>2020-10-18 16:26:01 -0400
committerLibravatar Simon Ser <contact@emersion.fr>2020-10-18 22:37:42 +0200
commit8355884fbd4ea04203614172424b27c5b74018ab (patch)
treec7decf05e32202d1230924a7ddb5af6dd903016c /sway/desktop/xwayland.c
parenttransaction: don't reconfigure X views unless integral coords changed (diff)
downloadsway-8355884fbd4ea04203614172424b27c5b74018ab.tar.gz
sway-8355884fbd4ea04203614172424b27c5b74018ab.tar.zst
sway-8355884fbd4ea04203614172424b27c5b74018ab.zip
transaction: validate X transaction completions by geometry, not size
Xwayland views are aware of their coordinates, so validating transaction completions should take into account the reported coordinates of the view. Prior to this commit they didn't, and matching dimensions would suffice to validate the transaction. Also introduced `transaction_notify_view_ready_immediately` to support the fix from d0f7e0f without jumping through hoops to figure out the geometry of an `xdg_shell` view.
Diffstat (limited to 'sway/desktop/xwayland.c')
-rw-r--r--sway/desktop/xwayland.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index cee0ab10..186502b2 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -401,8 +401,8 @@ static void handle_commit(struct wl_listener *listener, void *data) {
401 401
402 if (view->container->node.instruction) { 402 if (view->container->node.instruction) {
403 get_geometry(view, &view->geometry); 403 get_geometry(view, &view->geometry);
404 transaction_notify_view_ready_by_size(view, 404 transaction_notify_view_ready_by_geometry(view,
405 state->width, state->height); 405 xsurface->x, xsurface->y, state->width, state->height);
406 } else { 406 } else {
407 struct wlr_box new_geo; 407 struct wlr_box new_geo;
408 get_geometry(view, &new_geo); 408 get_geometry(view, &new_geo);
@@ -418,8 +418,8 @@ static void handle_commit(struct wl_listener *listener, void *data) {
418 memcpy(&view->geometry, &new_geo, sizeof(struct wlr_box)); 418 memcpy(&view->geometry, &new_geo, sizeof(struct wlr_box));
419 desktop_damage_view(view); 419 desktop_damage_view(view);
420 transaction_commit_dirty(); 420 transaction_commit_dirty();
421 transaction_notify_view_ready_by_size(view, 421 transaction_notify_view_ready_by_geometry(view,
422 new_geo.width, new_geo.height); 422 xsurface->x, xsurface->y, new_geo.width, new_geo.height);
423 } else { 423 } else {
424 memcpy(&view->geometry, &new_geo, sizeof(struct wlr_box)); 424 memcpy(&view->geometry, &new_geo, sizeof(struct wlr_box));
425 } 425 }