mirror of
https://github.com/brl/mutter.git
synced 2025-02-16 13:24:09 +00:00
core: Only trigger MetaWorkspace::window-* on toplevel window types
Popups and other override-redirect windows are irrelevant to all listeners of MetaWorkspace::window-*. Ignoring those windows will namely result in less activity on ShellWindowTracker, less ShellApp::windows-changed signal emissions and less AppMenuButton updates. 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/mutter/issues/556
This commit is contained in:
parent
09bab98b1e
commit
d7f799bfaf
@ -372,7 +372,12 @@ meta_workspace_add_window (MetaWorkspace *workspace,
|
||||
meta_workspace_invalidate_work_area (workspace);
|
||||
}
|
||||
|
||||
g_signal_emit (workspace, signals[WINDOW_ADDED], 0, window);
|
||||
if (window->type == META_WINDOW_NORMAL ||
|
||||
window->type == META_WINDOW_DIALOG ||
|
||||
window->type == META_WINDOW_MODAL_DIALOG ||
|
||||
window->type == META_WINDOW_UTILITY)
|
||||
g_signal_emit (workspace, signals[WINDOW_ADDED], 0, window);
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (workspace), obj_props[PROP_N_WINDOWS]);
|
||||
}
|
||||
|
||||
@ -393,7 +398,12 @@ meta_workspace_remove_window (MetaWorkspace *workspace,
|
||||
meta_workspace_invalidate_work_area (workspace);
|
||||
}
|
||||
|
||||
g_signal_emit (workspace, signals[WINDOW_REMOVED], 0, window);
|
||||
if (window->type == META_WINDOW_NORMAL ||
|
||||
window->type == META_WINDOW_DIALOG ||
|
||||
window->type == META_WINDOW_MODAL_DIALOG ||
|
||||
window->type == META_WINDOW_UTILITY)
|
||||
g_signal_emit (workspace, signals[WINDOW_REMOVED], 0, window);
|
||||
|
||||
g_object_notify (G_OBJECT (workspace), "n-windows");
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user