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:
2026-03-03 04:11:02 +08:00
parent 41a2289c96
commit fb0999df90
6 changed files with 39 additions and 24 deletions

View File

@@ -65,7 +65,7 @@ void raise_or_run(const user_action_arg_t *arg) {
if (client && client == wm.client_focused) return;
if (client) {
wm.current_monitor = client->monitor;
wm_set_current_monitor(client->monitor);
monitor_select_tag(client->monitor, client->tags);
client_stack_raise(client);
client_focus(client);