Nidhoegger
Nidhoegger

Reputation: 5232

Detect moving the windows from one display to another

I have a window with an opengl view where content ist rendered. The problem I have in macOS is, that when I move the window from one monitor to the other, its content gets messed up. A redraw fixes the issue. Thus I need to redraw the GL Area when it gets moved from one monitor to the other. Is there any way to detect the transition of the window from one monitor to the other?

Upvotes: 3

Views: 239

Answers (1)

Gerd K
Gerd K

Reputation: 2993

You can register for notifications that fire when the view's window changes screens: NSWindowDidChangeScreenNotification

Upvotes: 5

Related Questions