From 42953a50bbe5bd7f6318c6a9f6a588a874392094 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Thu, 28 Feb 2019 23:02:59 +0100 Subject: [PATCH] stage: Queue redraw previous Rect only if it has changed No need to queue redraw the same area multiple times, so we can avoid the computation involved with it. https://gitlab.gnome.org/GNOME/mutter/merge_requests/3 --- src/backends/meta-stage.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/backends/meta-stage.c b/src/backends/meta-stage.c index 425926a7c..1f0d9c050 100644 --- a/src/backends/meta-stage.c +++ b/src/backends/meta-stage.c @@ -123,8 +123,11 @@ meta_overlay_paint (MetaOverlay *overlay) (overlay->current_rect.origin.y + overlay->current_rect.size.height)); - overlay->previous_rect = overlay->current_rect; - overlay->previous_is_valid = TRUE; + if (!clutter_rect_equals (&overlay->previous_rect, &overlay->current_rect)) + { + overlay->previous_rect = overlay->current_rect; + overlay->previous_is_valid = TRUE; + } } static void