Set tkinter top-level window to "always on visible workspace"

Skip Montanaro skip.montanaro at gmail.com
Tue Mar 29 17:28:24 EDT 2022


> Also, wmctrl accepts window names instead of ids if you omit the -i
> option. In case winfo_id() is not returning the id you need.

Nice. That worked. FWIW, Tk never gave me the very outermost window as the
parent of the tkinter.Tk instance. Here's the start of hierarchy:

% xwininfo -tree

xwininfo: Please select the window about which you
          would like information by clicking the
          mouse in that window.

xwininfo: Window id: 0x5a0001f "Typing Watcher"

  Root window id: 0x7a2 (the root window) (has no name)
  Parent window id: 0xc73880 (has no name)
     1 child:
     0x5a0001e (has no name): ()  178x126+0+0  +2+43
        1 child:
        0x5a00020 (has no name): ()  178x126+0+0  +2+43
           5 children:
    ...

Tk thought 0x5a0001e was the top, but as you can see 0x5a0001f is the named
window. Calling wmctrl using "Typing Watcher" as the target window did the
trick.

Thanks,

Skip


More information about the Python-list mailing list