Skip to content

Commit 6eb8420

Browse files
mmstickjackpot51
authored andcommitted
fix: Prevent pointer movement from dock focus clicks
1 parent b7524d8 commit 6eb8420

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/window.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,12 +659,23 @@ export function activate(ext: Ext, move_mouse: boolean, default_pointer_position
659659
&& imports.ui.main.modalCount === 0
660660
&& ext.settings.mouse_cursor_follows_active_window()
661661
&& !pointer_already_on_window(win)
662+
&& pointer_in_work_area()
662663

663664
if (pointer_placement_permitted) {
664665
place_pointer_on(default_pointer_position, win)
665666
}
666667
}
667668

669+
function pointer_in_work_area(): boolean {
670+
const cursor = lib.cursor_rect()
671+
const indice = global.display.get_current_monitor()
672+
const mon = global.display.get_workspace_manager()
673+
.get_active_workspace()
674+
.get_work_area_for_monitor(indice)
675+
676+
return mon ? cursor.intersects(mon) : false
677+
}
678+
668679
export function place_pointer_on(default_pointer_position: Config.DefaultPointerPosition, win: Meta.Window) {
669680
const rect = win.get_frame_rect();
670681
let x = rect.x;

0 commit comments

Comments
 (0)