Cocoa: Accept mouse clicks that activates windows.
authorMorten Johan Sorvig <morten.sorvig@nokia.com>
Fri, 16 Dec 2011 13:32:47 +0000 (14:32 +0100)
committerQt by Nokia <qt-info@nokia.com>
Fri, 16 Dec 2011 13:57:04 +0000 (14:57 +0100)
Events for mouse clicks that active windows are by
default suppressed. Qt needs to see all events in
order to properly close popup windows.

Wether or not the event should be sent to the
target needs to be implemented later on - in the
QWidget world this is controlled by WA_MacNoClickThrough

Change-Id: I4b96d33978ed2b3cb793f52bb5b6fef234190a00
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@nokia.com>
src/plugins/platforms/cocoa/qnsview.mm

index 436069c..da6f894 100644 (file)
@@ -207,6 +207,11 @@ static QTouchDevice *touchDevice = 0;
     return YES;
 }
 
+- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent
+{
+    return YES;
+}
+
 - (void)handleMouseEvent:(NSEvent *)theEvent
 {
     // Calculate the mouse position in the QWindow and Qt screen coordinate system,