开发者

Find all open windows for a process in GTK

Is 开发者_StackOverflow社区there anyway in GTK to get all of the current windows open by a specific process? Ideally, I'd like to be able to get the GtkWindow instances. I know Java AWT has this:

java.awt.Window[] windows = java.awt.Window.getWindows();

And Microsoft's UI Automation also has a way to get all of the windows for an application. Is there anyway to do this with GTK?

I found a function gtk_window_list_toplevels, but it seems to return way too many windows. The application gedit has 30 top-level windows on my computer. That just seems to be too many for an application with one window.


gtk_window_list_toplevels() gives you only the windows from your process, but that includes hidden windows. So if you list the toplevel windows of an application like Gedit, you are likely to get lots of hidden preferences windows, search dialogs, and probably lots of other windows related to the many plugins. Try it out first with a simple one-window application that you wrote yourself, and you will find that it only returns the main window.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜