nikitabobko / AeroSpace

AeroSpace is an i3-like tiling window manager for macOS
https://nikitabobko.github.io/AeroSpace/guide
MIT License
8.14k stars 131 forks source link

Cursor misbehaving when having a single floating window with `on-focus-changed = ['move-mouse window-lazy-center']` #386

Open AlexBurdu opened 3 months ago

AlexBurdu commented 3 months ago

I sometimes prefer keeping a single floating window in a workspace (monitor too big) and I'm using on-focus-changed = ['move-mouse window-lazy-center'].

When I switch to the workspaces with a single floating window, the cursor goes to the bottom right corner of the screen instead of being centered on the single floating window in the workspace.

peter-popescu commented 1 month ago

I had the same problem, which was even more annoying with launchpad as a hot corner... luckily I found a slightly jank fix: exec-on-workspace-change = ['/bin/bash', '-c', 'aerospace move-mouse monitor-lazy-center' ] I think for some reason when a window is floating it doesn't register as a window so the normal focus change doesn't move the cursor, or maybe it just registers before it's moved out from the corner. Either way, this command just reminds aerospace to center your mouse if things get weird on a workspace change. Hope it helps :)

tonylsw commented 4 weeks ago

It happens to me as well, to both floating and non-floating windows.

cornz commented 2 weeks ago

I had the same problem, which was even more annoying with launchpad as a hot corner... luckily I found a slightly jank fix: exec-on-workspace-change = ['/bin/bash', '-c', 'aerospace move-mouse monitor-lazy-center' ] I think for some reason when a window is floating it doesn't register as a window so the normal focus change doesn't move the cursor, or maybe it just registers before it's moved out from the corner. Either way, this command just reminds aerospace to center your mouse if things get weird on a workspace change. Hope it helps :)

To add here (the jank works :)): when working with a single monitor you'll need exec-on-workspace-change = ['/bin/bash', '-c', 'aerospace move-mouse window-lazy-center' ]. Otherwise aerospace tells you that the mouse is already on the correct monitor and does nothing.