[gnome-shell/wip/carlosg/shell-app-ignore-popups: 138/138] shell: Ignore non-toplevels for ShellWindowTracker::tracked-windows-changed
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/carlosg/shell-app-ignore-popups: 138/138] shell: Ignore non-toplevels for ShellWindowTracker::tracked-windows-changed
- Date: Wed, 21 Aug 2019 16:46:24 +0000 (UTC)
commit c63721688a5d9f3fadf8d6b5a08f6f438279e512
Author: Carlos Garnacho <carlosg gnome org>
Date: Fri Jul 19 18:17:54 2019 +0200
shell: Ignore non-toplevels for ShellWindowTracker::tracked-windows-changed
Popups and other override-redirect windows are meaningless to everything
that depends on the ShellWindowTracker. Ignoring those windows will result
in less ShellApp::windows-changed signal emissions, and less activity in
the AppMenuButton and everything else that depends on them.
Reduces gnome-shell CPU activity while typing on the Epiphany addressbar,
as the pop up animation there results in a number of xdg_popup being
created and destroyed.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/642
https://gitlab.gnome.org/GNOME/mutter/issues/556
src/shell-window-tracker.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/shell-window-tracker.c b/src/shell-window-tracker.c
index 9ad8ecfbae..075cb2a164 100644
--- a/src/shell-window-tracker.c
+++ b/src/shell-window-tracker.c
@@ -535,12 +535,17 @@ track_window (ShellWindowTracker *self,
static void
shell_window_tracker_on_window_added (MetaWorkspace *workspace,
- MetaWindow *window,
- gpointer user_data)
+ MetaWindow *window,
+ gpointer user_data)
{
ShellWindowTracker *self = SHELL_WINDOW_TRACKER (user_data);
+ MetaWindowType window_type = meta_window_get_window_type (window);
- track_window (self, window);
+ if (window_type == META_WINDOW_NORMAL ||
+ window_type == META_WINDOW_DIALOG ||
+ window_type == META_WINDOW_UTILITY ||
+ window_type == META_WINDOW_MODAL_DIALOG)
+ track_window (self, window);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]