[meld] meldwindow: Ensure UIManager update, and stop updates (bgo#755407)



commit 57fe4b72df875d3a96deeeb98fd8f5d4d48333c6
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sun Dec 13 07:16:11 2015 +1000

    meldwindow: Ensure UIManager update, and stop updates (bgo#755407)
    
    When closing a window, if there are any pending UIManager updates, we
    get lots of extremely ugly, important-sounding Gtk-CRITICAL logging on
    the console.
    
    This change just ensures that any UIManager updates caused by the tab
    removal are done before we move on, and stops doing any more updates if
    we have no more tabs. Since we always close all tabs when closing a
    window, this should stop the problem from occurring.

 meld/meldwindow.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/meld/meldwindow.py b/meld/meldwindow.py
index a2bd1c6..9c8f146 100644
--- a/meld/meldwindow.py
+++ b/meld/meldwindow.py
@@ -543,9 +543,13 @@ class MeldWindow(gnomeglade.Component):
         if self.tab_switch_merge_id:
             self.ui.remove_ui(self.tab_switch_merge_id)
             self.ui.remove_action_group(self.tab_switch_actiongroup)
+            self.ui.ensure_update()
             self.tab_switch_merge_id = None
             self.tab_switch_actiongroup = None
 
+        if not self.notebook.get_n_pages():
+            return
+
         self.tab_switch_merge_id = self.ui.new_merge_id()
         self.tab_switch_actiongroup = Gtk.ActionGroup(name="TabSwitchActions")
         self.ui.insert_action_group(self.tab_switch_actiongroup)


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