From ccb58a4f1ab95fb22a3b93395c306df854a4d475 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Sun, 7 Jun 2026 18:08:55 +0800 Subject: [PATCH 01/12] docs: fix some error im sample --- docs/window-management/rules.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/window-management/rules.md b/docs/window-management/rules.md index 41b4cc53..7e221bf1 100644 --- a/docs/window-management/rules.md +++ b/docs/window-management/rules.md @@ -115,7 +115,7 @@ windowrule=width:1000,height:900,appid:yesplaymusic,title:Demons # Global keybindings for OBS Studio windowrule=globalkeybinding:ctrl+alt-o,appid:com.obsproject.Studio -windowrule=globalkeybinding:ctrl+alt+n,appid:com.obsproject.Studio +windowrule=globalkeybinding:ctrl+alt-n,appid:com.obsproject.Studio windowrule=isopensilent:1,appid:com.obsproject.Studio # Force tearing for games From 27f4f64173b143baf85d8c000239d96f5e91881f Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Mon, 8 Jun 2026 11:40:21 +0800 Subject: [PATCH 02/12] opt: not need send output enter when layer map scene scene-graph API will auto do this --- src/mango.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/mango.c b/src/mango.c index 74d4c196..8c96dba2 100644 --- a/src/mango.c +++ b/src/mango.c @@ -3140,7 +3140,6 @@ void createlayersurface(struct wl_listener *listener, void *data) { LISTEN(&l->scene->node.events.destroy, &l->destroy, destroylayernodenotify); wl_list_insert(&l->mon->layers[layer_surface->pending.layer], &l->link); - wlr_surface_send_enter(surface, layer_surface->output); } void createlocksurface(struct wl_listener *listener, void *data) { From 009e2d21119e36e4f1921d4b2878ddc50f674ab9 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Mon, 8 Jun 2026 13:05:04 +0800 Subject: [PATCH 03/12] opt: optimzie xwayland position set --- src/fetch/client.h | 4 ++-- src/mango.c | 58 ++++++++++++++++++++++++++++++++-------------- 2 files changed, 42 insertions(+), 20 deletions(-) diff --git a/src/fetch/client.h b/src/fetch/client.h index 85b296a3..77b2d865 100644 --- a/src/fetch/client.h +++ b/src/fetch/client.h @@ -91,9 +91,9 @@ setclient_coordinate_center(Client *c, Monitor *tm, struct wlr_box geom, if (!m) return geom; - uint32_t cbw = check_hit_no_border(c) ? c->bw : 0; + uint32_t cbw = c && check_hit_no_border(c) ? c->bw : 0; - if (!c->no_force_center && m) { + if ((!c || !c->no_force_center) && m) { tempbox.x = m->w.x + (m->w.width - geom.width) / 2; tempbox.y = m->w.y + (m->w.height - geom.height) / 2; } else { diff --git a/src/mango.c b/src/mango.c index 8c96dba2..268ab33f 100644 --- a/src/mango.c +++ b/src/mango.c @@ -1073,7 +1073,7 @@ static struct wl_listener last_cursor_surface_destroy_listener = { .notify = last_cursor_surface_destroy}; #ifdef XWAYLAND -static void fix_xwayland_unmanaged_coordinate(Client *c); +static void fix_xwayland_coordinate(struct wlr_box *geom); static int32_t synckeymap(void *data); static void activatex11(struct wl_listener *listener, void *data); static void configurex11(struct wl_listener *listener, void *data); @@ -1615,7 +1615,7 @@ void applyrules(Client *c) { #ifdef XWAYLAND if (c->isfloating && client_is_x11(c)) { - fix_xwayland_unmanaged_coordinate(c); + fix_xwayland_coordinate(&c->geom); c->float_geom = c->geom; } #endif @@ -4472,7 +4472,11 @@ mapnotify(struct wl_listener *listener, void *data) { /* Unmanaged clients always are floating */ #ifdef XWAYLAND if (client_is_x11(c)) { - fix_xwayland_unmanaged_coordinate(c); + fix_xwayland_coordinate(&c->geom); + wlr_scene_node_set_position(&c->scene->node, c->geom.x, c->geom.y); + wlr_xwayland_surface_configure(c->surface.xwayland, c->geom.x, + c->geom.y, c->geom.width, + c->geom.height); LISTEN(&c->surface.xwayland->events.set_geometry, &c->set_geometry, setgeometrynotify); } @@ -6824,16 +6828,17 @@ void virtualpointer(struct wl_listener *listener, void *data) { } #ifdef XWAYLAND -void fix_xwayland_unmanaged_coordinate(Client *c) { +void fix_xwayland_coordinate(struct wlr_box *geom) { if (!selmon) return; // 1. 如果窗口已经在当前活动显示器内,直接返回 - if (c->geom.x >= selmon->m.x && c->geom.x < selmon->m.x + selmon->m.width && - c->geom.y >= selmon->m.y && c->geom.y < selmon->m.y + selmon->m.height) + if (geom->x >= selmon->m.x && geom->x <= selmon->m.x + selmon->m.width && + geom->y >= selmon->m.y && geom->y <= selmon->m.y + selmon->m.height) return; - c->geom = setclient_coordinate_center(c, selmon, c->geom, 0, 0); + geom->x = selmon->m.x + (selmon->m.width - geom->width) / 2; + geom->y = selmon->m.y + (selmon->m.height - geom->height) / 2; } int32_t synckeymap(void *data) { @@ -6888,24 +6893,41 @@ void activatex11(struct wl_listener *listener, void *data) { void configurex11(struct wl_listener *listener, void *data) { Client *c = wl_container_of(listener, c, configure); struct wlr_xwayland_surface_configure_event *event = data; + struct wlr_box new_geo; + new_geo.x = event->x; + new_geo.y = event->y; + new_geo.width = event->width; + new_geo.height = event->height; + fix_xwayland_coordinate(&new_geo); + if (!client_surface(c) || !client_surface(c)->mapped) { - wlr_xwayland_surface_configure(c->surface.xwayland, event->x, event->y, - event->width, event->height); + + wlr_xwayland_surface_configure(c->surface.xwayland, new_geo.x, + new_geo.y, new_geo.width, + new_geo.height); return; } + if (client_is_unmanaged(c)) { - wlr_scene_node_set_position(&c->scene->node, event->x, event->y); - wlr_xwayland_surface_configure(c->surface.xwayland, event->x, event->y, - event->width, event->height); + wlr_scene_node_set_position(&c->scene->node, new_geo.x, new_geo.y); + wlr_xwayland_surface_configure(c->surface.xwayland, new_geo.x, + new_geo.y, new_geo.width, + new_geo.height); return; } - if ((c->isfloating && c != grabc) || - !c->mon->pertag->ltidxs[c->mon->pertag->curtag]->arrange) { + + if (c->isfloating && c != grabc) { + new_geo.x = new_geo.x - c->bw; + new_geo.y = new_geo.y - c->bw; + new_geo.width = new_geo.width + c->bw * 2; + new_geo.height = new_geo.height + c->bw * 2; + fix_xwayland_coordinate(&new_geo); + resize(c, - (struct wlr_box){.x = event->x - c->bw, - .y = event->y - c->bw, - .width = event->width + c->bw * 2, - .height = event->height + c->bw * 2}, + (struct wlr_box){.x = new_geo.x, + .y = new_geo.y, + .width = new_geo.width, + .height = new_geo.height}, 0); } else { arrange(c->mon, false, false); From a429420b73ac35b6c40aa726fcb5502545e059e6 Mon Sep 17 00:00:00 2001 From: Osama Ragab Date: Sun, 7 Jun 2026 16:30:22 +0300 Subject: [PATCH 04/12] feat: add hide cursor on keypress option (#871) --- docs/configuration/miscellaneous.md | 3 ++- src/config/parse_config.h | 6 ++++++ src/mango.c | 5 +++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/configuration/miscellaneous.md b/docs/configuration/miscellaneous.md index 1001c4c1..cd8d167d 100644 --- a/docs/configuration/miscellaneous.md +++ b/docs/configuration/miscellaneous.md @@ -21,6 +21,7 @@ description: Advanced settings for XWayland, focus behavior, and system integrat | `sloppyfocus` | `1` | Focus follows the mouse cursor. | | `warpcursor` | `1` | Warp the cursor to the center of the window when focus changes via keyboard. | | `cursor_hide_timeout` | `0` | Hide the cursor after `N` seconds of inactivity (`0` to disable). | +| `cursor_hide_on_keypress` | `0` | Hide the cursor on keypress. | | `drag_tile_to_tile` | `0` | Allow dragging a tiled window onto another to swap their positions. | | `drag_tile_small` | `1` | Allow dragging a tiled window temporarily to small size.| | `drag_corner` | `3` | Corner for drag-to-tile detection (0: none, 1–3: corners, 4: auto-detect). | @@ -48,4 +49,4 @@ description: Advanced settings for XWayland, focus behavior, and system integrat | `idleinhibit_ignore_visible` | `0` | Allow invisible clients (e.g., background audio players) to inhibit idle. | | `tag_carousel` | `0` | Enable tag carousel (cycling through tags). | | `drag_tile_refresh_interval` | `8.0` | Interval (1.0–16.0) to refresh tiled window resize during drag. Too small may cause application lag. | -| `drag_floating_refresh_interval` | `8.0` | Interval (1.0–16.0) to refresh floating window resize during drag. Too small may cause application lag. | \ No newline at end of file +| `drag_floating_refresh_interval` | `8.0` | Interval (1.0–16.0) to refresh floating window resize during drag. Too small may cause application lag. | diff --git a/src/config/parse_config.h b/src/config/parse_config.h index 5379ddca..72196c5f 100644 --- a/src/config/parse_config.h +++ b/src/config/parse_config.h @@ -261,6 +261,7 @@ typedef struct { int32_t overviewgappi; int32_t overviewgappo; uint32_t cursor_hide_timeout; + uint32_t cursor_hide_on_keypress; uint32_t axis_bind_apply_timeout; uint32_t focus_on_activate; @@ -1714,6 +1715,8 @@ bool parse_option(Config *config, char *key, char *value) { config->overviewgappo = atoi(value); } else if (strcmp(key, "cursor_hide_timeout") == 0) { config->cursor_hide_timeout = atoi(value); + } else if (strcmp(key, "cursor_hide_on_keypress") == 0) { + config->cursor_hide_on_keypress = atoi(value); } else if (strcmp(key, "axis_bind_apply_timeout") == 0) { config->axis_bind_apply_timeout = atoi(value); } else if (strcmp(key, "focus_on_activate") == 0) { @@ -3346,6 +3349,8 @@ void override_config(void) { CLAMP_INT(config.no_radius_when_single, 0, 1); config.cursor_hide_timeout = CLAMP_INT(config.cursor_hide_timeout, 0, 36000); + config.cursor_hide_on_keypress = + CLAMP_INT(config.cursor_hide_on_keypress, 0, 1); config.single_scratchpad = CLAMP_INT(config.single_scratchpad, 0, 1); config.repeat_rate = CLAMP_INT(config.repeat_rate, 1, 1000); config.repeat_delay = CLAMP_INT(config.repeat_delay, 1, 20000); @@ -3507,6 +3512,7 @@ void set_value_default() { config.overviewgappi = 5; config.overviewgappo = 30; config.cursor_hide_timeout = 0; + config.cursor_hide_on_keypress = 0; config.warpcursor = 1; config.drag_corner = 3; diff --git a/src/mango.c b/src/mango.c index 74d4c196..b0b93023 100644 --- a/src/mango.c +++ b/src/mango.c @@ -4206,6 +4206,11 @@ void keypress(struct wl_listener *listener, void *data) { } } + if (config.cursor_hide_on_keypress && !cursor_hidden && + event->state == WL_KEYBOARD_KEY_STATE_PRESSED) { + hidecursor(NULL); + } + /* On _press_ if there is no active screen locker, * attempt to process a compositor keybinding. */ for (i = 0; i < nsyms; i++) From 36398a1af2bc06f57154a68934a4f89045c86a77 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Mon, 8 Jun 2026 19:28:28 +0800 Subject: [PATCH 05/12] opt: optimize unmanaged client init --- src/mango.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/mango.c b/src/mango.c index ee64a551..c18c4b1c 100644 --- a/src/mango.c +++ b/src/mango.c @@ -4473,28 +4473,24 @@ mapnotify(struct wl_listener *listener, void *data) { /* Handle unmanaged clients first so we can return prior create borders */ +#ifdef XWAYLAND if (client_is_unmanaged(c)) { /* Unmanaged clients always are floating */ -#ifdef XWAYLAND - if (client_is_x11(c)) { - fix_xwayland_coordinate(&c->geom); - wlr_scene_node_set_position(&c->scene->node, c->geom.x, c->geom.y); - wlr_xwayland_surface_configure(c->surface.xwayland, c->geom.x, - c->geom.y, c->geom.width, - c->geom.height); - LISTEN(&c->surface.xwayland->events.set_geometry, &c->set_geometry, - setgeometrynotify); - } -#endif - wlr_scene_node_reparent(&c->scene->node, layers[LyrOverlay]); + fix_xwayland_coordinate(&c->geom); wlr_scene_node_set_position(&c->scene->node, c->geom.x, c->geom.y); + wlr_xwayland_surface_configure(c->surface.xwayland, c->geom.x, + c->geom.y, c->geom.width, + c->geom.height); + LISTEN(&c->surface.xwayland->events.set_geometry, &c->set_geometry, + setgeometrynotify); + wlr_scene_node_reparent(&c->scene->node, layers[LyrOverlay]); if (client_wants_focus(c)) { focusclient(c, 1); exclusive_focus = c; } return; } - +#endif // extra node for (i = 0; i < 2; i++) { From 47f30454e6e7cd920026b836f6152b03c88a962b Mon Sep 17 00:00:00 2001 From: xtheeq Date: Mon, 8 Jun 2026 20:33:21 +0530 Subject: [PATCH 06/12] docs: fix wayfreeze link page --- docs/screenshot.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/screenshot.md b/docs/screenshot.md index 7f85224a..8c512313 100644 --- a/docs/screenshot.md +++ b/docs/screenshot.md @@ -14,7 +14,7 @@ Instead, compose your own workflow from small Wayland utilities and bind them to | [`slurp`](https://github.com/emersion/slurp) | Interactively select a region for `grim` | | [`wl-copy`](https://github.com/bugaevc/wl-clipboard) | Copy screenshots directly to the clipboard | | [`satty`](https://github.com/gabm/Satty) | Annotate screenshots before saving | -| [`wayfreeze`](https://github.com/nicbk/wayfreeze) | Freeze the screen before capture | +| [`wayfreeze`](https://github.com/Jappie3/wayfreeze) | Freeze the screen before capture | Install the required with your package manager or from source. From 52732c928b8e24127fb76cefad8e17db47003569 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Tue, 9 Jun 2026 21:50:16 +0800 Subject: [PATCH 07/12] fix: grid layout cant fullscreen --- src/layout/horizontal.h | 33 +++++++++++------------ src/layout/vertical.h | 58 +++++++++++++++++++---------------------- 2 files changed, 44 insertions(+), 47 deletions(-) diff --git a/src/layout/horizontal.h b/src/layout/horizontal.h index 92980731..24eed392 100644 --- a/src/layout/horizontal.h +++ b/src/layout/horizontal.h @@ -588,6 +588,7 @@ void grid(Monitor *m) { int32_t target_gappi = enablegaps ? config.gappih : 0; float single_width_ratio = 0.9; float single_height_ratio = 0.9; + struct wlr_box target_geom; n = m->visible_fake_tiling_clients; @@ -603,11 +604,11 @@ void grid(Monitor *m) { ISFAKETILED(c))) { cw = (m->w.width - 2 * target_gappo) * single_width_ratio; ch = (m->w.height - 2 * target_gappo) * single_height_ratio; - c->geom.x = m->w.x + (m->w.width - cw) / 2; - c->geom.y = m->w.y + (m->w.height - ch) / 2; - c->geom.width = cw; - c->geom.height = ch; - client_tile_resize(c, c->geom, 0); + target_geom.x = m->w.x + (m->w.width - cw) / 2; + target_geom.y = m->w.y + (m->w.height - ch) / 2; + target_geom.width = cw; + target_geom.height = ch; + client_tile_resize(c, target_geom, 0); return; } } @@ -651,16 +652,16 @@ void grid(Monitor *m) { cw = avail_w * (col_pers[i] / sum_col); if (i == 0) { - c->geom.x = m->w.x + target_gappo; + target_geom.x = m->w.x + target_gappo; } else if (i == 1) { // 第二个窗口的 X 坐标紧跟第一个窗口后面 float cw0 = avail_w * (col_pers[0] / sum_col); - c->geom.x = m->w.x + target_gappo + cw0 + target_gappi; + target_geom.x = m->w.x + target_gappo + cw0 + target_gappi; } - c->geom.y = m->w.y + (m->w.height - ch) / 2 + target_gappo; - c->geom.width = cw; - c->geom.height = ch; - client_tile_resize(c, c->geom, 0); + target_geom.y = m->w.y + (m->w.height - ch) / 2 + target_gappo; + target_geom.width = cw; + target_geom.height = ch; + client_tile_resize(c, target_geom, 0); i++; } } @@ -757,11 +758,11 @@ void grid(Monitor *m) { ? (m->w.y + m->w.height - target_gappo - fl_cy) : avail_h * (row_pers[r_idx] / sum_row); - c->geom.x = (int32_t)fl_cx; - c->geom.y = (int32_t)fl_cy; - c->geom.width = (int32_t)fl_cw; - c->geom.height = (int32_t)fl_ch; - client_tile_resize(c, c->geom, 0); + target_geom.x = (int32_t)fl_cx; + target_geom.y = (int32_t)fl_cy; + target_geom.width = (int32_t)fl_cw; + target_geom.height = (int32_t)fl_ch; + client_tile_resize(c, target_geom, 0); i++; } } diff --git a/src/layout/vertical.h b/src/layout/vertical.h index 523467f9..6e058dea 100644 --- a/src/layout/vertical.h +++ b/src/layout/vertical.h @@ -186,14 +186,13 @@ void vertical_grid(Monitor *m) { int32_t cw, ch; int32_t rows, cols, overrows; Client *c = NULL; - int32_t target_gappo = - enablegaps ? m->isoverview ? config.overviewgappo : config.gappov : 0; - int32_t target_gappi = - enablegaps ? m->isoverview ? config.overviewgappi : config.gappiv : 0; - float single_width_ratio = m->isoverview ? 0.7 : 0.9; - float single_height_ratio = m->isoverview ? 0.8 : 0.9; + int32_t target_gappo = enablegaps ? config.gappov : 0; + int32_t target_gappi = enablegaps ? config.gappiv : 0; + float single_width_ratio = 0.9; + float single_height_ratio = 0.9; + struct wlr_box target_geom; - n = m->isoverview ? m->visible_clients : m->visible_fake_tiling_clients; + n = m->visible_fake_tiling_clients; if (n == 0) return; @@ -202,15 +201,14 @@ void vertical_grid(Monitor *m) { if (c->mon != m) continue; if (VISIBLEON(c, m) && !c->isunglobal && - ((m->isoverview && !client_is_x11_popup(c)) || - ISFAKETILED(c))) { + (!client_is_x11_popup(c) || ISFAKETILED(c))) { ch = (m->w.height - 2 * target_gappo) * single_height_ratio; cw = (m->w.width - 2 * target_gappo) * single_width_ratio; - c->geom.x = m->w.x + (m->w.width - cw) / 2; - c->geom.y = m->w.y + (m->w.height - ch) / 2; - c->geom.width = cw; - c->geom.height = ch; - client_tile_resize(c, c->geom, 0); + target_geom.x = m->w.x + (m->w.width - cw) / 2; + target_geom.y = m->w.y + (m->w.height - ch) / 2; + target_geom.width = cw; + target_geom.height = ch; + client_tile_resize(c, target_geom, 0); return; } } @@ -224,8 +222,7 @@ void vertical_grid(Monitor *m) { if (c->mon != m) continue; if (VISIBLEON(c, m) && !c->isunglobal && - ((m->isoverview && !client_is_x11_popup(c)) || - ISFAKETILED(c))) { + (!client_is_x11_popup(c) || ISFAKETILED(c))) { if (i < 2) row_pers[i] = (c->grid_row_per > 0.0f) ? c->grid_row_per : 1.0f; @@ -242,8 +239,7 @@ void vertical_grid(Monitor *m) { if (c->mon != m) continue; if (VISIBLEON(c, m) && !c->isunglobal && - ((m->isoverview && !client_is_x11_popup(c)) || - ISFAKETILED(c))) { + (!client_is_x11_popup(c) || ISFAKETILED(c))) { c->grid_col_idx = 0; c->grid_row_idx = i; c->grid_col_per = 1.0f; @@ -252,17 +248,17 @@ void vertical_grid(Monitor *m) { // 根据分配的权重动态计算当前窗口的高度 ch = avail_h * (row_pers[i] / sum_row); - c->geom.x = m->w.x + (m->w.width - cw) / 2 + target_gappo; + target_geom.x = m->w.x + (m->w.width - cw) / 2 + target_gappo; if (i == 0) { - c->geom.y = m->w.y + target_gappo; + target_geom.y = m->w.y + target_gappo; } else if (i == 1) { // 第二个窗口的 Y 坐标紧跟第一个窗口下面 float ch0 = avail_h * (row_pers[0] / sum_row); - c->geom.y = m->w.y + target_gappo + ch0 + target_gappi; + target_geom.y = m->w.y + target_gappo + ch0 + target_gappi; } - c->geom.width = cw; - c->geom.height = ch; - client_tile_resize(c, c->geom, 0); + target_geom.width = cw; + target_geom.height = ch; + client_tile_resize(c, target_geom, 0); i++; } } @@ -287,7 +283,7 @@ void vertical_grid(Monitor *m) { if (c->mon != m) continue; if (VISIBLEON(c, m) && !c->isunglobal && - ((m->isoverview && !client_is_x11_popup(c)) || ISFAKETILED(c))) { + (!client_is_x11_popup(c) || ISFAKETILED(c))) { int32_t c_idx = i / rows; int32_t r_idx = i % rows; if (r_idx == 0) @@ -314,7 +310,7 @@ void vertical_grid(Monitor *m) { if (c->mon != m) continue; if (VISIBLEON(c, m) && !c->isunglobal && - ((m->isoverview && !client_is_x11_popup(c)) || ISFAKETILED(c))) { + (!client_is_x11_popup(c) || ISFAKETILED(c))) { int32_t c_idx = i / rows; int32_t r_idx = i % rows; @@ -352,11 +348,11 @@ void vertical_grid(Monitor *m) { ? (m->w.x + m->w.width - target_gappo - fl_cx) : avail_w * (col_pers[c_idx] / sum_col); - c->geom.x = (int32_t)fl_cx; - c->geom.y = (int32_t)fl_cy; - c->geom.width = (int32_t)fl_cw; - c->geom.height = (int32_t)fl_ch; - client_tile_resize(c, c->geom, 0); + target_geom.x = (int32_t)fl_cx; + target_geom.y = (int32_t)fl_cy; + target_geom.width = (int32_t)fl_cw; + target_geom.height = (int32_t)fl_ch; + client_tile_resize(c, target_geom, 0); i++; } } From ef59224cdb110731c361a68959f4596665e6d2a2 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Tue, 9 Jun 2026 21:56:48 +0800 Subject: [PATCH 08/12] fix: deck layout caculate error when multi master --- src/layout/horizontal.h | 22 +++++++++------------- src/layout/vertical.h | 22 +++++++++++----------- 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/src/layout/horizontal.h b/src/layout/horizontal.h index 24eed392..419e218a 100644 --- a/src/layout/horizontal.h +++ b/src/layout/horizontal.h @@ -500,16 +500,13 @@ void deck(Monitor *m) { return; wl_list_for_each(fc, &clients, link) { - if (VISIBLEON(fc, m) && ISFAKETILED(fc)) break; } - // Calculate master width using mfact from pertag mfact = fc->master_mfact_per > 0.0f ? fc->master_mfact_per : m->pertag->mfacts[m->pertag->curtag]; - // Calculate master width including outer gaps if (n > nmasters) mw = nmasters ? round((m->w.width - 2 * cur_gappoh) * mfact) : 0; else @@ -521,16 +518,15 @@ void deck(Monitor *m) { continue; if (i < nmasters) { c->master_mfact_per = mfact; - // Master area clients - client_tile_resize( - c, - (struct wlr_box){.x = m->w.x + cur_gappoh, - .y = m->w.y + cur_gappov + my, - .width = mw, - .height = (m->w.height - 2 * cur_gappov - my) / - (MIN(n, nmasters) - i)}, - 0); - my += c->geom.height; + int32_t h = + (m->w.height - 2 * cur_gappov - my) / (MIN(n, nmasters) - i); + client_tile_resize(c, + (struct wlr_box){.x = m->w.x + cur_gappoh, + .y = m->w.y + cur_gappov + my, + .width = mw, + .height = h}, + 0); + my += h; } else { // Stack area clients c->master_mfact_per = mfact; diff --git a/src/layout/vertical.h b/src/layout/vertical.h index 6e058dea..b1de212e 100644 --- a/src/layout/vertical.h +++ b/src/layout/vertical.h @@ -137,12 +137,10 @@ void vertical_deck(Monitor *m) { return; wl_list_for_each(fc, &clients, link) { - if (VISIBLEON(fc, m) && ISFAKETILED(fc)) break; } - // Calculate master width using mfact from pertag mfact = fc->master_mfact_per > 0.0f ? fc->master_mfact_per : m->pertag->mfacts[m->pertag->curtag]; @@ -156,16 +154,18 @@ void vertical_deck(Monitor *m) { if (!VISIBLEON(c, m) || !ISFAKETILED(c)) continue; if (i < nmasters) { - client_tile_resize( - c, - (struct wlr_box){.x = m->w.x + cur_gappoh + mx, - .y = m->w.y + cur_gappov, - .width = (m->w.width - 2 * cur_gappoh - mx) / - (MIN(n, nmasters) - i), - .height = mh}, - 0); - mx += c->geom.width; + c->master_mfact_per = mfact; + int32_t w = + (m->w.width - 2 * cur_gappoh - mx) / (MIN(n, nmasters) - i); + client_tile_resize(c, + (struct wlr_box){.x = m->w.x + cur_gappoh + mx, + .y = m->w.y + cur_gappov, + .width = w, + .height = mh}, + 0); + mx += w; } else { + c->master_mfact_per = mfact; client_tile_resize( c, (struct wlr_box){.x = m->w.x + cur_gappoh, From 94db68ef88b8a922a3812746465e7374f3465567 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Thu, 11 Jun 2026 11:08:44 +0800 Subject: [PATCH 09/12] fix: floating window can't get pointer focus when cross monitor --- src/mango.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mango.c b/src/mango.c index c18c4b1c..35815e38 100644 --- a/src/mango.c +++ b/src/mango.c @@ -4824,13 +4824,13 @@ void motionnotify(uint32_t time, struct wlr_input_device *device, double dx, } if (!scroller_focus_lock || !(c && c->mon && !INSIDEMON(c))) { - if (c && c->mon && is_scroller_layout(c->mon) && !INSIDEMON(c)) { + if (c && c->mon && ISSCROLLTILED(c) && is_scroller_layout(c->mon) && !INSIDEMON(c)) { should_lock = true; } if (!((!config.edge_scroller_pointer_focus || speed < config.edge_scroller_focus_allow_speed) && - c && c->mon && is_scroller_layout(c->mon) && !INSIDEMON(c))) { + c && c->mon && ISSCROLLTILED(c) && is_scroller_layout(c->mon) && !INSIDEMON(c))) { pointerfocus(c, surface, sx, sy, time); } From 33cda5afea459aed69ac517a8b50d9082e57a396 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Thu, 11 Jun 2026 12:37:48 +0800 Subject: [PATCH 10/12] opt:optimize edge focus judge --- src/mango.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mango.c b/src/mango.c index 35815e38..281d1720 100644 --- a/src/mango.c +++ b/src/mango.c @@ -4812,7 +4812,7 @@ void motionnotify(uint32_t time, struct wlr_input_device *device, double dx, if (!surface && !seat->drag && !cursor_hidden) wlr_cursor_set_xcursor(cursor, cursor_mgr, "default"); - if (c && c->mon && !c->animation.running && (INSIDEMON(c) || !ISTILED(c))) { + if (c && c->mon && !c->animation.running && (INSIDEMON(c) || !ISSCROLLTILED(c))) { scroller_focus_lock = 0; } From 03e68ba069f51833466c23509a41b78f0a3faf32 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Thu, 11 Jun 2026 12:39:17 +0800 Subject: [PATCH 11/12] opt: optimize marco use in client tile resize --- src/action/client.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/action/client.h b/src/action/client.h index f374ca14..1b3c9335 100644 --- a/src/action/client.h +++ b/src/action/client.h @@ -51,7 +51,7 @@ static void finish_exchange_arrange_and_focus(Client *c1, Client *c2, } void client_tile_resize(Client *c, struct wlr_box geo, int32_t interact) { - if (!ISSCROLLTILED(c)) + if (!ISFAKETILED(c)) return; if (!c->isfullscreen && !c->ismaximizescreen) { From 792bfac475cab87bd470ed70bb9f540d72959263 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Thu, 11 Jun 2026 23:14:50 +0800 Subject: [PATCH 12/12] fix: can't resize tile scroller window when only two tiled client --- src/layout/arrange.h | 3 ++- src/mango.c | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/layout/arrange.h b/src/layout/arrange.h index 7223b430..eab3ac00 100644 --- a/src/layout/arrange.h +++ b/src/layout/arrange.h @@ -751,6 +751,7 @@ void resize_tile_grid_fair(Client *grabc, bool isdrag, int32_t offsetx, void resize_tile_scroller(Client *grabc, bool isdrag, int32_t offsetx, int32_t offsety, uint32_t time, bool isvertical) { + if (!grabc || grabc->isfullscreen || grabc->ismaximizescreen) return; if (grabc->mon->isoverview) @@ -772,7 +773,7 @@ void resize_tile_scroller(Client *grabc, bool isdrag, int32_t offsetx, Client *stack_head_client = headnode->client; - if (m->visible_tiling_clients == 1 && + if (m->visible_scroll_tiling_clients == 1 && !config.scroller_ignore_proportion_single) return; diff --git a/src/mango.c b/src/mango.c index 281d1720..731c0ac3 100644 --- a/src/mango.c +++ b/src/mango.c @@ -4812,7 +4812,8 @@ void motionnotify(uint32_t time, struct wlr_input_device *device, double dx, if (!surface && !seat->drag && !cursor_hidden) wlr_cursor_set_xcursor(cursor, cursor_mgr, "default"); - if (c && c->mon && !c->animation.running && (INSIDEMON(c) || !ISSCROLLTILED(c))) { + if (c && c->mon && !c->animation.running && + (INSIDEMON(c) || !ISSCROLLTILED(c))) { scroller_focus_lock = 0; } @@ -4824,13 +4825,15 @@ void motionnotify(uint32_t time, struct wlr_input_device *device, double dx, } if (!scroller_focus_lock || !(c && c->mon && !INSIDEMON(c))) { - if (c && c->mon && ISSCROLLTILED(c) && is_scroller_layout(c->mon) && !INSIDEMON(c)) { + if (c && c->mon && ISSCROLLTILED(c) && is_scroller_layout(c->mon) && + !INSIDEMON(c)) { should_lock = true; } if (!((!config.edge_scroller_pointer_focus || speed < config.edge_scroller_focus_allow_speed) && - c && c->mon && ISSCROLLTILED(c) && is_scroller_layout(c->mon) && !INSIDEMON(c))) { + c && c->mon && ISSCROLLTILED(c) && is_scroller_layout(c->mon) && + !INSIDEMON(c))) { pointerfocus(c, surface, sx, sy, time); }