mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2025-10-29 05:40:21 -04:00
opt: resize client when client commit a different size
This commit is contained in:
parent
00b5d45fbf
commit
03c4d645e5
1 changed files with 9 additions and 1 deletions
10
src/mango.c
10
src/mango.c
|
|
@ -2198,6 +2198,7 @@ void commitlayersurfacenotify(struct wl_listener *listener, void *data) {
|
|||
|
||||
void commitnotify(struct wl_listener *listener, void *data) {
|
||||
Client *c = wl_container_of(listener, c, commit);
|
||||
struct wlr_box *new_geo;
|
||||
|
||||
if (c->surface.xdg->initial_commit) {
|
||||
// xdg client will first enter this before mapnotify
|
||||
|
|
@ -2241,12 +2242,19 @@ void commitnotify(struct wl_listener *listener, void *data) {
|
|||
c->configure_serial <= c->surface.xdg->current.configure_serial)
|
||||
c->configure_serial = 0;
|
||||
|
||||
if (!c->dirty) {
|
||||
new_geo = &c->surface.xdg->geometry;
|
||||
c->dirty = new_geo->width != c->geom.width - 2 * c->bw ||
|
||||
new_geo->height != c->geom.height - 2 * c->bw ||
|
||||
new_geo->x != 0 || new_geo->y != 0;
|
||||
}
|
||||
|
||||
if (c == grabc || !c->dirty)
|
||||
return;
|
||||
|
||||
resize(c, c->geom, 0);
|
||||
|
||||
struct wlr_box *new_geo = &c->surface.xdg->geometry;
|
||||
new_geo = &c->surface.xdg->geometry;
|
||||
c->dirty = new_geo->width != c->geom.width - 2 * c->bw ||
|
||||
new_geo->height != c->geom.height - 2 * c->bw ||
|
||||
new_geo->x != 0 || new_geo->y != 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue