[gnome-software/wip/mcrha/repo-disable] gs-repo-row: Do not emit "switch-clicked" when the switch is insensitive



commit 711384de90fe9b2c3c98154f57ec87a0d0cf73e1
Author: Milan Crha <mcrha redhat com>
Date:   Mon Sep 20 10:42:08 2021 +0200

    gs-repo-row: Do not emit "switch-clicked" when the switch is insensitive
    
    This could happen when had been clicked on the repo row, instead on
    the switch itself.
    
    It had been reported downstream:
    https://bugzilla.redhat.com/show_bug.cgi?id=2005343

 src/gs-repo-row.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/gs-repo-row.c b/src/gs-repo-row.c
index d0507447f..57493c2c7 100644
--- a/src/gs-repo-row.c
+++ b/src/gs-repo-row.c
@@ -434,7 +434,9 @@ gs_repo_row_emit_switch_clicked (GsRepoRow *self)
 
        g_return_if_fail (GS_IS_REPO_ROW (self));
 
-       if (priv->repo == NULL || priv->busy_counter > 0 || !gtk_widget_get_visible (priv->disable_switch))
+       if (priv->repo == NULL || priv->busy_counter > 0 ||
+           !gtk_widget_get_visible (priv->disable_switch) ||
+           !gtk_widget_get_sensitive (priv->disable_switch))
                return;
 
        g_signal_emit (self, signals[SIGNAL_SWITCH_CLICKED], 0);


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