aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/xwayland.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/desktop/xwayland.c')
-rw-r--r--sway/desktop/xwayland.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index e1a2e463..be9503e5 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -406,22 +406,25 @@ static void handle_commit(struct wl_listener *listener, void *data) {
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);
409 bool new_size = new_geo.width != view->geometry.width ||
410 new_geo.height != view->geometry.height ||
411 new_geo.x != view->geometry.x ||
412 new_geo.y != view->geometry.y;
409 413
410 if ((new_geo.width != view->geometry.width || 414 if (new_size) {
411 new_geo.height != view->geometry.height ||
412 new_geo.x != view->geometry.x ||
413 new_geo.y != view->geometry.y)) {
414 // The view has unexpectedly sent a new size 415 // The view has unexpectedly sent a new size
415 // eg. The Firefox "Save As" dialog when downloading a file 416 // eg. The Firefox "Save As" dialog when downloading a file
416 desktop_damage_view(view); 417 desktop_damage_view(view);
417 view_update_size(view, new_geo.width, new_geo.height);
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 if (container_is_floating(view->container)) {
420 transaction_commit_dirty(); 420 view_update_size(view, new_geo.width, new_geo.height);
421 transaction_notify_view_ready_by_geometry(view, 421 transaction_commit_dirty();
422 transaction_notify_view_ready_by_geometry(view,
422 xsurface->x, xsurface->y, new_geo.width, new_geo.height); 423 xsurface->x, xsurface->y, new_geo.width, new_geo.height);
423 } else { 424 } else {
424 memcpy(&view->geometry, &new_geo, sizeof(struct wlr_box)); 425 view_center_surface(view);
426 }
427 desktop_damage_view(view);
425 } 428 }
426 } 429 }
427 430