aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/xwayland.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-08-17 10:23:29 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-08-18 10:39:38 +1000
commit8af4e2e3e67e4e28e9ffad162984c0cc1414d771 (patch)
treee00c1f301e0f4bfc7c2dbbcb1df12525bf476d07 /sway/desktop/xwayland.c
parentAdd get_geometry for xdg_shell_v6 (diff)
downloadsway-8af4e2e3e67e4e28e9ffad162984c0cc1414d771.tar.gz
sway-8af4e2e3e67e4e28e9ffad162984c0cc1414d771.tar.zst
sway-8af4e2e3e67e4e28e9ffad162984c0cc1414d771.zip
Handle xwayland views sending new sizes in their commits
Diffstat (limited to 'sway/desktop/xwayland.c')
-rw-r--r--sway/desktop/xwayland.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index dca62fb1..b5df907d 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -282,11 +282,19 @@ static void handle_commit(struct wl_listener *listener, void *data) {
282 wl_container_of(listener, xwayland_view, commit); 282 wl_container_of(listener, xwayland_view, commit);
283 struct sway_view *view = &xwayland_view->view; 283 struct sway_view *view = &xwayland_view->view;
284 struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface; 284 struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface;
285 struct wlr_surface_state *surface_state = &xsurface->surface->current; 285 struct wlr_surface_state *state = &xsurface->surface->current;
286 286
287 if (view->swayc->instruction) { 287 if (view->swayc->instruction) {
288 transaction_notify_view_ready_by_size(view, 288 transaction_notify_view_ready_by_size(view,
289 surface_state->width, surface_state->height); 289 state->width, state->height);
290 } else if ((state->width != view->width || state->height != view->height) &&
291 container_is_floating(view->swayc)) {
292 // eg. The Firefox "Save As" dialog when downloading a file
293 // It maps at a small size then changes afterwards.
294 view->width = state->width;
295 view->height = state->height;
296 container_set_geometry_from_floating_view(view->swayc);
297 transaction_commit_dirty();
290 } 298 }
291 299
292 view_damage_from(view); 300 view_damage_from(view);