Getting visible windows on x11

I know this question might have been asked lots of times... and I did my homework, couldn't find anything that help or give an answer that directly answers it.

I'm building an application on x11 or say for linux that works with the display environment, am at this juncture where I need to know visible window on the screen, I have tried VisibilityNotify event, which was supposed to be my best solution but doesn't work as expected, the recent option was something about the stacking order... z order, but I couldn't find a way to manipulate that too.

Anybody with any idea... any at all... am up for exploring. Thanks

Hi @tobytobias,

I guess you can get minimized vs non-minimized some way. But that won't do anything for a window that both non-minimized and totally covered by another non-minimized window. :face_with_diagonal_mouth:

Have you taken into account the visible screen being smaller than the logical screen? This used to be very common when I started using X11 20+ years ago.

Then there are different desktops to consider.

I honestly don't have any idea where to start.

Can you please give us a clue as to which operating system and which version?

Also, was X11 installed as part of the distro or did you install X11 manually later?

@tobytobias , in addition to point/q's raised by other teammates, your code (or the relevant bits)) would be of benefit (to me at least)

1 Like

I apologize for coming late at this... I've been able to resolve the issue by using the list_stacking_ other, do some rectangular calculations with the dimensions to know when they overlap and when one is visible and by how much.

I initially was writing my solution in Go but I had to use Python (a solution from a friend), because the geometry that comes from xproto has something like a padding, it more than the actual rectangle of the window. My friend, had to use a solution with gtl and Wnck from Python.