Disclaimer: I know there is a very similar question on this topic.
I am trying to get exactly the same result that NoozNooz42 described here. However mdma answer doesn't fit my needs, because I'm interested in doing the same on linux. Preferrably with gnome, if it matters. So using JNA with user32 library is not a option here (or is it?).
Any suggestions will be great, I couldn't find almost anything on the topic.
P.S. The only thing I have found is wmctrl command (I could call and parse it in java eventually) that lists windows but doesn't give me any information about the z-order.
Update: It would be perfect if I could get a notification/callback when the z-order changes.
For Linux Mint 18 Sarah ,< ctrl+alt+down-key > worked to display all the open windows in the current desktop. To view all the windows in all the desktops, use < ctrl+ alr+ up-key >.
wmctrl is a command used to control windows in EWMH- and NetWM-compatible X Window window managers. Some of its common operations are list, resize, and close window. It also has the ability to interact with virtual desktops and give information about the window manager.
Use xprop, it shows window properties. List of windows in z-order is in property _NET_CLIENT_LIST_STACKING
of the root window:
xprop -root | grep '_NET_CLIENT_LIST_STACKING(WINDOW)'
Output should look like this:
_NET_CLIENT_LIST_STACKING(WINDOW): window id # 0x2000003, 0x4000004,
0x1c00004, 0x1c00030, 0x1c00033, 0x2e00004
Later you can get more info about particular windows with:
xprop -id <id>
or
xwininfo -id <id>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With