[gnome-control-center/benzea/fix-display-panel-recursion] display: Fix possible recursion when configuration type changes




commit e8a49da9c12417edb6e05e804c17293d0b61ad22
Author: Benjamin Berg <bberg redhat com>
Date:   Tue Oct 6 11:38:27 2020 +0200

    display: Fix possible recursion when configuration type changes
    
    The UI rebuilding code may change the configuration type, which in turn
    can trigger a UI rebuild. This should not be done if we are already
    updating the UI (but must be done otherwise, as that means the user has
    chosen to change the configuration).
    
    Fixes: #1141

 panels/display/cc-display-panel.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/panels/display/cc-display-panel.c b/panels/display/cc-display-panel.c
index dfca98cc6..949034442 100644
--- a/panels/display/cc-display-panel.c
+++ b/panels/display/cc-display-panel.c
@@ -254,7 +254,8 @@ config_ensure_of_type (CcDisplayPanel *panel, CcDisplayConfigType type)
       g_assert_not_reached ();
     }
 
-  rebuild_ui (panel);
+  if (!panel->rebuilding_counter)
+    rebuild_ui (panel);
 }
 
 static void


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