Wnck.Window.get(xid).get_application().get_n_windows() returns 1 even the app has multiple windows
I'm using Python to get the number of windows of an app. But I found that I only get the value 1, even the app has 3 windows in my case.
def count_windows(xid: int) -> int: screen: Wnck.Screen = Wnck.Screen.get_default() screen.force_update() window: Wnck.Window = Wnck.Window.get(xid) app: Wnck.Application = window.get_application() return app.get_n_windows()
I've debugged. It seems like each window has their own Wnck.Application instance, so that their Wnck.Application instance has a window of course. And each
app.get_name() has their different names too.
But this is quite hard to understand. I believe the result must be wrong. It, which is the rerult of the method
app.get_n_windows(), can't be 1 but should be 3.
Is this some kinds of limitation on libwnck?
Please provide any information to me in case that I've missed something.
Thank you very very much!