-
-
Notifications
You must be signed in to change notification settings - Fork 197
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
createWindow with visible=false does not create a hidden window #1081
Comments
@bryphe I suspect the solution is to expose the SDL_WINDOWFLAGS to the Sdl2.Window.create call in Window.re I'm happy to take this on, although I expect I'll need some help since there's some C plumbing I'm not immediately familiar with :) |
Hi @Ragnar-H , Thanks for logging the issue and all the details! This would certainly be a nice improvement - it can help reduce flicker when starting up apps to start them hidden, and then show them once everything has been loaded / setup. The simplest fix would probably be to add a flag here: revery/packages/reason-sdl2/src/sdl2_wrapper.cpp Line 1574 in 9ec44ff
These places would also need to be updated:
(and then, validating that the window can be shown after being hidden is important - I think the current A larger, but more flexible, fix would be as you suggested - expose the SDL_WINDOWFLAGS as something we can build and pass from Reason to the C stubs. We have the flags hard-coded here: revery/packages/reason-sdl2/src/sdl2_wrapper.cpp Line 1641 in 9ec44ff
One idea would be to pass a
Hope that helps give some ideas! |
Thanks @bryphe! My time contributing to OSS is very sporadic but let's see if I can get to this :) I'll drop a comment if I start digging into this. If anyone else is reading this and is missing the functionality feel free to jump on this 🤝 |
I'm happy to create a dedicated repo for this if that's needed. This can be reproduced in the Examples in this repo which seemed easiest :)
visible=false
into the Examples in this repo - see git diff in above sectionesy @examples run
App window is shown and focused
App window is hidden
In
Window.create
we've got a guard for calling .show() on Sdl2 window however we probably want to pass inSDL_WINDOW_HIDDEN
to theSdl2.Window.create
. I suspect Sdl2 has the sane default of windows being visible.visible, createWindow
The text was updated successfully, but these errors were encountered: