summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qcocoaview_mac.mm
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-11-26 16:32:51 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-12-02 16:10:55 (GMT)
commit0b2eab87ad3bd73a0744469a45c29ca098649c9b (patch)
treed5b26bc05eaf96c3b665aaf750135c7676db6002 /src/gui/kernel/qcocoaview_mac.mm
parent271936b063fb261293e3f77f7a2273e3a4dbb5d6 (diff)
downloadQt-0b2eab87ad3bd73a0744469a45c29ca098649c9b.zip
Qt-0b2eab87ad3bd73a0744469a45c29ca098649c9b.tar.gz
Qt-0b2eab87ad3bd73a0744469a45c29ca098649c9b.tar.bz2
Improved implicit mouse grabbing on Cocoa.
This improves 106121a74bca32a6411b9ca968ee415f8bdfbff1 which was incomplete and didn't work properly for comboboxes (or in general - when a popup window opens due to a mouse press). Reviewed-by: Prasanth
Diffstat (limited to 'src/gui/kernel/qcocoaview_mac.mm')
-rw-r--r--src/gui/kernel/qcocoaview_mac.mm15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm
index 3da783f..a4da25f 100644
--- a/src/gui/kernel/qcocoaview_mac.mm
+++ b/src/gui/kernel/qcocoaview_mac.mm
@@ -708,9 +708,9 @@ extern "C" {
- (void)mouseUp:(NSEvent *)theEvent
{
- qt_button_down = 0;
-
qt_mac_handleMouseEvent(self, theEvent, QEvent::MouseButtonRelease, Qt::LeftButton);
+
+ qt_button_down = 0;
}
- (void)rightMouseDown:(NSEvent *)theEvent
@@ -723,9 +723,9 @@ extern "C" {
- (void)rightMouseUp:(NSEvent *)theEvent
{
- qt_button_down = 0;
-
qt_mac_handleMouseEvent(self, theEvent, QEvent::MouseButtonRelease, Qt::RightButton);
+
+ qt_button_down = 0;
}
- (void)otherMouseDown:(NSEvent *)theEvent
@@ -739,10 +739,10 @@ extern "C" {
- (void)otherMouseUp:(NSEvent *)theEvent
{
- qt_button_down = 0;
-
Qt::MouseButton mouseButton = cocoaButton2QtButton([theEvent buttonNumber]);
qt_mac_handleMouseEvent(self, theEvent, QEvent::MouseButtonRelease, mouseButton);
+
+ qt_button_down = 0;
}
- (void)mouseDragged:(NSEvent *)theEvent
@@ -1442,6 +1442,9 @@ Qt::DropAction QDragManager::drag(QDrag *o)
pasteboard:pboard
source:dndParams.view
slideBack:YES];
+ // reset the implicit grab widget when drag ends because we will not
+ // receive the mouse release event when DND is active.
+ qt_button_down = 0;
[dndParams.view release];
[image release];
dragPrivate()->executed_action = Qt::IgnoreAction;