[gnome-control-center/benzea/ensure-valid-config-after-loading: 87/91] display: Make rebuilding variable a counter
- From: Benjamin Berg <bberg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/benzea/ensure-valid-config-after-loading: 87/91] display: Make rebuilding variable a counter
- Date: Wed, 20 Mar 2019 14:19:55 +0000 (UTC)
commit 9b8fa901836d727fedb5b6039d3dc871ee8a5d75
Author: Benjamin Berg <bberg redhat com>
Date: Wed Mar 20 14:59:36 2019 +0100
display: Make rebuilding variable a counter
We need to also set rebuilding while updating some other UI elements.
Make it into a counter to allow for recursive setting.
Note that additional checks for rebuilding will be added in later
commits.
panels/display/cc-display-panel.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/panels/display/cc-display-panel.c b/panels/display/cc-display-panel.c
index 791ed523d..5f3c237bf 100644
--- a/panels/display/cc-display-panel.c
+++ b/panels/display/cc-display-panel.c
@@ -63,7 +63,7 @@ struct _CcDisplayPanel
CcDisplayConfig *current_config;
CcDisplayMonitor *current_output;
- gboolean rebuilding;
+ guint rebuilding;
CcDisplayArrangement *arrangement;
CcDisplaySettings *settings;
@@ -635,6 +635,8 @@ set_current_output (CcDisplayPanel *panel,
if (!changed && !force)
return;
+ panel->rebuilding += 1;
+
if (changed && cc_panel_get_selected_type (panel) == CC_DISPLAY_CONFIG_SINGLE)
{
if (output)
@@ -686,6 +688,8 @@ set_current_output (CcDisplayPanel *panel,
cc_display_settings_set_selected_output (panel->settings, panel->current_output);
cc_display_arrangement_set_selected_output (panel->arrangement, panel->current_output);
}
+
+ panel->rebuilding -= 1;
}
static void
@@ -694,7 +698,7 @@ rebuild_ui (CcDisplayPanel *panel)
guint n_outputs, n_active_outputs, n_usable_outputs;
GList *outputs, *l;
- panel->rebuilding = TRUE;
+ panel->rebuilding += 1;
g_list_store_remove_all (panel->primary_display_list);
gtk_list_store_clear (panel->output_selection_list);
@@ -795,7 +799,7 @@ rebuild_ui (CcDisplayPanel *panel)
gtk_stack_set_visible_child_name (panel->output_selection_stack, "multi-selection");
}
- panel->rebuilding = FALSE;
+ panel->rebuilding -= 1;
update_apply_button (panel);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]