mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-02-18 22:05:28 -05:00
opt: optimize code struct
This commit is contained in:
parent
1158fb2e3c
commit
112fb5c007
2 changed files with 17 additions and 14 deletions
|
|
@ -325,13 +325,15 @@ static inline uint32_t client_set_size(Client *c, uint32_t width,
|
|||
|
||||
struct wlr_surface_state *state =
|
||||
&c->surface.xwayland->surface->current;
|
||||
struct wlr_box new_geo = {0};
|
||||
new_geo.width = state->width;
|
||||
new_geo.height = state->height;
|
||||
if (c->geom.width - 2 * c->bw == new_geo.width &&
|
||||
c->geom.height - 2 * c->bw == new_geo.height &&
|
||||
c->surface.xwayland->x == c->geom.x + c->bw &&
|
||||
c->surface.xwayland->y == c->geom.y + c->bw) {
|
||||
|
||||
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 &&
|
||||
(int32_t)c->surface.xwayland->x ==
|
||||
(int32_t)c->geom.x + (int32_t)c->bw &&
|
||||
(int32_t)c->surface.xwayland->y ==
|
||||
(int32_t)c->geom.y + (int32_t)c->bw) {
|
||||
c->configure_serial = 0;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
15
src/mango.c
15
src/mango.c
|
|
@ -6285,13 +6285,14 @@ void createnotifyx11(struct wl_listener *listener, void *data) {
|
|||
void commitx11(struct wl_listener *listener, void *data) {
|
||||
Client *c = wl_container_of(listener, c, commmitx11);
|
||||
struct wlr_surface_state *state = &c->surface.xwayland->surface->current;
|
||||
struct wlr_box new_geo = {0};
|
||||
new_geo.width = state->width;
|
||||
new_geo.height = state->height;
|
||||
if (c->geom.width - 2 * c->bw == new_geo.width &&
|
||||
c->geom.height - 2 * c->bw == new_geo.height &&
|
||||
c->surface.xwayland->x == c->geom.x + c->bw &&
|
||||
c->surface.xwayland->y == c->geom.y + c->bw) {
|
||||
|
||||
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 &&
|
||||
(int32_t)c->surface.xwayland->x ==
|
||||
(int32_t)c->geom.x + (int32_t)c->bw &&
|
||||
(int32_t)c->surface.xwayland->y ==
|
||||
(int32_t)c->geom.y + (int32_t)c->bw) {
|
||||
c->configure_serial = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue