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

Fix: All modal windows open automatically when switching to teaBASE preference pane #29

Open
stevenlei opened this issue Dec 20, 2024 · 6 comments

Comments

@stevenlei
Copy link
Collaborator

Issue Description

When switching to the teaBASE preference pane after having another custom preference pane open, all modal windows (SSH passphrase, GPG passphrase, Homebrew install, etc.) open automatically at once, instead of opening on-demand when their respective features are accessed.

Steps to Reproduce

  1. Open System Settings
  2. Open any other custom preference pane first
  3. Switch to teaBASE preference pane
  4. All modal windows open automatically

teaBASE-window

Expected Behavior

Modal windows should only open when their respective features are accessed by the user (on-demand), not automatically when switching to the preference pane.

Root Cause

The preference pane's window management is not properly handling the window state when switching between panes.

Proposed Solution

Add proper window management to close all modal windows when switching between panes and ensure they only open on user interaction.

@stevenlei
Copy link
Collaborator Author

Actually it looks like a macOS bug, I tried to close all other windows in willSelect, it does close the windows when I open teaBASE as the second custom prefpane in the System Preferences app.

However, these modals do not react to cursor events after that, while we can still interact with the keyboard.

I am still trying different approaches to solve this strange behaviour.

@mxcl
Copy link
Member

mxcl commented Dec 20, 2024

Cannot reproduce with “SwiftDefaultApps” prefpane that I have to hand. Let’s drill down. What macOS version you have?

@stevenlei
Copy link
Collaborator Author

I am using 14.7.1 (23H222), Apple M2

I tried to create a brand new Prefpane from the Xcode template, and add one more window to the default XIB, go through the same steps and it does show up the additional window (Problematic again).

After that, I try to separate the second window from the main XIB, and wire it up with a WindowController, the problem gone.

@mxcl
Copy link
Member

mxcl commented Dec 20, 2024

k cool, let me test in a macOS 14 https://tart.run container.

And yeah, we should be using separate xibs anyway.

@mxcl
Copy link
Member

mxcl commented Dec 29, 2024

I think this is because “visible at launch” is checked. Next version will uncheck these and we'll see if it fixes it.

@stevenlei
Copy link
Collaborator Author

I think this is because “visible at launch” is checked. Next version will uncheck these and we'll see if it fixes it.

I have tried that but it doesn't work, maybe moving the sub windows to another XIB would help, but that is not a small change, so may wait for the next stable build before implementing it as the dev_tools branch has a lot of changes recently

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

Successfully merging a pull request may close this issue.

2 participants