mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 04:45:58 +01:00
xdg-toplevel: don't send maximized if tiled is requested but not supported
This is a bit too magical and may break compositors which try not to send duplicate configure events.
This commit is contained in:
parent
af165acb42
commit
5fac9b1beb
1 changed files with 15 additions and 21 deletions
|
@ -78,31 +78,25 @@ struct wlr_xdg_toplevel_configure *send_xdg_toplevel_configure(
|
||||||
if (configure->activated) {
|
if (configure->activated) {
|
||||||
states[nstates++] = XDG_TOPLEVEL_STATE_ACTIVATED;
|
states[nstates++] = XDG_TOPLEVEL_STATE_ACTIVATED;
|
||||||
}
|
}
|
||||||
if (configure->tiled) {
|
if (configure->tiled && version >= XDG_TOPLEVEL_STATE_TILED_LEFT_SINCE_VERSION) {
|
||||||
if (version >= XDG_TOPLEVEL_STATE_TILED_LEFT_SINCE_VERSION) {
|
const struct {
|
||||||
const struct {
|
enum wlr_edges edge;
|
||||||
enum wlr_edges edge;
|
enum xdg_toplevel_state state;
|
||||||
enum xdg_toplevel_state state;
|
} tiled[] = {
|
||||||
} tiled[] = {
|
{ WLR_EDGE_LEFT, XDG_TOPLEVEL_STATE_TILED_LEFT },
|
||||||
{ WLR_EDGE_LEFT, XDG_TOPLEVEL_STATE_TILED_LEFT },
|
{ WLR_EDGE_RIGHT, XDG_TOPLEVEL_STATE_TILED_RIGHT },
|
||||||
{ WLR_EDGE_RIGHT, XDG_TOPLEVEL_STATE_TILED_RIGHT },
|
{ WLR_EDGE_TOP, XDG_TOPLEVEL_STATE_TILED_TOP },
|
||||||
{ WLR_EDGE_TOP, XDG_TOPLEVEL_STATE_TILED_TOP },
|
{ WLR_EDGE_BOTTOM, XDG_TOPLEVEL_STATE_TILED_BOTTOM },
|
||||||
{ WLR_EDGE_BOTTOM, XDG_TOPLEVEL_STATE_TILED_BOTTOM },
|
};
|
||||||
};
|
|
||||||
|
|
||||||
for (size_t i = 0; i < sizeof(tiled)/sizeof(tiled[0]); ++i) {
|
for (size_t i = 0; i < sizeof(tiled)/sizeof(tiled[0]); ++i) {
|
||||||
if ((configure->tiled & tiled[i].edge) == 0) {
|
if ((configure->tiled & tiled[i].edge) == 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
states[nstates++] = tiled[i].state;
|
|
||||||
}
|
}
|
||||||
} else if (!configure->maximized) {
|
states[nstates++] = tiled[i].state;
|
||||||
states[nstates++] = XDG_TOPLEVEL_STATE_MAXIMIZED;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (configure->suspended && version >= XDG_TOPLEVEL_STATE_SUSPENDED_SINCE_VERSION) {
|
||||||
if (configure->suspended &&
|
|
||||||
version >= XDG_TOPLEVEL_STATE_SUSPENDED_SINCE_VERSION) {
|
|
||||||
states[nstates++] = XDG_TOPLEVEL_STATE_SUSPENDED;
|
states[nstates++] = XDG_TOPLEVEL_STATE_SUSPENDED;
|
||||||
}
|
}
|
||||||
assert(nstates <= sizeof(states) / sizeof(states[0]));
|
assert(nstates <= sizeof(states) / sizeof(states[0]));
|
||||||
|
|
Loading…
Reference in a new issue