[gnome-builder/wip/gtk4-port] libide/sourceview: fix notify



commit 30c91201c1cecb42a7cbec8b8576b6d6c4be97fc
Author: Christian Hergert <chergert redhat com>
Date:   Mon May 2 12:28:27 2022 -0700

    libide/sourceview: fix notify

 src/libide/sourceview/ide-source-view.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/src/libide/sourceview/ide-source-view.c b/src/libide/sourceview/ide-source-view.c
index 4b4c06851..3f0ea1932 100644
--- a/src/libide/sourceview/ide-source-view.c
+++ b/src/libide/sourceview/ide-source-view.c
@@ -532,8 +532,12 @@ ide_source_view_set_property (GObject      *object,
       break;
 
     case PROP_LINE_HEIGHT:
-      self->line_height = g_value_get_double (value);
-      ide_source_view_update_css (self);
+      if (self->line_height != g_value_get_double (value))
+        {
+          self->line_height = g_value_get_double (value);
+          ide_source_view_update_css (self);
+          g_object_notify_by_pspec (G_OBJECT (self), pspec);
+        }
       break;
 
     default:
@@ -560,28 +564,28 @@ ide_source_view_class_init (IdeSourceViewClass *klass)
                          "Line height",
                          "The line height of all lines",
                          0.5, 10.0, 1.2,
-                         (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+                         (G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS));
 
   properties [PROP_FONT_DESC] =
     g_param_spec_boxed ("font-desc",
                          "Font Description",
                          "The font to use for text within the editor",
                          PANGO_TYPE_FONT_DESCRIPTION,
-                         (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+                         (G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS));
 
   properties [PROP_FONT_SCALE] =
     g_param_spec_int ("font-scale",
                       "Font Scale",
                       "The font scale",
                       G_MININT, G_MAXINT, 0,
-                      (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+                      (G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS));
 
   properties [PROP_ZOOM_LEVEL] =
     g_param_spec_double ("zoom-level",
                          "Zoom Level",
                          "Zoom Level",
                          -G_MAXDOUBLE, G_MAXDOUBLE, 1.0,
-                         (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
+                         (G_PARAM_READABLE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS));
 
   g_object_class_install_properties (object_class, N_PROPS, properties);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]