diff options
author | Chris Lumens <clumens@redhat.com> | 2012-10-05 12:05:51 -0400 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2012-10-05 13:28:14 -0400 |
commit | a28c9554a2617ac1e360225f3105d559f5290e83 (patch) | |
tree | d8d56264b2a1d1128b4397c3f2b105a99e0997d8 /pyanaconda/ui/gui/spokes/keyboard.py | |
parent | 1bca6d8cded8cb6861ab58efa87ba5b4b0aeb8f5 (diff) | |
download | anaconda-a28c9554a2617ac1e360225f3105d559f5290e83.tar.gz anaconda-a28c9554a2617ac1e360225f3105d559f5290e83.tar.xz anaconda-a28c9554a2617ac1e360225f3105d559f5290e83.zip |
Fix a deadlock when trying to add a keyboard layout (#862612).
This was introduced by 576349d2, which fixed a similar deadlock but accidentally
introduced this one. Tweak that patch just a little to make sure the
gdk_threaded only gets applied when needed.
Diffstat (limited to 'pyanaconda/ui/gui/spokes/keyboard.py')
-rw-r--r-- | pyanaconda/ui/gui/spokes/keyboard.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/pyanaconda/ui/gui/spokes/keyboard.py b/pyanaconda/ui/gui/spokes/keyboard.py index c2e9b8637..a64a63c4c 100644 --- a/pyanaconda/ui/gui/spokes/keyboard.py +++ b/pyanaconda/ui/gui/spokes/keyboard.py @@ -264,9 +264,8 @@ class KeyboardSpoke(NormalSpoke): dialog.refresh() dialog.initialize() - with gdk_threaded(): - with enlightbox(self.window, dialog.window): - response = dialog.run() + with enlightbox(self.window, dialog.window): + response = dialog.run() if response == 1: duplicates = set() @@ -284,6 +283,13 @@ class KeyboardSpoke(NormalSpoke): self._removeLayout(self._store, itr) self._remove_last_attempt = False + def _run_add_from_removed(self, button): + # Only call gdk_threaded when necessary (when we need to run the add + # dialog from the on_remove_clicked path) or we'll introduce a different + # deadlock. + with gdk_threaded(): + self.on_add_clicked(button) + def on_remove_clicked(self, button): selection = self.builder.get_object("layoutSelection") if not selection.count_selected_rows(): @@ -304,7 +310,7 @@ class KeyboardSpoke(NormalSpoke): #redrawn self._remove_last_attempt = True add_button = self.builder.get_object("addLayoutButton") - GLib.idle_add(self.on_add_clicked, add_button) + GLib.idle_add(self._run_add_from_removed, add_button) return #the selected item is not the first, select the previous one |