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>bb10
parent
1a5d3a7300
commit
17e29fada4
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue