How to get a list of open windows

I’m writing my first application and I’m trying to get a list of open windows on the system. What’s the best way to do that?

Thanks

It depends on the protocol the desktop environment is based on. If you are on Wayland, you should check out the window manager API (which are a lot in number and you need to cover those you expect your users to be).

On X11, you can use : GdkX11.X11Screen - Classes - GdkX11 3.0

GTK can only give you the list of windows you created in your application.

If you want the list of windows currently displayed, you have to ask the window manager—and that typically means writing a GNOME Shell extension, not an application.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.