diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2018-01-22 17:28:10 +0100 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@qt.io> | 2018-02-01 13:07:03 +0000 |
commit | 7d1962cada48f8c351909d1ccc14b13c3adaa542 (patch) | |
tree | bb19cb2b58bb321f781d977bf053347435e76412 /src/plugins/platforms/cocoa/qnsview.h | |
parent | 9f065554ffea0e3716b76e4bee4a60f0044193ce (diff) |
macOS: Handle update requests via setNeedsDisplay more carefully
Instead of trying to detect situations where we need to send a real
expose event instead of an update request in response to a drawRect
call, we keep track of when we've asked the view to display due to
a requestUpdate call, and only deliver the corresponding drawRect
as an update request if no other code has asked the view to
display.
This should cover all cases of asking the view to display, issued
from our code or from AppKit, such as the view changing its backing
scale factor, or otherwise needing a real expose event.
Task-number: QTBUG-65663
Change-Id: I1783787823aee889dad8e48f34a1cb0f1b7b06bd
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa/qnsview.h')
-rw-r--r-- | src/plugins/platforms/cocoa/qnsview.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview.h b/src/plugins/platforms/cocoa/qnsview.h index f8903725a6..e2ea862cd5 100644 --- a/src/plugins/platforms/cocoa/qnsview.h +++ b/src/plugins/platforms/cocoa/qnsview.h @@ -81,6 +81,7 @@ Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper)); NSEvent *m_currentlyInterpretedKeyEvent; bool m_isMenuView; QSet<quint32> m_acceptedKeyDowns; + bool m_updateRequested; } @property (nonatomic, retain) NSCursor *cursor; @@ -105,6 +106,8 @@ Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper)); - (void)resetMouseButtons; +- (void)requestUpdate; + - (void)handleMouseEvent:(NSEvent *)theEvent; - (bool)handleMouseDownEvent:(NSEvent *)theEvent withButton:(int)buttonNumber; - (bool)handleMouseDraggedEvent:(NSEvent *)theEvent withButton:(int)buttonNumber; |