-
Notifications
You must be signed in to change notification settings - Fork 209
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
Focus for Mac Window #7
Comments
Hi Markus, Yes, this is happening. I would appreciate any patch or code snippet demonstrating how to reset the focus. |
For example, with SDL2, you should be able to call SDL_GetWindowWMInfo(), which returns an SDL_SysWMinfo union. https://wiki.libsdl.org/SDL_SysWMinfo From there, you can get the NSWindow, from which you can call makeKeyAndOrderFront on. While I don't want to add an explicit SDL or windowing dependency, I would be happy to accept a code snippet into docs if this works for you. |
Strange thing is, I tried this and it never worked to set the Focus back via Cocoa API calls. I always had to click on the Window. This may be some kind of conflict of SDL2 powered OpenGL windows with Cocoa. Anyway, it has been some time since I tried to get it to work last time, will retry it in the next days and will let you know.
|
same issue here. My simple solution is:
and
that's it |
That sounds promising! Markus, can you try this and report back? |
Yes, works fine, thanks velkyel. My issue was that I used the NSWindow supplied by SDL_SysWMinfo which is definitely not working for some reason. Can only imagine it is a bug in SDL2. Thanks everybody for the help on this. |
Thanks, everyone! I am going to update the project as soon as I have time! The issue will be closed then. |
Big refactor Added proper Result type No unwrapping inside the open dialog functions. It now returns a correct restult type instead Added the nfd sources that is built using the gcc crate instead of having the user compile the code manually Added DialogBuilder to make it nicer to construct dialogs with filters and paths Added builder_open_jpg example which uses the builder code and only allows for opening of jpg files Fixed issue focus issue for Mac dialogs: Outlined here mlabbe/nativefiledialog#7 Support for multi open + example
Okay! This fix has finally been merged into master! |
* master: (28 commits) Issue mlabbe#7 focus for Mac Window fix docs dummy change, test autobuild dummy change, test autobuild fix xcode build update docs re: mingw fix rel paths Add mingw/msys support don't run premake! docs docs docsdocs docs docs premake5 comment new autobuilt delete old premade premake5 dist update readme check in premake5 dist projects ...
Hi,
first of all thanks for the great work on the Native File Requester. We use it on www.visualgraphics.tv for multi os file requesters for the Desktops.
We have one issue which may not be yours. Under Mac / Cocoa we never succeed in setting the focus back to the SDL2 OpenGL Window after a Dialog was open. Resulting that the user has to select the main window once before being able to continue work.
Did you see this behavior too ?
Thanks again,
Markus
The text was updated successfully, but these errors were encountered: