mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-03 08:25:34 +00:00
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:
+2
-1
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user