summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2018-07-03 14:47:27 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2018-07-09 16:46:49 +0000
commit17e29fada46ac8a941227d9ea5b9342e02d3d367 (patch)
tree3dda8a0eea6f6220ebd05aa584f484ef339b5282 /src/plugins
parent1a5d3a7300e5188e1406ed88871ba42a8200860c (diff)
macOS: Remove dead updateRequest code based on setNeedsDisplay
We're no longer using this code path for QWindow::requestUpdate() Change-Id: I000304a4f1a6ea2c3a4e8268ae978dedd968e07c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/cocoa/qnsview.h1
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm2
-rw-r--r--src/plugins/platforms/cocoa/qnsview_drawing.mm36
3 files changed, 1 insertions, 38 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview.h b/src/plugins/platforms/cocoa/qnsview.h
index f7ca41d3be..67debef7b8 100644
--- a/src/plugins/platforms/cocoa/qnsview.h
+++ b/src/plugins/platforms/cocoa/qnsview.h
@@ -65,7 +65,6 @@ Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QCocoaNSMenuItem));
@end
@interface QT_MANGLE_NAMESPACE(QNSView) (DrawingAPI)
-- (void)requestUpdate;
#ifndef QT_NO_OPENGL
- (void)setQCocoaGLContext:(QCocoaGLContext *)context;
#endif
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index c89281c1a4..dd9af3668a 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -133,7 +133,6 @@
bool m_updatingDrag;
NSEvent *m_currentlyInterpretedKeyEvent;
QSet<quint32> m_acceptedKeyDowns;
- bool m_updateRequested;
}
- (instancetype)initWithCocoaWindow:(QCocoaWindow *)platformWindow
@@ -155,7 +154,6 @@
m_scrolling = false;
m_updatingDrag = false;
m_currentlyInterpretedKeyEvent = nil;
- m_updateRequested = false;
m_dontOverrideCtrlLMB = qt_mac_resolveOption(false, platformWindow->window(),
"_q_platform_MacDontOverrideCtrlLMB", "QT_MAC_DONT_OVERRIDE_CTRL_LMB");
m_trackingArea = nil;
diff --git a/src/plugins/platforms/cocoa/qnsview_drawing.mm b/src/plugins/platforms/cocoa/qnsview_drawing.mm
index 0ad7844d56..8ebe27f0c2 100644
--- a/src/plugins/platforms/cocoa/qnsview_drawing.mm
+++ b/src/plugins/platforms/cocoa/qnsview_drawing.mm
@@ -41,19 +41,6 @@
@implementation QT_MANGLE_NAMESPACE(QNSView) (DrawingAPI)
-- (void)requestUpdate
-{
- if (self.needsDisplay) {
- // If the view already has needsDisplay set it means that there may be code waiting for
- // a real expose event, so we can't issue setNeedsDisplay now as a way to trigger an
- // update request. We will re-trigger requestUpdate from drawRect.
- return;
- }
-
- [self setNeedsDisplay:YES];
- m_updateRequested = true;
-}
-
#ifndef QT_NO_OPENGL
- (void)setQCocoaGLContext:(QCocoaGLContext *)context
{
@@ -82,12 +69,6 @@
return YES;
}
-- (void)setNeedsDisplayInRect:(NSRect)rect
-{
- [super setNeedsDisplayInRect:rect];
- m_updateRequested = false;
-}
-
- (void)drawRect:(NSRect)dirtyRect
{
Q_UNUSED(dirtyRect);
@@ -115,22 +96,7 @@
}
#endif
- if (m_updateRequested) {
- Q_ASSERT(m_platformWindow->hasPendingUpdateRequest());
- m_platformWindow->deliverUpdateRequest();
- m_updateRequested = false;
- } else {
- m_platformWindow->handleExposeEvent(dirtyRegion);
- }
-
- if (m_updateRequested && m_platformWindow->hasPendingUpdateRequest()) {
- // A call to QWindow::requestUpdate was issued during event delivery above,
- // but AppKit will reset the needsDisplay state of the view after completing
- // the current display cycle, so we need to defer the request to redisplay.
- // FIXME: Perhaps this should be a trigger to enable CADisplayLink?
- qCDebug(lcQpaDrawing) << "[QNSView drawRect:] issuing deferred setNeedsDisplay due to pending update request";
- dispatch_async(dispatch_get_main_queue (), ^{ [self requestUpdate]; });
- }
+ m_platformWindow->handleExposeEvent(dirtyRegion);
}
- (BOOL)shouldUseMetalLayer