Show/Hide Window Programmatically#2191
Conversation
|
Seems to still work well with all of the new code changes that have been going on. |
|
Thanks, I used your code.
|
What version of Windows are you trying to run it on? Maybe it is being treated differently. I've tested it on Windows 10. How did you try to show the window? When I spawn a thread and run I will implement |
|
"An application cannot force a window to the foreground while the user is working with another window. Instead, Windows flashes the taskbar button of the window to notify the user. " here |
|
I've added SetForegroundWindow, and everything should be up to date with master. |
|
Really sorry this has been sitting for so long. Please merge |
|
Synced with master. |
xStrom
left a comment
There was a problem hiding this comment.
This looks reasonable, thanks for your effort!
This pull request closes issue #2089.
You can now hide and show a window programmatically. This is done by a new hide() method on WindowHandle, and by a new command Selector called
HIDE_WINDOW. This has been implemented on the x11, GTK+, Windows, and macOS backends. Wayland does not yet seem to support hiding/showing windows through their own protocol, and window managers seem to be currently just falling back to the x11 protocol, so Wayland implementation was held off.HIDE_WINDOWleaves the macOS onlyHIDE_APPLICATIONSelector alone in thatHIDE_WINDOWdoes what it says, and only hides a specific window.The Window can be shown again by the command
SHOW_WINDOWwhich calls the WindowHandle's bring_to_front_and_focus method, which still works as intended when the window is already shown, but when it is hidden, it shows the window again, and brings it to the front and focuses it.