app,app/internal/wm: [macOS] refresh context on display change

The NSViewGlobalFrameDidChangeNotification notification is documented to
be fired every time [NSOpenGLContext update] needs to be called.
However, the notification fails to fire on my setup when a window is
moved to a display with a different pixel scale, which leads to
incorrectly sized output.

This change gets rid of the notification and updates the context before
every frame.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2021-06-12 19:27:48 +02:00
parent 9b5e9ae607
commit 0e592f8bc6
13 changed files with 60 additions and 24 deletions
+3 -1
View File
@@ -6,9 +6,10 @@ package wm
import (
"errors"
"gioui.org/io/key"
"image/color"
"gioui.org/io/key"
"gioui.org/gpu"
"gioui.org/io/event"
"gioui.org/io/pointer"
@@ -69,6 +70,7 @@ type Context interface {
API() gpu.API
Present() error
MakeCurrent() error
Refresh() error
Release()
Lock()
Unlock()