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
Fix window-restoration (PR #27) #33
Fix window-restoration (PR #27) #33
Conversation
* Suggested approach: sindresorhus/touch-bar-simulator:Touch%20Bar%20Simulator/TouchBarWindow.swift@23f7c1c#L121-L125 * use `visibleFrame` instead of `frame` to calculate the right coordinates
I've change the code according to your approach.
|
In my tests, this worked great! Thanks @Mortennn |
Does this work still work under macOS 11? It's not restoring to the position I drag it to on next launch. Should this be using |
I just tried the bundled example app on macOS 11.5.2 and it correctly preserves its position between launches.
It's not clear to me which of these solutions that are the most correct solution. |
Maybe try switching the order of these to ensure it's not some kind of race issue: https://github.com/sindresorhus/Preferences/blob/main/Sources/Preferences/PreferencesWindowController.swift#L98-L99 |
They are now `true` by default. Fixes sindresorhus#33
They are now `true` by default. Fixes sindresorhus#33
* Suggested approach: sindresorhus/touch-bar-simulator:Touch%20Bar%20Simulator/TouchBarWindow.swift@23f7c1c#L121-L125 * use `visibleFrame` instead of `frame` to calculate the right coordinates * Remove `window?.center()` and `showWindow()` which had no effect
I have modified @DivineDominion's code a bit to get centering and restoring the preferences window to work.
showWindow()
.window.center()
does not work. I don't know why.