Now that we have Gdk.threads_init there may appear new issues when whole GUI hangs. Running AddLayout dialog in some cases is the example.
Vratislav Podzimek (1): Use gdk_threaded() when running AddLayout dialog
pyanaconda/ui/gui/spokes/keyboard.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
Without this whole GUI hangs in case this dialog is run to choose replacement for the last layout in the list of added layouts (minus button clicked).
Signed-off-by: Vratislav Podzimek vpodzime@redhat.com --- pyanaconda/ui/gui/spokes/keyboard.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/keyboard.py b/pyanaconda/ui/gui/spokes/keyboard.py index 50933aa..c2e9b86 100644 --- a/pyanaconda/ui/gui/spokes/keyboard.py +++ b/pyanaconda/ui/gui/spokes/keyboard.py @@ -30,7 +30,7 @@ from gi.repository import GLib, Gkbd, Gtk, Gdk from pyanaconda.ui.gui import GUIObject from pyanaconda.ui.gui.spokes import NormalSpoke from pyanaconda.ui.gui.categories.localization import LocalizationCategory -from pyanaconda.ui.gui.utils import enlightbox +from pyanaconda.ui.gui.utils import enlightbox, gdk_threaded from pyanaconda import keyboard from pyanaconda import flags
@@ -264,8 +264,9 @@ class KeyboardSpoke(NormalSpoke): dialog.refresh() dialog.initialize()
- with enlightbox(self.window, dialog.window): - response = dialog.run() + with gdk_threaded(): + with enlightbox(self.window, dialog.window): + response = dialog.run()
if response == 1: duplicates = set()
Without this whole GUI hangs in case this dialog is run to choose replacement for the last layout in the list of added layouts (minus button clicked).
There's likely to be more of this, too.
@@ -264,8 +264,9 @@ class KeyboardSpoke(NormalSpoke): dialog.refresh() dialog.initialize()
with enlightbox(self.window, dialog.window):
response = dialog.run()
with gdk_threaded():
with enlightbox(self.window, dialog.window):
response = dialog.run() if response == 1: duplicates = set()
python lets you do nested context managers like so:
with gdk_threaded(), enlightbox(...):
It saves the indentation but now that I've typed it out I'm not sure it's very clear. So, whatever.
- Chris
anaconda-patches@lists.fedorahosted.org