feat: 统一 current_monitor 切换并让光标跟随 current_monitor 变化
- 新增 wm_set_current_monitor ,切换前记录光标当前所在 monitor 的最后 位置 - 切换到目标 monitor 时按需恢复该 monitor 的光标位置 - 将 action/event/client 中直接赋值 wm.current_monitor 的逻辑改为统一 调用 wm_set_current_monitor - 优化 monitor_restore_cursor_point:首次未初始化时计算并设置位置 - 为 wm_get_monitor_by_area / wm_get_monitor_by_point 增加 returns_nonnull 约束,并让 by_point 复用 by_area
This commit is contained in:
@@ -295,7 +295,7 @@ void client_send_to_monitor(client_t *client, monitor_t *monitor) {
|
||||
client->tags = monitor->selected_tag->mask;
|
||||
client_add_to_tag(client, monitor->selected_tag);
|
||||
|
||||
wm.current_monitor = monitor;
|
||||
wm_set_current_monitor(monitor);
|
||||
monitor_arrange(m);
|
||||
monitor_arrange(monitor);
|
||||
monitor_draw_bar(m);
|
||||
@@ -607,7 +607,7 @@ void client_apply_rules(client_t *client, const rule_t rules[],
|
||||
client->tags = t->mask;
|
||||
|
||||
if (r->switch_to_tag) {
|
||||
wm.current_monitor = m;
|
||||
wm_set_current_monitor(m);
|
||||
m->selected_tag = t;
|
||||
|
||||
logger("++ switch to tag: %u\n", t->index);
|
||||
|
||||
Reference in New Issue
Block a user