static void update_focus_app (ShellWindowTracker *self) { MetaWindow *new_focus_win; ShellApp *new_focus_app; new_focus_win = meta_display_get_focus_window (shell_global_get_display (shell_global_get ())); /* we only consider an app focused if the focus window can be clearly * associated with a running app; this is the case if the focus window * or one of its parents is visible in the taskbar, e.g. * - 'nautilus' should appear focused when its about dialog has focus * - 'nautilus' should not appear focused when the DESKTOP has focus */ while (new_focus_win && meta_window_is_skip_taskbar (new_focus_win)) new_focus_win = meta_window_get_transient_for (new_focus_win); new_focus_app = new_focus_win ? shell_window_tracker_get_window_app (self, new_focus_win) : NULL; if (new_focus_app) { shell_app_update_window_actions (new_focus_app, new_focus_win); shell_app_update_app_menu (new_focus_app, new_focus_win); } set_focus_app (self, new_focus_app); }
/** * shell_window_tracker_is_window_interesting: * * The ShellWindowTracker associates certain kinds of windows with * applications; however, others we don't want to * appear in places where we want to give a list of windows * for an application, such as the alt-tab dialog. * * An example of a window we don't want to show is the root * desktop window. We skip all override-redirect types, and also * exclude other window types like tooltip explicitly, though generally * most of these should be override-redirect. * * Returns: %TRUE iff a window is "interesting" */ gboolean shell_window_tracker_is_window_interesting (MetaWindow *window) { if (meta_window_is_override_redirect (window) || meta_window_is_skip_taskbar (window)) return FALSE; switch (meta_window_get_window_type (window)) { /* Definitely ignore these. */ case META_WINDOW_DESKTOP: case META_WINDOW_DOCK: case META_WINDOW_SPLASHSCREEN: /* Should have already been handled by override_redirect above, * but explicitly list here so we get the "unhandled enum" * warning if in the future anything is added.*/ case META_WINDOW_DROPDOWN_MENU: case META_WINDOW_POPUP_MENU: case META_WINDOW_TOOLTIP: case META_WINDOW_NOTIFICATION: case META_WINDOW_COMBO: case META_WINDOW_DND: case META_WINDOW_OVERRIDE_OTHER: return FALSE; case META_WINDOW_NORMAL: case META_WINDOW_DIALOG: case META_WINDOW_MODAL_DIALOG: case META_WINDOW_MENU: case META_WINDOW_TOOLBAR: case META_WINDOW_UTILITY: break; } return TRUE; }
/** * shell_window_tracker_is_window_interesting: * * The ShellWindowTracker associates certain kinds of windows with * applications; however, others we don't want to * appear in places where we want to give a list of windows * for an application, such as the alt-tab dialog. * * An example of a window we don't want to show is the root * desktop window. We skip all override-redirect types, and also * exclude other window types like tooltip explicitly, though generally * most of these should be override-redirect. * Side component windows are considered interesting so they can be handled * by the window manager. * * Returns: %TRUE iff a window is "interesting" */ gboolean shell_window_tracker_is_window_interesting (MetaWindow *window) { if (g_strcmp0 (meta_window_get_role (window), SIDE_COMPONENT_ROLE) == 0) return TRUE; if (meta_window_is_skip_taskbar (window)) return FALSE; /* HACK: see https://github.com/endlessm/eos-shell/issues/548 and * https://github.com/linuxmint/Cinnamon/issues/728 */ if (g_strcmp0 (meta_window_get_title (window), "JavaEmbeddedFrame") == 0) return FALSE; return TRUE; }
/** * shell_window_tracker_is_window_interesting: * * The ShellWindowTracker associates certain kinds of windows with * applications; however, others we don't want to * appear in places where we want to give a list of windows * for an application, such as the alt-tab dialog. * * An example of a window we don't want to show is the root * desktop window. We skip all override-redirect types, and also * exclude other window types like tooltip explicitly, though generally * most of these should be override-redirect. * * Returns: %TRUE iff a window is "interesting" */ gboolean shell_window_tracker_is_window_interesting (MetaWindow *window) { return !meta_window_is_skip_taskbar (window); }