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>
This commit is contained in:
Florian Müllner 2022-02-09 13:59:15 +01:00 committed by Marge Bot
parent bfb52aaf9d
commit 5a23c96bd9
15 changed files with 46 additions and 45 deletions

View File

@ -302,7 +302,8 @@ st_adjustment_class_init (StAdjustmentClass *klass)
props[PROP_ACTOR] = props[PROP_ACTOR] =
g_param_spec_object ("actor", "Actor", "Actor", g_param_spec_object ("actor", "Actor", "Actor",
CLUTTER_TYPE_ACTOR, CLUTTER_TYPE_ACTOR,
ST_PARAM_READWRITE); ST_PARAM_READWRITE |
G_PARAM_EXPLICIT_NOTIFY);
/** /**
* StAdjustment:lower: * StAdjustment:lower:

View File

@ -312,7 +312,7 @@ st_bin_class_init (StBinClass *klass)
"Child", "Child",
"The child of the Bin", "The child of the Bin",
CLUTTER_TYPE_ACTOR, CLUTTER_TYPE_ACTOR,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
g_object_class_install_properties (gobject_class, N_PROPS, props); g_object_class_install_properties (gobject_class, N_PROPS, props);
} }

View File

@ -191,7 +191,7 @@ st_box_layout_class_init (StBoxLayoutClass *klass)
"Whether the layout should be vertical, rather" "Whether the layout should be vertical, rather"
"than horizontal", "than horizontal",
FALSE, FALSE,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/** /**
* StBoxLayout:pack-start: * StBoxLayout:pack-start:

View File

@ -488,7 +488,7 @@ st_button_class_init (StButtonClass *klass)
"Label", "Label",
"Label of the button", "Label of the button",
NULL, NULL,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/** /**
* StButton:button-mask: * StButton:button-mask:
@ -500,7 +500,7 @@ st_button_class_init (StButtonClass *klass)
"Button mask", "Button mask",
"Which buttons trigger the 'clicked' signal", "Which buttons trigger the 'clicked' signal",
ST_TYPE_BUTTON_MASK, ST_BUTTON_ONE, ST_TYPE_BUTTON_MASK, ST_BUTTON_ONE,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/** /**
* StButton:toggle-mode: * StButton:toggle-mode:
@ -512,7 +512,7 @@ st_button_class_init (StButtonClass *klass)
"Toggle Mode", "Toggle Mode",
"Enable or disable toggling", "Enable or disable toggling",
FALSE, FALSE,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/** /**
* StButton:checked: * StButton:checked:
@ -528,7 +528,7 @@ st_button_class_init (StButtonClass *klass)
"Checked", "Checked",
"Indicates if a toggle button is \"on\" or \"off\"", "Indicates if a toggle button is \"on\" or \"off\"",
FALSE, FALSE,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/** /**
* StButton:pressed: * StButton:pressed:

View File

@ -903,7 +903,7 @@ st_entry_class_init (StEntryClass *klass)
"Primary Icon", "Primary Icon",
"Primary Icon actor", "Primary Icon actor",
CLUTTER_TYPE_ACTOR, CLUTTER_TYPE_ACTOR,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/** /**
* StEntry:secondary-icon: * StEntry:secondary-icon:
@ -915,7 +915,7 @@ st_entry_class_init (StEntryClass *klass)
"Secondary Icon", "Secondary Icon",
"Secondary Icon actor", "Secondary Icon actor",
CLUTTER_TYPE_ACTOR, CLUTTER_TYPE_ACTOR,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/** /**
* StEntry:hint-text: * StEntry:hint-text:
@ -929,7 +929,7 @@ st_entry_class_init (StEntryClass *klass)
"Text to display when the entry is not focused " "Text to display when the entry is not focused "
"and the text property is empty", "and the text property is empty",
NULL, NULL,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/** /**
* StEntry:hint-actor: * StEntry:hint-actor:
@ -943,7 +943,7 @@ st_entry_class_init (StEntryClass *klass)
"An actor to display when the entry is not focused " "An actor to display when the entry is not focused "
"and the text property is empty", "and the text property is empty",
CLUTTER_TYPE_ACTOR, CLUTTER_TYPE_ACTOR,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/** /**
* StEntry:text: * StEntry:text:
@ -955,7 +955,7 @@ st_entry_class_init (StEntryClass *klass)
"Text", "Text",
"Text of the entry", "Text of the entry",
NULL, NULL,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/** /**
* StEntry:input-purpose: * StEntry:input-purpose:
@ -969,7 +969,7 @@ st_entry_class_init (StEntryClass *klass)
"Purpose of the text field", "Purpose of the text field",
CLUTTER_TYPE_INPUT_CONTENT_PURPOSE, CLUTTER_TYPE_INPUT_CONTENT_PURPOSE,
CLUTTER_INPUT_CONTENT_PURPOSE_NORMAL, CLUTTER_INPUT_CONTENT_PURPOSE_NORMAL,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/** /**
* StEntry:input-hints: * StEntry:input-hints:
@ -984,7 +984,7 @@ st_entry_class_init (StEntryClass *klass)
"Hints for the text field behaviour", "Hints for the text field behaviour",
CLUTTER_TYPE_INPUT_CONTENT_HINT_FLAGS, CLUTTER_TYPE_INPUT_CONTENT_HINT_FLAGS,
0, 0,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
g_object_class_install_properties (gobject_class, N_PROPS, props); g_object_class_install_properties (gobject_class, N_PROPS, props);

View File

@ -295,7 +295,7 @@ st_icon_class_init (StIconClass *klass)
"GIcon", "GIcon",
"The GIcon shown by this icon actor", "The GIcon shown by this icon actor",
G_TYPE_ICON, G_TYPE_ICON,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/** /**
* StIcon:fallback-gicon: * StIcon:fallback-gicon:
@ -307,7 +307,7 @@ st_icon_class_init (StIconClass *klass)
"Fallback GIcon", "Fallback GIcon",
"The fallback GIcon shown if the normal icon fails to load", "The fallback GIcon shown if the normal icon fails to load",
G_TYPE_ICON, G_TYPE_ICON,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/** /**
* StIcon:icon-name: * StIcon:icon-name:
@ -319,7 +319,7 @@ st_icon_class_init (StIconClass *klass)
"Icon name", "Icon name",
"An icon name", "An icon name",
NULL, NULL,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/** /**
* StIcon:icon-size: * StIcon:icon-size:
@ -332,7 +332,7 @@ st_icon_class_init (StIconClass *klass)
"Icon size", "Icon size",
"The size if the icon, if positive. Otherwise the size will be derived from the current style", "The size if the icon, if positive. Otherwise the size will be derived from the current style",
-1, G_MAXINT, -1, -1, G_MAXINT, -1,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/** /**
* StIcon:fallback-icon-name: * StIcon:fallback-icon-name:
@ -345,7 +345,7 @@ st_icon_class_init (StIconClass *klass)
"Fallback icon name", "Fallback icon name",
"A fallback icon name", "A fallback icon name",
NULL, NULL,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
g_object_class_install_properties (object_class, N_PROPS, props); g_object_class_install_properties (object_class, N_PROPS, props);
} }

View File

@ -296,7 +296,7 @@ st_label_class_init (StLabelClass *klass)
"Text", "Text",
"Text of the label", "Text of the label",
NULL, NULL,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
g_object_class_install_properties (gobject_class, N_PROPS, props); g_object_class_install_properties (gobject_class, N_PROPS, props);
} }

View File

@ -155,7 +155,7 @@ st_password_entry_class_init (StPasswordEntryClass *klass)
"Password visible", "Password visible",
"Whether the text in the entry is masked or not", "Whether the text in the entry is masked or not",
FALSE, FALSE,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/** /**
* StPasswordEntry:show-peek-icon: * StPasswordEntry:show-peek-icon:
@ -167,7 +167,7 @@ st_password_entry_class_init (StPasswordEntryClass *klass)
"Show peek icon", "Show peek icon",
"Whether to show the password peek icon", "Whether to show the password peek icon",
TRUE, TRUE,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
g_object_class_install_properties (gobject_class, N_PROPS, props); g_object_class_install_properties (gobject_class, N_PROPS, props);
} }

View File

@ -534,7 +534,7 @@ st_scroll_bar_class_init (StScrollBarClass *klass)
props[PROP_ADJUSTMENT] = props[PROP_ADJUSTMENT] =
g_param_spec_object ("adjustment", "Adjustment", "The adjustment", g_param_spec_object ("adjustment", "Adjustment", "The adjustment",
ST_TYPE_ADJUSTMENT, ST_TYPE_ADJUSTMENT,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/** /**
* StScrollBar:vertical: * StScrollBar:vertical:
@ -546,7 +546,7 @@ st_scroll_bar_class_init (StScrollBarClass *klass)
"Vertical Orientation", "Vertical Orientation",
"Vertical Orientation", "Vertical Orientation",
FALSE, FALSE,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
g_object_class_install_properties (object_class, N_PROPS, props); g_object_class_install_properties (object_class, N_PROPS, props);

View File

@ -415,7 +415,7 @@ st_scroll_view_fade_class_init (StScrollViewFadeClass *klass)
"Fade margins", "Fade margins",
"The margin widths that are faded", "The margin widths that are faded",
CLUTTER_TYPE_MARGIN, CLUTTER_TYPE_MARGIN,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/** /**
* StScrollViewFade:fade-edges: * StScrollViewFade:fade-edges:
@ -427,7 +427,7 @@ st_scroll_view_fade_class_init (StScrollViewFadeClass *klass)
"Fade Edges", "Fade Edges",
"Whether the faded area should extend to the edges", "Whether the faded area should extend to the edges",
FALSE, FALSE,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/** /**
* StScrollViewFade:extend-fade-area: * StScrollViewFade:extend-fade-area:
@ -439,7 +439,7 @@ st_scroll_view_fade_class_init (StScrollViewFadeClass *klass)
"Extend Fade Area", "Extend Fade Area",
"Whether faded edges should extend beyond the faded area", "Whether faded edges should extend beyond the faded area",
FALSE, FALSE,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
g_object_class_install_properties (gobject_class, N_PROPS, props); g_object_class_install_properties (gobject_class, N_PROPS, props);
} }

View File

@ -898,7 +898,7 @@ st_scroll_view_class_init (StScrollViewClass *klass)
"When the vertical scrollbar is displayed", "When the vertical scrollbar is displayed",
ST_TYPE_POLICY_TYPE, ST_TYPE_POLICY_TYPE,
ST_POLICY_AUTOMATIC, ST_POLICY_AUTOMATIC,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/** /**
* StScrollView:hscrollbar-policy: * StScrollView:hscrollbar-policy:
@ -911,7 +911,7 @@ st_scroll_view_class_init (StScrollViewClass *klass)
"When the horizontal scrollbar is displayed", "When the horizontal scrollbar is displayed",
ST_TYPE_POLICY_TYPE, ST_TYPE_POLICY_TYPE,
ST_POLICY_AUTOMATIC, ST_POLICY_AUTOMATIC,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/** /**
* StScrollView:hscrollbar-visible: * StScrollView:hscrollbar-visible:
@ -947,7 +947,7 @@ st_scroll_view_class_init (StScrollViewClass *klass)
"Enable Mouse Scrolling", "Enable Mouse Scrolling",
"Enable automatic mouse wheel scrolling", "Enable automatic mouse wheel scrolling",
TRUE, TRUE,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/** /**
* StScrollView:overlay-scrollbars: * StScrollView:overlay-scrollbars:
@ -959,14 +959,14 @@ st_scroll_view_class_init (StScrollViewClass *klass)
"Use Overlay Scrollbars", "Use Overlay Scrollbars",
"Overlay scrollbars over the content", "Overlay scrollbars over the content",
FALSE, FALSE,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
props[PROP_CONTENT_PADDING] = props[PROP_CONTENT_PADDING] =
g_param_spec_boxed ("content-padding", g_param_spec_boxed ("content-padding",
"Content padding", "Content padding",
"Content padding", "Content padding",
CLUTTER_TYPE_MARGIN, CLUTTER_TYPE_MARGIN,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
g_object_class_install_properties (object_class, N_PROPS, props); g_object_class_install_properties (object_class, N_PROPS, props);
} }

View File

@ -125,7 +125,7 @@ st_scrollable_default_init (StScrollableInterface *g_iface)
"StAdjustment", "StAdjustment",
"Horizontal adjustment", "Horizontal adjustment",
ST_TYPE_ADJUSTMENT, ST_TYPE_ADJUSTMENT,
ST_PARAM_READWRITE)); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY));
/** /**
* StScrollable:vadjustment: * StScrollable:vadjustment:
@ -143,7 +143,7 @@ st_scrollable_default_init (StScrollableInterface *g_iface)
"StAdjustment", "StAdjustment",
"Vertical adjustment", "Vertical adjustment",
ST_TYPE_ADJUSTMENT, ST_TYPE_ADJUSTMENT,
ST_PARAM_READWRITE)); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY));
initialized = TRUE; initialized = TRUE;
} }

View File

@ -298,7 +298,7 @@ st_settings_class_init (StSettingsClass *klass)
"Slow down factor", "Slow down factor",
"Factor applied to all animation durations", "Factor applied to all animation durations",
EPSILON, G_MAXDOUBLE, 1.0, EPSILON, G_MAXDOUBLE, 1.0,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/** /**
* StSettings:disable-show-password: * StSettings:disable-show-password:

View File

@ -142,7 +142,7 @@ st_theme_context_class_init (StThemeContextClass *klass)
"Scale factor", "Scale factor",
"Integer scale factor used for HiDPI scaling", "Integer scale factor used for HiDPI scaling",
0, G_MAXINT, 1, 0, G_MAXINT, 1,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
g_object_class_install_properties (object_class, N_PROPS, props); g_object_class_install_properties (object_class, N_PROPS, props);

View File

@ -907,7 +907,7 @@ st_widget_class_init (StWidgetClass *klass)
"Pseudo Class", "Pseudo Class",
"Pseudo class for styling", "Pseudo class for styling",
"", "",
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/** /**
* StWidget:style-class: * StWidget:style-class:
@ -919,7 +919,7 @@ st_widget_class_init (StWidgetClass *klass)
"Style Class", "Style Class",
"Style class for styling", "Style class for styling",
"", "",
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/** /**
* StWidget:style: * StWidget:style:
@ -932,7 +932,7 @@ st_widget_class_init (StWidgetClass *klass)
"Style", "Style",
"Inline style string", "Inline style string",
"", "",
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/** /**
* StWidget:track-hover: * StWidget:track-hover:
@ -948,7 +948,7 @@ st_widget_class_init (StWidgetClass *klass)
"Track hover", "Track hover",
"Determines whether the widget tracks hover state", "Determines whether the widget tracks hover state",
FALSE, FALSE,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/** /**
* StWidget:hover: * StWidget:hover:
@ -962,7 +962,7 @@ st_widget_class_init (StWidgetClass *klass)
"Hover", "Hover",
"Whether the pointer is hovering over the widget", "Whether the pointer is hovering over the widget",
FALSE, FALSE,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/** /**
* StWidget:can-focus: * StWidget:can-focus:
@ -974,7 +974,7 @@ st_widget_class_init (StWidgetClass *klass)
"Can focus", "Can focus",
"Whether the widget can be focused via keyboard navigation", "Whether the widget can be focused via keyboard navigation",
FALSE, FALSE,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/** /**
* StWidget:label-actor: * StWidget:label-actor:
@ -986,7 +986,7 @@ st_widget_class_init (StWidgetClass *klass)
"Label", "Label",
"Label that identifies this widget", "Label that identifies this widget",
CLUTTER_TYPE_ACTOR, CLUTTER_TYPE_ACTOR,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/** /**
* StWidget:accessible-role: * StWidget:accessible-role:
@ -999,7 +999,7 @@ st_widget_class_init (StWidgetClass *klass)
"The accessible role of this object", "The accessible role of this object",
ATK_TYPE_ROLE, ATK_TYPE_ROLE,
ATK_ROLE_INVALID, ATK_ROLE_INVALID,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/** /**
* StWidget:accessible-name: * StWidget:accessible-name:
@ -1011,7 +1011,7 @@ st_widget_class_init (StWidgetClass *klass)
"Accessible name", "Accessible name",
"Object instance's name for assistive technology access.", "Object instance's name for assistive technology access.",
NULL, NULL,
ST_PARAM_READWRITE); ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
g_object_class_install_properties (gobject_class, N_PROPS, props); g_object_class_install_properties (gobject_class, N_PROPS, props);