diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2016-10-18 16:10:08 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2016-10-27 13:08:44 +0000 |
commit | ab1744b18d640483ac37db0c9b46facb5effe54c (patch) | |
tree | 3c4f82833af7cfd3d954066f7eafa772b401bdaf /src/plugins/platforms/cocoa/qcocoawindow.mm | |
parent | c1c99c3bfec512bf50164a6fc72e78fc684fcf5b (diff) |
macOS: Handle NSViewGlobalFrameDidChangeNotification via QCocoaWindow
The notification is only posted for NSViews with attached surfaces,
meaning NSOpenGLContext, so there's no need to guard the subscription
within [QNSView setQCocoaGLContext:].
Change-Id: I8179e58c84925a756315b711d15fa9c356adaecf
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoawindow.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoawindow.mm | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index 524d3f0703..a44a9dff6a 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -1270,6 +1270,18 @@ void QCocoaWindow::viewDidChangeFrame() [qnsview_cast(m_view) updateGeometry]; } +/*! + Callback for NSViewGlobalFrameDidChangeNotification. + + Posted whenever an NSView object that has attached surfaces (that is, + NSOpenGLContext objects) moves to a different screen, or other cases + where the NSOpenGLContext object needs to be updated. +*/ +void QCocoaWindow::viewDidChangeGlobalFrame() +{ + updateExposedGeometry(); +} + void QCocoaWindow::windowDidEndLiveResize() { if (m_synchedWindowState == Qt::WindowMaximized && ![m_nsWindow isZoomed]) { |