Setting focus to secondary window #1974
Replies: 2 comments
-
Okay so done a bit more testing, found that the second window does keep focus without needing to call it with a SetFocus() (windows.h) or similar, however it ignores the first input from keeb/mouse after launching the new window, this only occurs when closing the original window (the one calling the change in reso and then closing) though. |
Beta Was this translation helpful? Give feedback.
-
Good luck GLFW isn't that great with that. It loses track in some cases with the actual OS resolution. I haven't gotten to the bottom of that but I mentioned it in a few messages @ RayLib and it's basically not something anyone can answer you on. |
Beta Was this translation helpful? Give feedback.
-
So just as an intro:
I'm trying to implement the ability to change between preset resolutions in an app.
Currently I'm achieving this by selecting the appropriate resolution, changing the window height/width, closing the window and initializing a new one in the same state as the original one.
This is working for me but there's a rub, the new Window isn't receiving focus, and though the UI elements are present I have to click into the window before it will receive subsequent input.
One (potential) fix would be to implement the enumerator for the focus window flag in raylib.h, but I'm not sure what it is or where to find that it, google and docs.microsoft haven't been super helpful, probably cause my keywords are so generic.
The other would be to
#include <windows.h>
, but this seems to create issues with the include for raylib.hI will admit it's been a hot second since I did any C/C++/C# work so I'm probably just dumbing it up on this one.
Any thoughts, opinions or feedback are welcome.
Beta Was this translation helpful? Give feedback.
All reactions