The program below creates a window that contains a button. When the button is clicked, the window is iconified (minimized). After 3000 milliseconds, the window is supposed to deiconify and raise itself above all other windows. When I run the program in the GNOME desktop environment using wish mywindow.tk, the window iconifies as expected when the button is clicked. However, it does not deiconify and does not raise itself above all other windows after 3 seconds. There are no error messages.
proc doSomething {} {
wm iconify .
after 3000 {
wm deiconify .
raise .
}
}
button .mybutton -text "Click me" -command doSomething
grid .mybutton
What is the cause of the problem? How do I deiconify a window in Tk and raise it above all others when using the GNOME desktop environment?
- Tcl/Tk version: 8.6.13
- GNOME Shell version: 43.6
- I am using GNOME on Xorg instead of GNOME on Wayland.
- OS: Debian 12 bookworm
I managed to deiconify and raise the window above all others by withdrawing the window right before deiconifying it:
According to the Tk documentation for
wm wihdraw: