-
Notifications
You must be signed in to change notification settings - Fork 9
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
Avoid visual glitch on launch #38
Comments
I find the glitch isn’t really as noticeable when running the app in release mode (it’s really just a fraction of a second), though it is indeed noticeable at all. It might be possible how add functionality to hide/unhide the window and document how to make sure the window is hidden during startup by modifying the app’s Swift code. This way you’d still be able to configure your app within Dart, while the only thing you’d need to do in Swift would be making sure the window is hidden during launch. |
Is there a Swift and Dart code snippet that does what you described above? Or does this require new Dart APIs in this package? |
Honestly, I am no longer quite sure if you can even hide the window programmatically, but you can make it invisible by setting its alpha value to 0. So, you could achieve what you’re trying to do like this: In your self.alphaValue = 0.0 This will ensure that your window is opened with an alpha value of 0.0. Then, use the |
Adding the following line after the function override public func order(_ place: NSWindow.OrderingMode, relativeTo otherWin: Int) {
super.order(place, relativeTo: otherWin)
super.setIsVisible(false)
} (Adapted from |
Oh, you’re right, I somehow missed the |
When setting the window size, background, etc, upon launch, there's a visual glitch because the window begins with the standard Flutter configuration and then switches to the desired configuration when the Dart application starts running.
This glitch can be avoided by coding the application delegate to set all of these properties on launch, but writing Swift in the XCode project largely eliminates the value of this package from a window configuration standpoint.
Is there anything that can be done about this initial glitch? Is there a way to avoid showing any window until the Dart app starts up, and therefore the Dart code can set the configuration before any window is visible?
The text was updated successfully, but these errors were encountered: