[gnome-shell] st/button: Notify :pressed changes
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] st/button: Notify :pressed changes
- Date: Fri, 22 Nov 2019 21:26:04 +0000 (UTC)
commit 9790b0ee5d23f5d8a44a1733fb9d5fbd50a7f41d
Author: Florian Müllner <fmuellner gnome org>
Date: Fri Nov 22 18:53:26 2019 +0100
st/button: Notify :pressed changes
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/846
src/st/st-button.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/src/st/st-button.c b/src/st/st-button.c
index c1ea7b9915..c2c48a5101 100644
--- a/src/st/st-button.c
+++ b/src/st/st-button.c
@@ -139,13 +139,17 @@ st_button_press (StButton *button,
ClutterEventSequence *sequence)
{
StButtonPrivate *priv = st_button_get_instance_private (button);
+ gboolean active_changed = priv->pressed == 0 || sequence;
- if (priv->pressed == 0 || sequence)
+ if (active_changed)
st_widget_add_style_pseudo_class (ST_WIDGET (button), "active");
priv->pressed |= mask;
priv->press_sequence = sequence;
priv->device = device;
+
+ if (active_changed)
+ g_object_notify_by_pspec (G_OBJECT (button), props[PROP_PRESSED]);
}
static void
@@ -171,6 +175,7 @@ st_button_release (StButton *button,
priv->press_sequence = NULL;
priv->device = NULL;
st_widget_remove_style_pseudo_class (ST_WIDGET (button), "active");
+ g_object_notify_by_pspec (G_OBJECT (button), props[PROP_PRESSED]);
if (clicked_button || sequence)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]