[gnome-control-center/rhel/8.4.0: 13/32] sharing: Fix warning when disabling sharing
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/rhel/8.4.0: 13/32] sharing: Fix warning when disabling sharing
- Date: Tue, 13 Apr 2021 14:34:54 +0000 (UTC)
commit 5ecf400fae42707c37ca77541e71e8b8a2cb1e37
Author: Robert Ancell <robert ancell canonical com>
Date: Mon Oct 15 11:49:19 2018 +1300
sharing: Fix warning when disabling sharing
The warning is:
(gnome-control-center:29760): Gtk-CRITICAL **: 11:45:48.076: gtk_widget_is_visible: assertion
'GTK_IS_WIDGET (widget)' failed
This is due to the code trying to disable switches that only exist if support
for that feature is available.
panels/sharing/cc-sharing-panel.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/panels/sharing/cc-sharing-panel.c b/panels/sharing/cc-sharing-panel.c
index adcbcdc86..ab22f5df8 100644
--- a/panels/sharing/cc-sharing-panel.c
+++ b/panels/sharing/cc-sharing-panel.c
@@ -99,7 +99,7 @@ struct _CcSharingPanelPrivate
guint remote_desktop_name_watch;
};
-#define OFF_IF_VISIBLE(x) { if (gtk_widget_is_visible(x) && gtk_widget_is_sensitive(x))
gtk_switch_set_active (GTK_SWITCH(x), FALSE); }
+#define OFF_IF_VISIBLE(x) { if ((x) != NULL && gtk_widget_is_visible(x) && gtk_widget_is_sensitive(x))
gtk_switch_set_active (GTK_SWITCH(x), FALSE); }
static void
cc_sharing_panel_master_switch_notify (GtkSwitch *gtkswitch,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]