fix: 修改 wm_set_current_monitor 函数实现避免光标乱跳
- 将 wm_set_current_monitor 改为支持 restore_cursor 参数,按场景决定是 否恢复光标位置 - 仅在指针位于当前显示器时更新 cursor_position 缓存,减少错误覆盖
This commit is contained in:
@@ -34,7 +34,7 @@ static void button_press(xcb_button_press_event_t *ev) {
|
||||
|
||||
if (!monitor) return;
|
||||
|
||||
wm_set_current_monitor(monitor);
|
||||
wm_set_current_monitor(monitor, false);
|
||||
if (ev->event_x >= monitor->tag_extent.start &&
|
||||
ev->event_x <= monitor->tag_extent.end) {
|
||||
click_area = click_tag;
|
||||
@@ -188,7 +188,7 @@ static void client_message(xcb_client_message_event_t *ev) {
|
||||
|
||||
switch (ev->data.data32[0]) {
|
||||
case 2: /* 来自 pager */
|
||||
wm_set_current_monitor(c->monitor);
|
||||
wm_set_current_monitor(c->monitor, true);
|
||||
monitor_select_tag(c->monitor, t->mask);
|
||||
client_focus(c);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user