summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTimur Pocheptsov <Timur.Pocheptsov@digia.com>2014-10-21 11:05:54 +0200
committerTimur Pocheptsov <Timur.Pocheptsov@digia.com>2014-10-22 06:59:57 +0200
commit2fcc88d02131b0fd64857a2646381653b410f053 (patch)
treeba7a8aeba8d31fc4d01d3d678b1fb16b6291ede3 /src
parent963037d86b6298fd314450f933376fe589b309e6 (diff)
OS X: drag and drop and auto-scrolling
Cocoa sens periodic drag updated events even if there is no actuall mouse movement (or any other updates). This breaks animations in different views/widgets supporting our own auto-scroll (done with timers). This patch kindly asks Cocoa _not_ to send us these events. Task-number: QTBUG-32761 Change-Id: I5dad4ceb0a490e2f3cb34a806a5bdb1045b4dac3 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index 6234c0dcbe..92ab16683e 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -1822,6 +1822,19 @@ static QPoint mapWindowCoordinates(QWindow *source, QWindow *target, QPoint poin
return NO;
}
+- (BOOL)wantsPeriodicDraggingUpdates
+{
+ // From the documentation:
+ //
+ // "If the destination returns NO, these messages are sent only when the mouse moves
+ // or a modifier flag changes. Otherwise the destination gets the default behavior,
+ // where it receives periodic dragging-updated messages even if nothing changes."
+ //
+ // We do not want these constant drag update events while mouse is stationary,
+ // since we do all animations (autoscroll) with timers.
+ return NO;
+}
+
- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
{
return [self handleDrag : sender];