mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-04-06 07:15:53 -04: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 =
|
struct wlr_surface_state *state =
|
||||||
&c->surface.xwayland->surface->current;
|
&c->surface.xwayland->surface->current;
|
||||||
struct wlr_box new_geo = {0};
|
|
||||||
new_geo.width = state->width;
|
if ((int32_t)c->geom.width - 2 * (int32_t)c->bw ==
|
||||||
new_geo.height = state->height;
|
(int32_t)state->width &&
|
||||||
if (c->geom.width - 2 * c->bw == new_geo.width &&
|
(int32_t)c->geom.height - 2 * (int32_t)c->bw ==
|
||||||
c->geom.height - 2 * c->bw == new_geo.height &&
|
(int32_t)state->height &&
|
||||||
c->surface.xwayland->x == c->geom.x + c->bw &&
|
(int32_t)c->surface.xwayland->x ==
|
||||||
c->surface.xwayland->y == c->geom.y + c->bw) {
|
(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;
|
c->configure_serial = 0;
|
||||||
return 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) {
|
void commitx11(struct wl_listener *listener, void *data) {
|
||||||
Client *c = wl_container_of(listener, c, commmitx11);
|
Client *c = wl_container_of(listener, c, commmitx11);
|
||||||
struct wlr_surface_state *state = &c->surface.xwayland->surface->current;
|
struct wlr_surface_state *state = &c->surface.xwayland->surface->current;
|
||||||
struct wlr_box new_geo = {0};
|
|
||||||
new_geo.width = state->width;
|
if ((int32_t)c->geom.width - 2 * (int32_t)c->bw == (int32_t)state->width &&
|
||||||
new_geo.height = state->height;
|
(int32_t)c->geom.height - 2 * (int32_t)c->bw ==
|
||||||
if (c->geom.width - 2 * c->bw == new_geo.width &&
|
(int32_t)state->height &&
|
||||||
c->geom.height - 2 * c->bw == new_geo.height &&
|
(int32_t)c->surface.xwayland->x ==
|
||||||
c->surface.xwayland->x == c->geom.x + c->bw &&
|
(int32_t)c->geom.x + (int32_t)c->bw &&
|
||||||
c->surface.xwayland->y == c->geom.y + c->bw) {
|
(int32_t)c->surface.xwayland->y ==
|
||||||
|
(int32_t)c->geom.y + (int32_t)c->bw) {
|
||||||
c->configure_serial = 0;
|
c->configure_serial = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue