diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2017-06-21 13:05:36 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2017-06-21 20:25:31 +0000 |
commit | eecf64f61dbf2a0dafc8dfc809d5e87fb398d0f6 (patch) | |
tree | 4dfdc62674e8b89a9cf6e7125274e75879a74715 /src/plugins/platforms/cocoa/qnsview.mm | |
parent | 3d8a70c0459192d57088ee51d2b1f0cc52d2e5f8 (diff) |
macOS: Remove support for child NSWindows
The private feature was only used by QToolBar to solve QTBUG-33082, but
the solution doesn't work, and complicates the macOS platform plugin
quite a bit.
A better solution is likely to use Core Animation layers, which is a
direction we're going in anyways. To make it easier to modernize the
macOS platform plugin, including moving to using layers, we remove the
child NSWindows codepaths for now.
Change-Id: I4b19464be3980fd84dd7af8316d4d5e85ba813b1
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa/qnsview.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qnsview.mm | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index e42fbad00e..1fe2a91d57 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -281,20 +281,7 @@ static QTouchDevice *touchDevice = 0; QRect geometry; - if (self.window.parentWindow) { - return; -#if 0 - //geometry = QRectF::fromCGRect([self frame]).toRect(); - qDebug() << "nsview updateGeometry" << m_platformWindow->window(); - QRect screenRect = QRectF::fromCGRect([m_platformWindow->nativeWindow() convertRectToScreen:[self frame]]).toRect(); - qDebug() << "screenRect" << screenRect; - - screenRect.moveTop(qt_mac_flipYCoordinate(screenRect.y() + screenRect.height())); - geometry = QRect(m_platformWindow->window()->parent()->mapFromGlobal(screenRect.topLeft()), screenRect.size()); - qDebug() << "geometry" << geometry; -#endif - //geometry = QRect(screenRect.origin.x, qt_mac_flipYCoordinate(screenRect.origin.y + screenRect.size.height), screenRect.size.width, screenRect.size.height); - } else if (m_platformWindow->isContentView()) { + if (m_platformWindow->isContentView()) { // top level window, get window rect and flip y. NSRect rect = [self frame]; NSRect windowRect = [[self window] frame]; @@ -639,12 +626,6 @@ static QTouchDevice *touchDevice = 0; QPointF qtWindowPoint; QPointF qtScreenPoint; QNSView *targetView = self; - if (m_platformWindow && m_platformWindow->m_forwardWindow) { - if (theEvent.type == NSLeftMouseDragged || theEvent.type == NSLeftMouseUp) - targetView = qnsview_cast(m_platformWindow->m_forwardWindow->view()); - else - m_platformWindow->m_forwardWindow.clear(); - } if (!targetView.platformWindow) return; |