From 63c7ceaf1b352efa4c6d5a6be96819d6e013e2a4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= <morten.sorvig@digia.com>
Date: Thu, 30 Oct 2014 17:00:03 +0100
Subject: [PATCH] Revert "OS X - unified toolbar and AA_NativeWindows"

Will be fixed in a different way.

This reverts commit ae5f3df59b37e0ce8aaef27dc1e02f40def340ae.

Change-Id: Ie706396667a5b6c9003bb92a018d88346a180e65
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
---
 src/plugins/platforms/cocoa/qnsview.mm | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index de30972393c..09368fa25e7 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -676,23 +676,7 @@ static NSString *_q_NSWindowDidChangeOcclusionStateNotification = nil;
             m_platformWindow->m_forwardWindow = 0;
     }
 
-    NSPoint globalPos = [NSEvent mouseLocation];
-
-    if ([self.window parentWindow]
-        && (theEvent.type == NSLeftMouseDragged || theEvent.type == NSLeftMouseUp)) {
-        // QToolBar can be implemented as a child window on top of its main window
-        // (with a borderless NSWindow). If an option "unified toolbar" set on the main window,
-        // it's possible to drag such a window using this toolbar.
-        // While handling mouse drag events, QToolBar moves the window (QWidget::move).
-        // In such a combination [NSEvent mouseLocation] is very different from the
-        // real event location and as a result a window will move chaotically.
-        NSPoint winPoint = [theEvent locationInWindow];
-        NSRect tmpRect = NSMakeRect(winPoint.x, winPoint.y, 1., 1.);
-        tmpRect = [[theEvent window] convertRectToScreen:tmpRect];
-        globalPos = tmpRect.origin;
-    }
-
-    [targetView convertFromScreen:globalPos toWindowPoint:&qtWindowPoint andScreenPoint:&qtScreenPoint];
+    [targetView convertFromScreen:[NSEvent mouseLocation] toWindowPoint:&qtWindowPoint andScreenPoint:&qtScreenPoint];
     ulong timestamp = [theEvent timestamp] * 1000;
 
     QCocoaDrag* nativeDrag = QCocoaIntegration::instance()->drag();
-- 
GitLab