Ensure file activity dialog is centered on screen and appears at top of window stack
authorClaudio Cambra <claudio.cambra@gmail.com>
Tue, 16 Aug 2022 14:52:21 +0000 (16:52 +0200)
committerClaudio Cambra <claudio.cambra@gmail.com>
Wed, 17 Aug 2022 12:01:32 +0000 (14:01 +0200)
Signed-off-by: Claudio Cambra <claudio.cambra@gmail.com>
src/gui/tray/FileActivityDialog.qml

index 58264ef28c61545ff0319a7db0880e1c43e2d6a8..b2d5fb8093661fc46503562482a7bfcc3b333ba6 100644 (file)
@@ -30,8 +30,11 @@ Window {
     }
 
     Component.onCompleted: {
-        // Set this explicitly, otherwise on macOS it will appear behind the tray
-        x = screen.width / 2 - width / 2
-        y = screen.height / 2 - height / 2
+        Systray.forceWindowInit(dialog);
+        Systray.positionWindowAtScreenCenter(dialog);
+
+        dialog.show();
+        dialog.raise();
+        dialog.requestActivate();
     }
 }