Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 806
Nidhoegger Avatar asked Nov 25 '25 09:11

Nidhoegger


1 Answers

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

like image 115
Gerd K Avatar answered Nov 28 '25 00:11

Gerd K



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!