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] =
g_param_spec_object ("actor", "Actor", "Actor",
CLUTTER_TYPE_ACTOR,
ST_PARAM_READWRITE);
ST_PARAM_READWRITE |
G_PARAM_EXPLICIT_NOTIFY);
/**
* StAdjustment:lower:

View File

@ -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);
}

View File

@ -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:

View File

@ -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:

View File

@ -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);

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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:

View File

@ -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);

View File

@ -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);