francisco@Ubuntu:~$ wmctrl -l
0x02600006 0 Ubuntu Área de trabalho
0x03c00002 0 Ubuntu XdndCollectionWindowImp
0x03c00005 0 Ubuntu unity-launcher
0x03c00008 0 Ubuntu unity-panel
0x03c0000b 0 Ubuntu unity-dash
0x03c0000c 0 Ubuntu Hud
0x046000b3 0 Ubuntu How to make a window aways on top? - Stack Overflow - Mozilla Firefox
0x0520000b 0 N/A Qt Creator
0x05002396 0 Ubuntu francisco@Ubuntu: ~
0x0540000b 0 N/A backlight
For windows that have the machine name column as N/A
I'm unable to send wmctrl
commands like wmctrl -r "window name" -b add,above
. Why? (also, I don't know why these windows are different regarding the machine name column...)
My initial intent was to send such command to the backlight
window, a frameless Qt application. Using the window system menu and checking the "Always On Top" works for the window though. I just like a programmatic means of doing the same.
it's definitely a bug in
wmctrl
.after digging around wmctrl code, it seems that the bug is in translating window name strings to the corresponding Window ID (or XID). so
wmctrl -r "window name" -b add,above
is not reliable.as a workaround, use XID instead, i.e.
wmctrl -i -r window_id -b add,above
. in your case ,wmctrl -i -r 0x0520000b -b add,above
should work.most window management facilities are implemented as X window Properties. you can view all the properties of a window by a command
-- xprop
.NOTE:
Windows that have the machine name column as N/A. the machine name property is
WM_CLIENT_MACHINE
. it's rarely used. and some GUI toolkits may not implement them.you can view a window's machine name property by run following command line and click the window
As for Always On Top, it's another property value
_NET_WM_STATE_ABOVE
.to check it yourself, run following command line and click the window