Skip to content

Commit

Permalink
shells: Resize on commit if geometry x/y changes
Browse files Browse the repository at this point in the history
Client-side decorations lead to changes to y position, so make sure we
catch that.
  • Loading branch information
kennylevinsen authored and emersion committed Jun 3, 2020
1 parent 5a4a7bc commit f8dd7df
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion sway/desktop/xdg_shell.c
Expand Up @@ -284,7 +284,9 @@ static void handle_commit(struct wl_listener *listener, void *data) {
wlr_xdg_surface_get_geometry(xdg_surface, &new_geo);

if ((new_geo.width != view->geometry.width ||
new_geo.height != view->geometry.height)) {
new_geo.height != view->geometry.height ||
new_geo.x != view->geometry.x ||
new_geo.y != view->geometry.y)) {
// The view has unexpectedly sent a new size
desktop_damage_view(view);
view_update_size(view, new_geo.width, new_geo.height);
Expand Down
4 changes: 3 additions & 1 deletion sway/desktop/xwayland.c
Expand Up @@ -373,7 +373,9 @@ static void handle_commit(struct wl_listener *listener, void *data) {
get_geometry(view, &new_geo);

if ((new_geo.width != view->geometry.width ||
new_geo.height != view->geometry.height)) {
new_geo.height != view->geometry.height ||
new_geo.x != view->geometry.x ||
new_geo.y != view->geometry.y)) {
// The view has unexpectedly sent a new size
// eg. The Firefox "Save As" dialog when downloading a file
desktop_damage_view(view);
Expand Down

0 comments on commit f8dd7df

Please sign in to comment.