libwnck can list top-level windows with functions like
Code:
GList * wnck_application_get_windows (WnckApplication *app)
GList * wnck_screen_get_windows_stacked (WnckScreen *screen)
which return GLists of WnckWindows. I can also use
Code:
WnckWindowType wnck_window_get_window_type (WnckWindow *window)
to get the WnckWindowType. These show that libwnck can get lists of windows, and find their type.
Now, there is a type of WnckWindow called WNCK_WINDOW_MENU. However, when I use the functions above, it sees top-level windows only. For example, when I run this function:
Code:
void check_windows_by_app (WnckApplication *app)
{
GList *l, *windows = wnck_application_get_windows(app);
for (l = windows; l != NULL; l = l->next) {
gpointer element_data = l->data;
WnckWindowType win_type;
win_type = wnck_window_get_window_type(element_data);
g_print ("\nWindow type: %u\n\b",win_type);
}
}
It shows that the list only contains WnckWindows of types WNCK_WINDOW_NORMAL and WNCK_WINDOW_DESKTOP.
All the windows in the list, except the desktop had menus. They were application windows like Caja, Pluma, Banshee, etc. However, the menus were not shown to be included in the list, because it did not print out any WNCK_WINDOW_MENU type.
I verified this from
https://developer.gnome.org/libwnck/...WnckWindowType and from telling it to print out each type individually, along with its decimal-equivalent number next to it. The results were:
Code:
WNCK_WINDOW_NORMAL: 0
WNCK_WINDOW_DESKTOP: 1
WNCK_WINDOW_DOCK: 2
WNCK_WINDOW_DIALOG: 3
WNCK_WINDOW_TOOLBAR: 4
WNCK_WINDOW_MENU: 5
WNCK_WINDOW_UTILITY: 6
WNCK_WINDOW_SPLASHSCREEN: 7
Now, to show that the list doesn't contain anything but normal and desktop, I'll paste the output from the function. The lines with text were printed from the function that called the top function:
Code:
Active window changed.
----------------------
Previously active window: wnck_window types (~/Desktop/VBox files) - Pluma
Previously active app: Pluma
New active window: Documents
New active app: Caja
Window type: 0
Window type: 0
Window type: 0
Window type: 0
Window type: 1
Active window changed.
----------------------
Previously active window: Documents
Previously active app: Caja
New active window: wnck_window types (~/Desktop/VBox files) - Pluma
New active app: Pluma
Window type: 0
Active window changed.
----------------------
Previously active window: wnck_window types (~/Desktop/VBox files) - Pluma
Previously active app: Pluma
New active window: x-caja-desktop
New active app: Caja
Window type: 0
Window type: 0
Window type: 0
Window type: 0
Window type: 1
You can see that when I make a Caja window the active window, it lists all the instances of it being open, including the desktop "1".
It only shows 2 types of WnckWindows. What good is the menu type if it's not detected by the functions? How can I make it find menu windows? And is there a way for libwnck to search trees to find windows? Thanks