From 2327604f58076b7fc8738998e5f5e42099f9244d Mon Sep 17 00:00:00 2001 From: Lothar May Date: Fri, 16 Jun 2023 13:31:44 +0200 Subject: [PATCH] app: [macOS] consider screen scale when performing system.ActionCenter Fixes: https://todo.sr.ht/~eliasnaur/gio/505 Signed-off-by: Lothar May --- app/os_macos.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/os_macos.go b/app/os_macos.go index 516157aa..5d07b756 100644 --- a/app/os_macos.go +++ b/app/os_macos.go @@ -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))