调整 send_client_to_next_monitor 函数实现

This commit is contained in:
2026-01-14 03:42:57 +08:00
parent ced78b004f
commit 049b18a496
4 changed files with 11 additions and 13 deletions

View File

@@ -36,20 +36,10 @@ void send_client_to_tag(const user_action_arg_t *arg) {
void send_client_to_next_monitor(const user_action_arg_t *arg) {
if (!wm.client_focused) return;
monitor_t *current_monitor = wm.client_focused->monitor;
monitor_t *next_monitor = current_monitor->next;
if (next_monitor == nullptr) {
next_monitor = wm.monitor_list;
} else {
for (monitor_t *m = wm.monitor_list; m && m->next != current_monitor;
m = m->next) {
next_monitor = m;
}
}
monitor_t *next_monitor = wm_get_next_monitor(wm.client_focused->monitor);
if (wm.client_focused->monitor == next_monitor) return;
if (current_monitor != next_monitor) {
client_send_to_monitor(wm.client_focused, next_monitor);
}
client_send_to_monitor(wm.client_focused, next_monitor);
}
void spawn(const user_action_arg_t *arg) {