[gtk/4.0-backports: 34/53] css: Fix shadow value equal
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/4.0-backports: 34/53] css: Fix shadow value equal
- Date: Sun, 7 Feb 2021 17:49:41 +0000 (UTC)
commit 7af9d1fe3d8550a3c8c42a28218b8e85fb94ba6a
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Feb 3 11:21:23 2021 -0500
css: Fix shadow value equal
This function was not doing the right thing.
Once we are doing the right thing and not compare
shadows as unequal, some reftests that inhibit
snapshots for a few frames now hang forever, since
we are no more redrawing unnecessarily. Fix that
with an explicit queue_draw.
gtk/gtkcssshadowvalue.c | 10 +++++-----
testsuite/reftests/frame-inhibitor.c | 1 +
2 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtkcssshadowvalue.c b/gtk/gtkcssshadowvalue.c
index 0429c44be6..8171545149 100644
--- a/gtk/gtkcssshadowvalue.c
+++ b/gtk/gtkcssshadowvalue.c
@@ -152,11 +152,11 @@ gtk_css_value_shadow_equal (const GtkCssValue *value1,
const ShadowValue *shadow2 = &value2->shadows[i];
if (shadow1->inset != shadow2->inset ||
- _gtk_css_value_equal (shadow1->hoffset, shadow2->hoffset) ||
- _gtk_css_value_equal (shadow1->voffset, shadow2->voffset) ||
- _gtk_css_value_equal (shadow1->radius, shadow2->radius) ||
- _gtk_css_value_equal (shadow1->spread, shadow2->spread) ||
- _gtk_css_value_equal (shadow1->color, shadow2->color))
+ !_gtk_css_value_equal (shadow1->hoffset, shadow2->hoffset) ||
+ !_gtk_css_value_equal (shadow1->voffset, shadow2->voffset) ||
+ !_gtk_css_value_equal (shadow1->radius, shadow2->radius) ||
+ !_gtk_css_value_equal (shadow1->spread, shadow2->spread) ||
+ !_gtk_css_value_equal (shadow1->color, shadow2->color))
return FALSE;
}
diff --git a/testsuite/reftests/frame-inhibitor.c b/testsuite/reftests/frame-inhibitor.c
index 567dc07ae1..9d699c4224 100644
--- a/testsuite/reftests/frame-inhibitor.c
+++ b/testsuite/reftests/frame-inhibitor.c
@@ -30,6 +30,7 @@ tick_callback_for_1_frame (GtkWidget *widget,
gpointer unused)
{
reftest_uninhibit_snapshot ();
+ gtk_widget_queue_draw (widget);
return G_SOURCE_REMOVE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]