[gnome-shell] st: Specify G_PARAM_EXPLICIT_NOTIFY where appropriate



commit 5a23c96bd918e11609c1eb9856ea12c78ae7f5e1
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed Feb 9 13:59:15 2022 +0100

    st: Specify G_PARAM_EXPLICIT_NOTIFY where appropriate
    
    We are now consistently calling notify() when a property does change.
    
    With that we can opt out of g_object_set()'s implicit change notifications,
    so that notify is only emitted when a property *actually* changes.
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2168>

 src/st/st-adjustment.c       |  3 ++-
 src/st/st-bin.c              |  2 +-
 src/st/st-box-layout.c       |  2 +-
 src/st/st-button.c           |  8 ++++----
 src/st/st-entry.c            | 14 +++++++-------
 src/st/st-icon.c             | 10 +++++-----
 src/st/st-label.c            |  2 +-
 src/st/st-password-entry.c   |  4 ++--
 src/st/st-scroll-bar.c       |  4 ++--
 src/st/st-scroll-view-fade.c |  6 +++---
 src/st/st-scroll-view.c      | 10 +++++-----
 src/st/st-scrollable.c       |  4 ++--
 src/st/st-settings.c         |  2 +-
 src/st/st-theme-context.c    |  2 +-
 src/st/st-widget.c           | 18 +++++++++---------
 15 files changed, 46 insertions(+), 45 deletions(-)
---
diff --git a/src/st/st-adjustment.c b/src/st/st-adjustment.c
index 28ab78e41b..d2baa660ee 100644
--- a/src/st/st-adjustment.c
+++ b/src/st/st-adjustment.c
@@ -302,7 +302,8 @@ st_adjustment_class_init (StAdjustmentClass *klass)
   props[PROP_ACTOR] =
     g_param_spec_object ("actor", "Actor", "Actor",
                          CLUTTER_TYPE_ACTOR,
-                         ST_PARAM_READWRITE);
+                         ST_PARAM_READWRITE |
+                         G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StAdjustment:lower:
diff --git a/src/st/st-bin.c b/src/st/st-bin.c
index e96768626f..9d86ea2336 100644
--- a/src/st/st-bin.c
+++ b/src/st/st-bin.c
@@ -312,7 +312,7 @@ st_bin_class_init (StBinClass *klass)
                          "Child",
                          "The child of the Bin",
                          CLUTTER_TYPE_ACTOR,
-                         ST_PARAM_READWRITE);
+                         ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   g_object_class_install_properties (gobject_class, N_PROPS, props);
 }
diff --git a/src/st/st-box-layout.c b/src/st/st-box-layout.c
index 269ded4120..990fb9ed6e 100644
--- a/src/st/st-box-layout.c
+++ b/src/st/st-box-layout.c
@@ -191,7 +191,7 @@ st_box_layout_class_init (StBoxLayoutClass *klass)
                           "Whether the layout should be vertical, rather"
                           "than horizontal",
                           FALSE,
-                          ST_PARAM_READWRITE);
+                          ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StBoxLayout:pack-start:
diff --git a/src/st/st-button.c b/src/st/st-button.c
index df0148bc69..0e95bfaf09 100644
--- a/src/st/st-button.c
+++ b/src/st/st-button.c
@@ -488,7 +488,7 @@ st_button_class_init (StButtonClass *klass)
                          "Label",
                          "Label of the button",
                          NULL,
-                         ST_PARAM_READWRITE);
+                         ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StButton:button-mask:
@@ -500,7 +500,7 @@ st_button_class_init (StButtonClass *klass)
                         "Button mask",
                         "Which buttons trigger the 'clicked' signal",
                         ST_TYPE_BUTTON_MASK, ST_BUTTON_ONE,
-                        ST_PARAM_READWRITE);
+                        ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StButton:toggle-mode:
@@ -512,7 +512,7 @@ st_button_class_init (StButtonClass *klass)
                           "Toggle Mode",
                           "Enable or disable toggling",
                           FALSE,
-                          ST_PARAM_READWRITE);
+                          ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StButton:checked:
@@ -528,7 +528,7 @@ st_button_class_init (StButtonClass *klass)
                           "Checked",
                           "Indicates if a toggle button is \"on\" or \"off\"",
                           FALSE,
-                          ST_PARAM_READWRITE);
+                          ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StButton:pressed:
diff --git a/src/st/st-entry.c b/src/st/st-entry.c
index 3a43504070..f8b07d043c 100644
--- a/src/st/st-entry.c
+++ b/src/st/st-entry.c
@@ -903,7 +903,7 @@ st_entry_class_init (StEntryClass *klass)
                          "Primary Icon",
                          "Primary Icon actor",
                          CLUTTER_TYPE_ACTOR,
-                         ST_PARAM_READWRITE);
+                         ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StEntry:secondary-icon:
@@ -915,7 +915,7 @@ st_entry_class_init (StEntryClass *klass)
                          "Secondary Icon",
                          "Secondary Icon actor",
                          CLUTTER_TYPE_ACTOR,
-                         ST_PARAM_READWRITE);
+                         ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StEntry:hint-text:
@@ -929,7 +929,7 @@ st_entry_class_init (StEntryClass *klass)
                          "Text to display when the entry is not focused "
                          "and the text property is empty",
                          NULL,
-                         ST_PARAM_READWRITE);
+                         ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StEntry:hint-actor:
@@ -943,7 +943,7 @@ st_entry_class_init (StEntryClass *klass)
                          "An actor to display when the entry is not focused "
                          "and the text property is empty",
                          CLUTTER_TYPE_ACTOR,
-                         ST_PARAM_READWRITE);
+                         ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StEntry:text:
@@ -955,7 +955,7 @@ st_entry_class_init (StEntryClass *klass)
                          "Text",
                          "Text of the entry",
                          NULL,
-                         ST_PARAM_READWRITE);
+                         ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StEntry:input-purpose:
@@ -969,7 +969,7 @@ st_entry_class_init (StEntryClass *klass)
                        "Purpose of the text field",
                        CLUTTER_TYPE_INPUT_CONTENT_PURPOSE,
                        CLUTTER_INPUT_CONTENT_PURPOSE_NORMAL,
-                       ST_PARAM_READWRITE);
+                       ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StEntry:input-hints:
@@ -984,7 +984,7 @@ st_entry_class_init (StEntryClass *klass)
                         "Hints for the text field behaviour",
                         CLUTTER_TYPE_INPUT_CONTENT_HINT_FLAGS,
                         0,
-                        ST_PARAM_READWRITE);
+                        ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   g_object_class_install_properties (gobject_class, N_PROPS, props);
 
diff --git a/src/st/st-icon.c b/src/st/st-icon.c
index 876aa9bbbf..f7586b9471 100644
--- a/src/st/st-icon.c
+++ b/src/st/st-icon.c
@@ -295,7 +295,7 @@ st_icon_class_init (StIconClass *klass)
                          "GIcon",
                          "The GIcon shown by this icon actor",
                          G_TYPE_ICON,
-                         ST_PARAM_READWRITE);
+                         ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StIcon:fallback-gicon:
@@ -307,7 +307,7 @@ st_icon_class_init (StIconClass *klass)
                          "Fallback GIcon",
                          "The fallback GIcon shown if the normal icon fails to load",
                          G_TYPE_ICON,
-                         ST_PARAM_READWRITE);
+                         ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StIcon:icon-name:
@@ -319,7 +319,7 @@ st_icon_class_init (StIconClass *klass)
                          "Icon name",
                          "An icon name",
                          NULL,
-                         ST_PARAM_READWRITE);
+                         ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StIcon:icon-size:
@@ -332,7 +332,7 @@ st_icon_class_init (StIconClass *klass)
                       "Icon size",
                       "The size if the icon, if positive. Otherwise the size will be derived from the 
current style",
                       -1, G_MAXINT, -1,
-                      ST_PARAM_READWRITE);
+                      ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StIcon:fallback-icon-name:
@@ -345,7 +345,7 @@ st_icon_class_init (StIconClass *klass)
                          "Fallback icon name",
                          "A fallback icon name",
                          NULL,
-                         ST_PARAM_READWRITE);
+                         ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   g_object_class_install_properties (object_class, N_PROPS, props);
 }
diff --git a/src/st/st-label.c b/src/st/st-label.c
index 54f16b1550..b4dd8cd56c 100644
--- a/src/st/st-label.c
+++ b/src/st/st-label.c
@@ -296,7 +296,7 @@ st_label_class_init (StLabelClass *klass)
                            "Text",
                            "Text of the label",
                            NULL,
-                           ST_PARAM_READWRITE);
+                           ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   g_object_class_install_properties (gobject_class, N_PROPS, props);
 }
diff --git a/src/st/st-password-entry.c b/src/st/st-password-entry.c
index 89eef42452..43f9b5209f 100644
--- a/src/st/st-password-entry.c
+++ b/src/st/st-password-entry.c
@@ -155,7 +155,7 @@ st_password_entry_class_init (StPasswordEntryClass *klass)
                                                        "Password visible",
                                                        "Whether the text in the entry is masked or not",
                                                        FALSE,
-                                                       ST_PARAM_READWRITE);
+                                                       ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StPasswordEntry:show-peek-icon:
@@ -167,7 +167,7 @@ st_password_entry_class_init (StPasswordEntryClass *klass)
                                                      "Show peek icon",
                                                      "Whether to show the password peek icon",
                                                      TRUE,
-                                                     ST_PARAM_READWRITE);
+                                                     ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   g_object_class_install_properties (gobject_class, N_PROPS, props);
 }
diff --git a/src/st/st-scroll-bar.c b/src/st/st-scroll-bar.c
index 19fe26b5dc..72bcd55540 100644
--- a/src/st/st-scroll-bar.c
+++ b/src/st/st-scroll-bar.c
@@ -534,7 +534,7 @@ st_scroll_bar_class_init (StScrollBarClass *klass)
   props[PROP_ADJUSTMENT] =
     g_param_spec_object ("adjustment", "Adjustment", "The adjustment",
                          ST_TYPE_ADJUSTMENT,
-                         ST_PARAM_READWRITE);
+                         ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StScrollBar:vertical:
@@ -546,7 +546,7 @@ st_scroll_bar_class_init (StScrollBarClass *klass)
                           "Vertical Orientation",
                           "Vertical Orientation",
                           FALSE,
-                          ST_PARAM_READWRITE);
+                          ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   g_object_class_install_properties (object_class, N_PROPS, props);
 
diff --git a/src/st/st-scroll-view-fade.c b/src/st/st-scroll-view-fade.c
index 7dba2df42e..4cf45af1f2 100644
--- a/src/st/st-scroll-view-fade.c
+++ b/src/st/st-scroll-view-fade.c
@@ -415,7 +415,7 @@ st_scroll_view_fade_class_init (StScrollViewFadeClass *klass)
                         "Fade margins",
                         "The margin widths that are faded",
                         CLUTTER_TYPE_MARGIN,
-                        ST_PARAM_READWRITE);
+                        ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StScrollViewFade:fade-edges:
@@ -427,7 +427,7 @@ st_scroll_view_fade_class_init (StScrollViewFadeClass *klass)
                           "Fade Edges",
                           "Whether the faded area should extend to the edges",
                           FALSE,
-                          ST_PARAM_READWRITE);
+                          ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StScrollViewFade:extend-fade-area:
@@ -439,7 +439,7 @@ st_scroll_view_fade_class_init (StScrollViewFadeClass *klass)
                           "Extend Fade Area",
                           "Whether faded edges should extend beyond the faded area",
                           FALSE,
-                          ST_PARAM_READWRITE);
+                          ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   g_object_class_install_properties (gobject_class, N_PROPS, props);
 }
diff --git a/src/st/st-scroll-view.c b/src/st/st-scroll-view.c
index 4535424499..949d7994c6 100644
--- a/src/st/st-scroll-view.c
+++ b/src/st/st-scroll-view.c
@@ -898,7 +898,7 @@ st_scroll_view_class_init (StScrollViewClass *klass)
                        "When the vertical scrollbar is displayed",
                        ST_TYPE_POLICY_TYPE,
                        ST_POLICY_AUTOMATIC,
-                       ST_PARAM_READWRITE);
+                       ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StScrollView:hscrollbar-policy:
@@ -911,7 +911,7 @@ st_scroll_view_class_init (StScrollViewClass *klass)
                        "When the horizontal scrollbar is displayed",
                        ST_TYPE_POLICY_TYPE,
                        ST_POLICY_AUTOMATIC,
-                       ST_PARAM_READWRITE);
+                       ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StScrollView:hscrollbar-visible:
@@ -947,7 +947,7 @@ st_scroll_view_class_init (StScrollViewClass *klass)
                           "Enable Mouse Scrolling",
                           "Enable automatic mouse wheel scrolling",
                           TRUE,
-                          ST_PARAM_READWRITE);
+                          ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StScrollView:overlay-scrollbars:
@@ -959,14 +959,14 @@ st_scroll_view_class_init (StScrollViewClass *klass)
                           "Use Overlay Scrollbars",
                           "Overlay scrollbars over the content",
                           FALSE,
-                          ST_PARAM_READWRITE);
+                          ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   props[PROP_CONTENT_PADDING] =
     g_param_spec_boxed ("content-padding",
                         "Content padding",
                         "Content padding",
                         CLUTTER_TYPE_MARGIN,
-                        ST_PARAM_READWRITE);
+                        ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   g_object_class_install_properties (object_class, N_PROPS, props);
 }
diff --git a/src/st/st-scrollable.c b/src/st/st-scrollable.c
index aa387b9fd0..3a77052dbc 100644
--- a/src/st/st-scrollable.c
+++ b/src/st/st-scrollable.c
@@ -125,7 +125,7 @@ st_scrollable_default_init (StScrollableInterface *g_iface)
                                                                 "StAdjustment",
                                                                 "Horizontal adjustment",
                                                                 ST_TYPE_ADJUSTMENT,
-                                                                ST_PARAM_READWRITE));
+                                                                ST_PARAM_READWRITE | 
G_PARAM_EXPLICIT_NOTIFY));
 
       /**
        * StScrollable:vadjustment:
@@ -143,7 +143,7 @@ st_scrollable_default_init (StScrollableInterface *g_iface)
                                                                 "StAdjustment",
                                                                 "Vertical adjustment",
                                                                 ST_TYPE_ADJUSTMENT,
-                                                                ST_PARAM_READWRITE));
+                                                                ST_PARAM_READWRITE | 
G_PARAM_EXPLICIT_NOTIFY));
 
       initialized = TRUE;
     }
diff --git a/src/st/st-settings.c b/src/st/st-settings.c
index 0edead615f..c7db08b9c6 100644
--- a/src/st/st-settings.c
+++ b/src/st/st-settings.c
@@ -298,7 +298,7 @@ st_settings_class_init (StSettingsClass *klass)
                                                       "Slow down factor",
                                                       "Factor applied to all animation durations",
                                                       EPSILON, G_MAXDOUBLE, 1.0,
-                                                      ST_PARAM_READWRITE);
+                                                      ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StSettings:disable-show-password:
diff --git a/src/st/st-theme-context.c b/src/st/st-theme-context.c
index 34cc4fac0c..4055786d62 100644
--- a/src/st/st-theme-context.c
+++ b/src/st/st-theme-context.c
@@ -142,7 +142,7 @@ st_theme_context_class_init (StThemeContextClass *klass)
                       "Scale factor",
                       "Integer scale factor used for HiDPI scaling",
                       0, G_MAXINT, 1,
-                      ST_PARAM_READWRITE);
+                      ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   g_object_class_install_properties (object_class, N_PROPS, props);
 
diff --git a/src/st/st-widget.c b/src/st/st-widget.c
index e2814e52ea..69bf86c5d9 100644
--- a/src/st/st-widget.c
+++ b/src/st/st-widget.c
@@ -907,7 +907,7 @@ st_widget_class_init (StWidgetClass *klass)
                          "Pseudo Class",
                          "Pseudo class for styling",
                          "",
-                         ST_PARAM_READWRITE);
+                         ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StWidget:style-class:
@@ -919,7 +919,7 @@ st_widget_class_init (StWidgetClass *klass)
                          "Style Class",
                          "Style class for styling",
                          "",
-                         ST_PARAM_READWRITE);
+                         ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StWidget:style:
@@ -932,7 +932,7 @@ st_widget_class_init (StWidgetClass *klass)
                           "Style",
                           "Inline style string",
                           "",
-                          ST_PARAM_READWRITE);
+                          ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StWidget:track-hover:
@@ -948,7 +948,7 @@ st_widget_class_init (StWidgetClass *klass)
                            "Track hover",
                            "Determines whether the widget tracks hover state",
                            FALSE,
-                           ST_PARAM_READWRITE);
+                           ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StWidget:hover:
@@ -962,7 +962,7 @@ st_widget_class_init (StWidgetClass *klass)
                            "Hover",
                            "Whether the pointer is hovering over the widget",
                            FALSE,
-                           ST_PARAM_READWRITE);
+                           ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StWidget:can-focus:
@@ -974,7 +974,7 @@ st_widget_class_init (StWidgetClass *klass)
                            "Can focus",
                            "Whether the widget can be focused via keyboard navigation",
                            FALSE,
-                           ST_PARAM_READWRITE);
+                           ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StWidget:label-actor:
@@ -986,7 +986,7 @@ st_widget_class_init (StWidgetClass *klass)
                           "Label",
                           "Label that identifies this widget",
                           CLUTTER_TYPE_ACTOR,
-                          ST_PARAM_READWRITE);
+                          ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StWidget:accessible-role:
@@ -999,7 +999,7 @@ st_widget_class_init (StWidgetClass *klass)
                         "The accessible role of this object",
                         ATK_TYPE_ROLE,
                         ATK_ROLE_INVALID,
-                        ST_PARAM_READWRITE);
+                        ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * StWidget:accessible-name:
@@ -1011,7 +1011,7 @@ st_widget_class_init (StWidgetClass *klass)
                           "Accessible name",
                           "Object instance's name for assistive technology access.",
                           NULL,
-                          ST_PARAM_READWRITE);
+                          ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   g_object_class_install_properties (gobject_class, N_PROPS, props);
 


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