-
-
Notifications
You must be signed in to change notification settings - Fork 560
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
Automatically reset window position when disconnecting secondary screen #1280
Automatically reset window position when disconnecting secondary screen #1280
Conversation
For some reason I am getting an |
I guess this is the cause: electron/electron#10862 |
That means you can just remove those disable comments. |
Can you try to do this automatically? You could listen to this event https://www.electronjs.org/docs/api/screen#event-display-removed and then reset the position. I wonder if after resetting the position, we could set the saved position again and it would be correct. Worth a shot. |
Removing those disable comments makes my build pass locally, but fails when building in Travis. For some reason, I don't get the |
Will give this a shot, would definitely be smoother to have it happen automatically. |
I've tried an implementing this in 9f6e1ad. It can be tested in Windows (if using two screens), by moving the Caprine main window to the secondary screen and setting the "Project" (Win+P) setting to "PC Screen Only". The Caprine window position should move to the same position on the primary screen as it had on the secondary screen. |
Is that really a Windows convention? Do other Windows app support that. Because the menu item is named "Exit" on windows, so "Q" doesn't really make sense. |
Huh, I must've picked up that bad habit over the years... I just assumed it was a conventional shortcut, due to how closely it is to Although uncommon, it is still implemented in some applications (i.e. Firefox uses Currently And also, cheers for the review! 👍 |
Yes, but that's really out of the scope of this PR and should be a separate PR. |
The PR title needs to be updated. |
Co-Authored-By: Sindre Sorhus <[email protected]>
…tomioe/caprine into tray-position-and-quit-shortcut
Added a few features that I find immensely useful in my everyday use of Caprine (on Windows 10).
When going from multi-screen to single-screen (i.e. when undocking laptop) the main window of Caprine will sometimes be stuck off-screen (cannot even using Win+Arrow Keys to move it). Having a 'Reset Position' in the tray menu helps this problem.
I try to minimize my mouse movement as much as possible, but using Alt to toggle the menu and going into Exit simply isn't fast enough. I believe Command+Q is automatically bound in macOS to make an application quit, but not so on Windows, so I have added the Ctrl+Q keybinding to quit Caprine.