ayatana-commits team mailing list archive
-
ayatana-commits team
-
Mailing list archive
-
Message #02251
[Merge] lp:~ted/indicator-appmenu/dialogs-as-desktop into lp:indicator-appmenu
Ted Gould has proposed merging lp:~ted/indicator-appmenu/dialogs-as-desktop into lp:indicator-appmenu.
Requested reviews:
Indicator Applet Developers (indicator-applet-developers)
Disables user_visible which doesn't really do what we want. It tracks things in the task list, which excludes about dialogs.
--
https://code.launchpad.net/~ted/indicator-appmenu/dialogs-as-desktop/+merge/34816
Your team ayatana-commits is subscribed to branch lp:indicator-appmenu.
=== modified file 'src/indicator-appmenu.c'
--- src/indicator-appmenu.c 2010-09-03 19:25:04 +0000
+++ src/indicator-appmenu.c 2010-09-07 22:17:39 +0000
@@ -825,9 +825,15 @@
if (newview != NULL) {
window = BAMF_WINDOW(newview);
+ if (window == NULL) {
+ g_warning("Active window changed to View thats not a window.");
+ }
+ } else {
+ g_debug("Active window is: NULL");
}
if (window != NULL && bamf_window_get_window_type(window) == BAMF_WINDOW_DESKTOP) {
+ g_debug("Switched to window with a type of 'desktop'");
window = NULL;
}
@@ -837,25 +843,27 @@
guint32 xid = 0;
while (window != NULL && menus == NULL) {
- if (!bamf_view_user_visible(BAMF_VIEW(window))) {
- window = NULL;
- }
-
xid = bamf_window_get_xid(window);
menus = g_hash_table_lookup(appmenu->apps, GUINT_TO_POINTER(xid));
if (menus == NULL) {
+ g_debug("Looking for parent window on XID %d", xid);
window = bamf_window_get_transient(window);
}
}
- g_debug("Switching to windows from XID %d", xid);
-
- /* Note: This function can handle menus being NULL */
- if (xid == 0) {
+ if (window == NULL && menus == NULL) {
+ /* If in the end, we didn't have a window that we got the
+ menus from, well, okay. Let's just say there isn't a
+ window and now menus. */
+ g_debug("Switching to menus from desktop");
switch_default_app(appmenu, NULL, NULL);
} else {
+ /* Note: We're not using window here, but re-casting the
+ newwindow variable. Which means we stay where we were
+ but get the menus from parents. */
+ g_debug("Switching to menus from XID %d", xid);
switch_default_app(appmenu, menus, BAMF_WINDOW(newview));
}
Follow ups