From e3dc46705df6c82944d9c3765903a8e786664a5c Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Tue, 8 Jul 2025 13:01:43 +0800 Subject: [PATCH] opt: UTILITY type x11 window set to isunglobal window --- src/maomao.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/maomao.c b/src/maomao.c index 6b56ee1..2899ba9 100644 --- a/src/maomao.c +++ b/src/maomao.c @@ -3850,8 +3850,6 @@ static void iter_xdg_scene_buffers(struct wlr_scene_buffer *buffer, int sx, } void init_client_properties(Client *c) { - c->geom.width += 2 * c->bw; - c->geom.height += 2 * c->bw; c->ismaxmizescreen = 0; c->isfullscreen = 0; c->need_float_size_reduce = 0; @@ -3897,6 +3895,9 @@ mapnotify(struct wl_listener *listener, void *data) { client_get_geometry(c, &c->geom); + init_client_properties(c); + + // set special window properties if (client_is_unmanaged(c) || client_should_ignore_focus(c)) { c->bw = 0; c->isnoborder = 1; @@ -3904,6 +3905,14 @@ mapnotify(struct wl_listener *listener, void *data) { c->bw = borderpx; } + if (client_should_overtop(c) && !client_get_parent(c)) { + c->isunglobal = 1; + } + + // init client geom + c->geom.width += 2 * c->bw; + c->geom.height += 2 * c->bw; + /* Handle unmanaged clients first so we can return prior create borders */ if (client_is_unmanaged(c)) { /* Unmanaged clients always are floating */ @@ -3943,8 +3952,6 @@ mapnotify(struct wl_listener *listener, void *data) { client_set_tiled(c, WLR_EDGE_TOP | WLR_EDGE_BOTTOM | WLR_EDGE_LEFT | WLR_EDGE_RIGHT); - init_client_properties(c); - if (new_is_master && selmon && !is_scroller_layout(selmon)) // tile at the top wl_list_insert(&clients, &c->link); // 新窗口是master,头部入栈