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