summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Berg <bberg@redhat.com>2019-07-03 09:53:38 +0200
committerBenjamin Berg <bberg@redhat.com>2019-07-25 10:20:28 +0200
commit5a6ff6ad76db415cb3f5defd264e569e11a7dde4 (patch)
tree1512da535d7295fb1381be93170683627d5438b0
parente9aa94df02b366e9f90b0b742b1b367f2816eec4 (diff)
downloadgnome-control-center-5a6ff6ad76db415cb3f5defd264e569e11a7dde4.tar.gz
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 (cherry picked from commit 345a819f84853ec331e7ae2f522a046cca96951a)
-rw-r--r--panels/display/cc-display-panel.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/panels/display/cc-display-panel.c b/panels/display/cc-display-panel.c
index 7970e8654..65ee587c5 100644
--- a/panels/display/cc-display-panel.c
+++ b/panels/display/cc-display-panel.c
@@ -721,6 +721,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);
@@ -962,6 +968,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,