Emitting signals from the function that handles other signals is dangerous given the synchronous nature of GTK signals, so this was never a good idea to start with. Then, displaying the dialog from the main loop means it gets displayed in the lightbox correctly instead of over a completely grey background. --- pyanaconda/ui/gui/spokes/storage.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py index 3c0059b..e9ce0c5 100644 --- a/pyanaconda/ui/gui/spokes/storage.py +++ b/pyanaconda/ui/gui/spokes/storage.py @@ -724,6 +724,7 @@ class StorageSpoke(NormalSpoke, StorageChecker):
if dialog.custom: self.skipTo = "CustomPartitioningSpoke" + self.on_back_clicked(self.window) else: if self.encrypted: dialog = PassphraseDialog(self.data) @@ -734,20 +735,20 @@ class StorageSpoke(NormalSpoke, StorageChecker): self.passphrase = dialog.passphrase
self.apply() - - resizeDialog = ResizeDialog(self.data, self.storage, self.payload) - resizeDialog.refresh(disks) - - # resizeDialog handles okay/cancel on its own, so we can throw - # out the return value. - self.run_lightbox_dialog(resizeDialog) - self.window.emit("button-clicked") - return - - self.on_back_clicked(self.window) + GLib.idle_add(self._show_resize_dialog, disks) elif rc == dialog.RESPONSE_QUIT: raise SystemExit("user-selected exit")
+ def _show_resize_dialog(self, disks): + resizeDialog = ResizeDialog(self.data, self.storage, self.payload) + resizeDialog.refresh(disks) + + # resizeDialog handles okay/cancel on its own, so we can throw out the + # return value. + self.run_lightbox_dialog(resizeDialog) + self.window.emit("button-clicked") + return False + def on_add_disk_clicked(self, button): print "ADD DISK CLICKED"
On 11/13/2012 01:03 PM, Chris Lumens wrote:
Emitting signals from the function that handles other signals is dangerous given the synchronous nature of GTK signals, so this was never a good idea to start with. Then, displaying the dialog from the main loop means it gets displayed in the lightbox correctly instead of over a completely grey background.
ACK
anaconda-patches@lists.fedorahosted.org