[gnome-control-center/benzea/display-more-error-handling: 25/25] display: Add guards for NULL display configuration
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/benzea/display-more-error-handling: 25/25] display: Add guards for NULL display configuration
- Date: Sat, 20 Jul 2019 02:24:14 +0000 (UTC)
commit 345a819f84853ec331e7ae2f522a046cca96951a
Author: Benjamin Berg <bberg redhat com>
Date: Wed Jul 3 09:53:38 2019 +0200
display: Add guards for NULL display configuration
This may happen under some conditions. Possibly due to a race condition
(i.e. we did not receive any configuration from mutter yet) or also if
we are not running on GNOME.
Add guards for NULL configuration. This configuration is never
applicable and mostly clears the UI.
Fixes: #604
panels/display/cc-display-panel.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
---
diff --git a/panels/display/cc-display-panel.c b/panels/display/cc-display-panel.c
index 3469fd7ac..701728376 100644
--- a/panels/display/cc-display-panel.c
+++ b/panels/display/cc-display-panel.c
@@ -745,6 +745,12 @@ rebuild_ui (CcDisplayPanel *panel)
g_list_store_remove_all (panel->primary_display_list);
gtk_list_store_clear (panel->output_selection_list);
+ if (!panel->current_config)
+ {
+ panel->rebuilding_counter--;
+ return;
+ }
+
n_active_outputs = 0;
n_usable_outputs = 0;
outputs = cc_display_config_get_ui_sorted_monitors (panel->current_config);
@@ -987,6 +993,12 @@ update_apply_button (CcDisplayPanel *panel)
gboolean config_equal;
g_autoptr(CcDisplayConfig) applied_config = NULL;
+ if (!panel->current_config)
+ {
+ reset_titlebar (panel);
+ return;
+ }
+
applied_config = cc_display_config_manager_get_current (panel->manager);
config_equal = cc_display_config_equal (panel->current_config,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]