From a32df6b7a3853f9e254d5fa9b1748608354ec070 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sat, 16 Jan 2021 01:43:53 +0100 Subject: [PATCH] extensionsService: Fix setting prefs dialog parent Between the GTK4 port and the latest GTK4 version, calling realize() on a newly created window to force its surface to be created stopped working. So instead, wait for the window to get realized regularly to set its parent. Part-of: --- js/dbusServices/extensions/extensionsService.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/js/dbusServices/extensions/extensionsService.js b/js/dbusServices/extensions/extensionsService.js index 8217675b0..35e780578 100644 --- a/js/dbusServices/extensions/extensionsService.js +++ b/js/dbusServices/extensions/extensionsService.js @@ -120,15 +120,15 @@ var ExtensionsService = class extends ServiceImplementation { const extension = ExtensionUtils.deserializeExtension(serialized); const window = new ExtensionPrefsDialog(extension); - window.realize(); + window.connect('realize', () => { + let externalWindow = null; - let externalWindow = null; + if (parentWindow) + externalWindow = Shew.ExternalWindow.new_from_handle(parentWindow); - if (parentWindow) - externalWindow = Shew.ExternalWindow.new_from_handle(parentWindow); - - if (externalWindow) - externalWindow.set_parent_of(window.get_surface()); + if (externalWindow) + externalWindow.set_parent_of(window.get_surface()); + }); if (options.modal) window.modal = options.modal.get_boolean();