app: [macOS] consider screen scale when performing system.ActionCenter

Fixes: https://todo.sr.ht/~eliasnaur/gio/505
Signed-off-by: Lothar May <stocks@lotharmay.de>
This commit is contained in:
Lothar May
2023-06-16 13:31:44 +02:00
committed by Elias Naur
parent 3bb6cca157
commit 2327604f58
+2 -1
View File
@@ -425,7 +425,8 @@ func (w *window) Perform(acts system.Action) {
switch a {
case system.ActionCenter:
r := C.getScreenFrame(window) // the screen size of the window
sz := w.config.Size
screenScale := float32(C.getScreenBackingScale())
sz := w.config.Size.Div(int(screenScale))
x := (int(r.size.width) - sz.X) / 2
y := (int(r.size.height) - sz.Y) / 2
C.setScreenFrame(window, C.CGFloat(x), C.CGFloat(y), C.CGFloat(sz.X), C.CGFloat(sz.Y))