Do not send repeated xdg_toplevel.configure_bounds

Fixes: 32e66f4582
This commit is contained in:
Leonardo Hernández Hernández 2023-11-21 20:08:20 -06:00
parent 32e66f4582
commit a0e79d8145
No known key found for this signature in database
GPG Key ID: E538897EE11B9624
2 changed files with 6 additions and 1 deletions

View File

@ -112,8 +112,12 @@ client_set_bounds(Client *c, int32_t width, int32_t height)
return 0; return 0;
#endif #endif
if (wl_resource_get_version(c->surface.xdg->toplevel->resource) >= if (wl_resource_get_version(c->surface.xdg->toplevel->resource) >=
XDG_TOPLEVEL_CONFIGURE_BOUNDS_SINCE_VERSION && width >= 0 && height >= 0) XDG_TOPLEVEL_CONFIGURE_BOUNDS_SINCE_VERSION && width >= 0 && height >= 0
&& (c->bounds.width != width || c->bounds.height != height)) {
c->bounds.width = width;
c->bounds.height = height;
return wlr_xdg_toplevel_set_bounds(c->surface.xdg->toplevel, width, height); return wlr_xdg_toplevel_set_bounds(c->surface.xdg->toplevel, width, height);
}
return 0; return 0;
} }

1
dwl.c
View File

@ -118,6 +118,7 @@ typedef struct {
struct wl_listener set_title; struct wl_listener set_title;
struct wl_listener fullscreen; struct wl_listener fullscreen;
struct wlr_box prev; /* layout-relative, includes border */ struct wlr_box prev; /* layout-relative, includes border */
struct wlr_box bounds;
#ifdef XWAYLAND #ifdef XWAYLAND
struct wl_listener activate; struct wl_listener activate;
struct wl_listener associate; struct wl_listener associate;