SFML community forums
General => Feature requests => Topic started by: Mario on December 30, 2011, 12:16:10 pm
-
This is something I noticed lately. There doesn't seem to be any direct way to determine if some window is the active window or not (i.e. if it's focused) yet. This is partially exposed through SFML's event handling, but I really think this should be added as sf::Window members:
bool sf::Window::HasFocus(void);
void sf::Window::GetFocus(void);
While above might suggest something different, I agree, windows shouldn't bring themself on top on their own at an time, but that's actually something that should be handled by the OS anyway. I.e. under Windows the second call listed above should trigger the task bar entry of the window to be highlighted and/or flashing. In a similar way on Ubuntu the icon would shake (if I'm not mistaken), etc. without stealing focus of the active window (unless you just started the program).
-
It won't be done for SFML 2.0, but I think it's worth adding a ticket to the task tracker. It's not the first time that focus issues are discussed.
-
This isn't present in SFML 2.1, but is still, I believe, a feature that should be added.
-
Seems like the ticket got never created. Not sure what Laurent's opinion on the topic is currently though.
I'd see a "hasFocus" function to be useful since there are ways where the window doesn't have the focus from the beginning.
-
I'd see a "hasFocus" function to be useful since there are ways where the window doesn't have the focus from the beginning.
I agree. If there is a way to implement hasFocus() other than just tracking the focus events, it will definitely be worth a dedicated function.
-
This now has an issue on the tracker: https://github.com/SFML/SFML/issues/518