mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-03-27 07:58:53 -04:00
opt: dont force request resize when the x11 app reject resize
This commit is contained in:
parent
63256ea31b
commit
b55de28749
1 changed files with 26 additions and 3 deletions
|
|
@ -294,9 +294,8 @@ static inline uint32_t client_set_size(Client *c, uint32_t width,
|
|||
uint32_t height) {
|
||||
#ifdef XWAYLAND
|
||||
if (client_is_x11(c)) {
|
||||
|
||||
struct wlr_surface_state *state =
|
||||
&c->surface.xwayland->surface->current;
|
||||
struct wlr_xwayland_surface *surface = c->surface.xwayland;
|
||||
struct wlr_surface_state *state = &surface->surface->current;
|
||||
|
||||
if ((int32_t)c->geom.width - 2 * (int32_t)c->bw ==
|
||||
(int32_t)state->width &&
|
||||
|
|
@ -309,6 +308,30 @@ static inline uint32_t client_set_size(Client *c, uint32_t width,
|
|||
return 0;
|
||||
}
|
||||
|
||||
if ((int32_t)c->geom.width - 2 * (int32_t)c->bw ==
|
||||
(int32_t)state->width &&
|
||||
(int32_t)c->geom.height - 2 * (int32_t)c->bw ==
|
||||
(int32_t)state->height &&
|
||||
c->mon && !INSIDEMON(c)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
xcb_size_hints_t *size_hints = surface->size_hints;
|
||||
int32_t width = c->geom.width - 2 * c->bw;
|
||||
int32_t height = c->geom.height - 2 * c->bw;
|
||||
|
||||
if (c->mon && c->mon->isoverview && size_hints &&
|
||||
c->geom.width - 2 * (int32_t)c->bw < size_hints->min_width &&
|
||||
c->geom.height - 2 * (int32_t)c->bw < size_hints->min_height)
|
||||
return 0;
|
||||
|
||||
if (size_hints &&
|
||||
c->geom.width - 2 * (int32_t)c->bw < size_hints->min_width)
|
||||
width = size_hints->min_width;
|
||||
if (size_hints &&
|
||||
c->geom.height - 2 * (int32_t)c->bw < size_hints->min_height)
|
||||
height = size_hints->min_height;
|
||||
|
||||
wlr_xwayland_surface_configure(c->surface.xwayland, c->geom.x + c->bw,
|
||||
c->geom.y + c->bw, width, height);
|
||||
return 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue