mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2025-10-29 05:40:21 -04:00
opt: exclude some windows that cannot be maximized
This commit is contained in:
parent
3bf524929b
commit
e18839ec11
1 changed files with 17 additions and 2 deletions
|
|
@ -343,6 +343,9 @@ static inline uint32_t client_set_size(Client *c, uint32_t width,
|
|||
}
|
||||
|
||||
static inline void client_set_tiled(Client *c, uint32_t edges) {
|
||||
struct wlr_xdg_toplevel *toplevel;
|
||||
struct wlr_xdg_toplevel_state state;
|
||||
bool need_maximize = false;
|
||||
#ifdef XWAYLAND
|
||||
if (client_is_x11(c)) {
|
||||
wlr_xwayland_surface_set_maximized(c->surface.xwayland,
|
||||
|
|
@ -351,13 +354,25 @@ static inline void client_set_tiled(Client *c, uint32_t edges) {
|
|||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
toplevel = c->surface.xdg->toplevel;
|
||||
state = toplevel->current;
|
||||
|
||||
if (wl_resource_get_version(c->surface.xdg->toplevel->resource) >=
|
||||
XDG_TOPLEVEL_STATE_TILED_RIGHT_SINCE_VERSION) {
|
||||
wlr_xdg_toplevel_set_tiled(c->surface.xdg->toplevel, edges);
|
||||
} else {
|
||||
need_maximize = true;
|
||||
}
|
||||
|
||||
wlr_xdg_toplevel_set_maximized(c->surface.xdg->toplevel,
|
||||
edges != WLR_EDGE_NONE);
|
||||
// exclude some windows that cannot be maximized,
|
||||
// such as the login window of linuxqq
|
||||
if (state.min_width == 0 || state.min_height == 0)
|
||||
need_maximize = false;
|
||||
|
||||
if (need_maximize) {
|
||||
wlr_xdg_toplevel_set_maximized(toplevel, edges != WLR_EDGE_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void client_set_suspended(Client *c, int suspended) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue