[mutter] compositor: Only disconnect/connect top-window signals if it changed
- From: Marco Trevisan <marcotrevi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] compositor: Only disconnect/connect top-window signals if it changed
- Date: Fri, 28 Jun 2019 17:44:06 +0000 (UTC)
commit 7645c51c5408678e2b48ac61efefcbdf5a24b6ee
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date: Thu Jun 13 10:37:28 2019 +0200
compositor: Only disconnect/connect top-window signals if it changed
If the stack changed but the top window didn't, there's no need to disconnect
the signal and connect it again.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/660
src/compositor/compositor.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c
index d6c9f90f1..95a1de8ea 100644
--- a/src/compositor/compositor.c
+++ b/src/compositor/compositor.c
@@ -1034,6 +1034,7 @@ void
meta_compositor_sync_stack (MetaCompositor *compositor,
GList *stack)
{
+ MetaWindowActor *top_window_actor;
GList *old_stack;
/* This is painful because hidden windows that we are in the process
@@ -1117,12 +1118,17 @@ meta_compositor_sync_stack (MetaCompositor *compositor,
sync_actor_stacking (compositor);
+ top_window_actor = get_top_visible_window_actor (compositor);
+
+ if (compositor->top_window_actor == top_window_actor)
+ return;
+
if (compositor->top_window_actor)
g_signal_handlers_disconnect_by_func (compositor->top_window_actor,
on_top_window_actor_destroyed,
compositor);
- compositor->top_window_actor = get_top_visible_window_actor (compositor);
+ compositor->top_window_actor = top_window_actor;
if (compositor->top_window_actor)
g_signal_connect (compositor->top_window_actor, "destroy",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]