Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New preference: move mouse to center of window after focusing it #1087

Closed
alt-tab-macos-bot opened this issue Aug 26, 2021 · 9 comments
Closed
Labels
enhancement New feature or request

Comments

@alt-tab-macos-bot
Copy link

This issue was opened by a bot after a user submitted feedback through the in-app form.

From: korand@korand.com

Message:

Please add ability to automatically move cursor to active window after switching. It will be very usefull for external monitors when need to move cursor manually to another screen or to use some additional programs with hot keys.

Debug profile

  • App version: 6.22.1
  • App preferences:
    • MSAppCenter310AppCenterUserDefaultsMigratedKey: 1
    • MSAppCenter310CrashesUserDefaultsMigratedKey: 1
    • MSAppCenterInstallId: 47813AFB-47E1-486B-B4B0-AD3CFE144D49
    • MSAppCenterPastDevices: {length = 1124, bytes = 0x62706c69 73743030 d4010203 04050607 ... 00000000 00000372 }
    • MSAppCenterSessionIdHistory: {length = 452, bytes = 0x62706c69 73743030 d4010203 04050607 ... 00000000 0000014e }
    • MSAppCenterUserIdHistory: {length = 447, bytes = 0x62706c69 73743030 d4010203 04050607 ... 00000000 00000149 }
    • SUAutomaticallyUpdate: 1
    • SUEnableAutomaticChecks: 1
    • SUHasLaunchedBefore: 1
    • SULastCheckTime: 2021-08-26 11:56:59 +0000
    • alignThumbnails: 0
    • appsToShow2: 1
    • preferencesVersion: 6.22.1
    • theme: 0
    • updatePolicy: 2
    • windowMaxWidthInRow: 30
  • Applications: 44
  • Windows: 10
    • {isFullscreen: false, isWindowlessApp: false, isMinimized: false, isHidden: false, isTabbed: false, isOnAllSpaces: false, shouldShowTheUser: true, spaceId: 1, spaceIndex: 1}
    • {isFullscreen: false, isWindowlessApp: false, isMinimized: false, isHidden: false, isTabbed: false, isOnAllSpaces: false, shouldShowTheUser: true, spaceId: 1, spaceIndex: 1}
    • {isFullscreen: false, isWindowlessApp: false, isMinimized: false, isHidden: false, isTabbed: false, isOnAllSpaces: false, shouldShowTheUser: true, spaceId: 1, spaceIndex: 1}
    • {isFullscreen: false, isWindowlessApp: false, isMinimized: false, isHidden: false, isTabbed: false, isOnAllSpaces: false, shouldShowTheUser: true, spaceId: 1, spaceIndex: 1}
    • {isFullscreen: false, isWindowlessApp: false, isMinimized: false, isHidden: true, isTabbed: false, isOnAllSpaces: false, shouldShowTheUser: true, spaceId: 1, spaceIndex: 1}
    • {isFullscreen: false, isWindowlessApp: false, isMinimized: false, isHidden: true, isTabbed: false, isOnAllSpaces: false, shouldShowTheUser: true, spaceId: 1, spaceIndex: 1}
    • {isFullscreen: false, isWindowlessApp: true, isMinimized: false, isHidden: false, isTabbed: false, isOnAllSpaces: false, shouldShowTheUser: true, spaceId: 18446744073709551615, spaceIndex: 9223372036854775807}
    • {isFullscreen: false, isWindowlessApp: true, isMinimized: false, isHidden: false, isTabbed: false, isOnAllSpaces: false, shouldShowTheUser: true, spaceId: 18446744073709551615, spaceIndex: 9223372036854775807}
    • {isFullscreen: false, isWindowlessApp: false, isMinimized: false, isHidden: false, isTabbed: false, isOnAllSpaces: false, shouldShowTheUser: true, spaceId: 1, spaceIndex: 1}
    • {isFullscreen: false, isWindowlessApp: false, isMinimized: false, isHidden: false, isTabbed: false, isOnAllSpaces: false, shouldShowTheUser: true, spaceId: 1, spaceIndex: 1}
  • OS version: Версия 11.5.2 (Выпуск 20G95)
  • OS architecture: x86_64
  • Locale: ru_BY (current)
  • Spaces: 1
  • Dark mode: Dark
  • "Displays have separate Spaces": unchecked
  • Hardware model: MacBookAir10,1
  • Screens: 2
    • {x: 0.0, y: 0.0, width: 1440.0, height: 900.0}
    • {x: 1440.0, y: -70.0, width: 1920.0, height: 1080.0}
  • CPU model: Apple M1
  • Memory size: 17,18 ГБ
  • Active CPU count: 8
  • Current CPU frequency: 2.4 Ghz
  • Resource utilization:
    • CPU: 0.2%
    • Memory: 130M
    • Threads count: 13

@lwouis
Copy link
Owner

lwouis commented Aug 29, 2021

This would definitely be a preference, as some people may find the cursor jumping around unwelcome. Let's wait and see if more users are interested in this before moving it further 👍

@lwouis lwouis added the enhancement New feature or request label Aug 29, 2021
@lwouis lwouis changed the title [In-app feedback] New preference: move mouse to center of window after focusing it Aug 29, 2021
@bnaman50
Copy link

bnaman50 commented May 3, 2022

Hey @lwouis , thanks for implementing this awesome feature. I have been looking for this for such a long time.
However, I believe there is a small issue.

Say a window is open on the Left/Right Half (I use [Rectable](https://github.com/rxhanson/Rectangle) for it). In this case, when I make this window active using AltTab it takes the cursor to the right corner. In general, when a window in not Maximized (Rectable terminology), mouse does not move to the centre. I was wondering if you could fix it such that mouse is in the centre of active/focus window?

Thanks,
Naman

@bnaman50
Copy link

bnaman50 commented May 3, 2022

Also, I was wondering if there is a way to mimic the original behaviour of Cmd+Tab. I know I can use the Cmd+Tab itself but it does not provide the ability to move the mouse cursor to the centre of screen. Could you please let me know?

Right now, I first press Cmd+Tab to switch between apps and then Cmd+` twice to move my cursor to the active window.

Thanks,
Naman

@lwouis
Copy link
Owner

lwouis commented May 3, 2022

Also, I was wondering if there is a way to mimic the original behaviour of Cmd+Tab.

if you mean listing and switching between apps instead of windows, then no, not today, but there is #337 for that

In general, when a window in not Maximized (Rectable terminology), mouse does not move to the centre

could you please share steps to reproduce and a video showcasing the issue?

@bnaman50
Copy link

bnaman50 commented May 3, 2022

Hey @lwouis,

Thanks for your quick response.

could you please share steps to reproduce and a video showcasing the issue?

This is actually working correctly. I think I was facing the issue previously, because I was using the original Cmd+Tab functionality to switch between apps and not the AltTab functionality.

if you mean listing and switching between apps instead of windows, then no, not today, but there is #337 for that

I am assuming that #337 has the relevant solution but I could not find it. Did you mean that it's a know issue/request? Having this would be great.

I use Cmd+Tab to show the open apps (original, does not support moving the cursor) and Cmd+` to switch between windows of a particular app (AltTab, supports moving the cursor). Having AltTab handle the first step would solve the issue.

Thanks,
Naman

@lwouis
Copy link
Owner

lwouis commented May 3, 2022

Yes, #337 is about discussing adding support for that to AltTab. As I said, AltTab doesn't support this today

Regarding the mouse focus not putting the mouse in the center of the windows, I just played around, and while initially it seemed to work fine, as soon as I moved and resized the windows, AltTab started positioning the mouse in places not the center of the windows. Some there is a bug going on there.

@LiamKearn
Copy link

Here is a screencast of me setting up some windows and recreating the issue: https://www.youtube.com/watch?v=Zy7z-_p4Efc (Sorry for the slugish pace, my macbook doesn't like 4k recordings)

I noted this bug quite close to the release of the new feature but wrote it off since it didn't occur frequently.

Probably not a rectangle issue since you've recreated without it now.

@lwouis lwouis closed this as completed in ed10201 May 4, 2022
@lwouis
Copy link
Owner

lwouis commented May 4, 2022

I found the root cause: the size and position of windows were not updated properly after they were resized or moved. I shipped a release with a fix. There is still edge-cases with tabs that won't work, but nothing I can do about it for now (see #1540)

lwouis pushed a commit that referenced this issue May 5, 2022
# [6.35.0](v6.34.1...v6.35.0) (2022-05-05)

### Bug Fixes

* sometimes moved cursor on focus wrong (closes [#1087](#1087)) ([ed10201](ed10201))

### Features

* update turkish localization ([9129ff6](9129ff6))
@LiamKearn
Copy link

Thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants