diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2018-02-13 17:51:53 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2018-02-13 18:04:56 +0000 |
commit | 76010f4af8c9a59a20c489d70c7f99b802f9721f (patch) | |
tree | 15541fe6a7561e6deedd360fed3ab38fbf3011f5 | |
parent | cf4a6111150d866424ee07bda80a1d38f24ea02d (diff) |
macOS: Add more granular logging categories for window events
Change-Id: I202e2cecfb5438ba9edc82efaf80b6ecebafb835
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoahelpers.h | 2 | ||||
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoahelpers.mm | 2 | ||||
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoawindow.mm | 6 | ||||
-rw-r--r-- | src/plugins/platforms/cocoa/qnsview.mm | 8 |
4 files changed, 11 insertions, 7 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.h b/src/plugins/platforms/cocoa/qcocoahelpers.h index 2c4783b1e3..84632c1487 100644 --- a/src/plugins/platforms/cocoa/qcocoahelpers.h +++ b/src/plugins/platforms/cocoa/qcocoahelpers.h @@ -63,6 +63,8 @@ Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QNSView)); QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaCocoaWindow) +Q_DECLARE_LOGGING_CATEGORY(lcQpaCocoaDrawing) +Q_DECLARE_LOGGING_CATEGORY(lcQpaCocoaMouse) class QPixmap; class QString; diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.mm b/src/plugins/platforms/cocoa/qcocoahelpers.mm index fdf4733f0e..b729c7f4c0 100644 --- a/src/plugins/platforms/cocoa/qcocoahelpers.mm +++ b/src/plugins/platforms/cocoa/qcocoahelpers.mm @@ -58,6 +58,8 @@ QT_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcQpaCocoaWindow, "qt.qpa.cocoa.window"); +Q_LOGGING_CATEGORY(lcQpaCocoaDrawing, "qt.qpa.cocoa.drawing"); +Q_LOGGING_CATEGORY(lcQpaCocoaMouse, "qt.qpa.cocoa.mouse"); // // Conversion Functions diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index c000c90a85..562872a300 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -1163,7 +1163,7 @@ void QCocoaWindow::handleExposeEvent(const QRegion ®ion) // rect as a real expose event (including going from non-exposed to // exposed). FIXME: Should this logic live in QGuiApplication? if (isExposed() && m_exposedRect == previouslyExposedRect) { - qCDebug(lcQpaCocoaWindow) << "QCocoaWindow::handleExposeEvent" << window() << region << "as update request"; + qCDebug(lcQpaCocoaDrawing) << "QCocoaWindow::handleExposeEvent" << window() << region << "as update request"; windowPrivate->deliverUpdateRequest(); return; } else { @@ -1173,7 +1173,7 @@ void QCocoaWindow::handleExposeEvent(const QRegion ®ion) } } - qCDebug(lcQpaCocoaWindow) << "QCocoaWindow::handleExposeEvent" << window() << region << "isExposed" << isExposed(); + qCDebug(lcQpaCocoaDrawing) << "QCocoaWindow::handleExposeEvent" << window() << region << "isExposed" << isExposed(); QWindowSystemInterface::handleExposeEvent<QWindowSystemInterface::SynchronousDelivery>(window(), region); } @@ -1346,7 +1346,7 @@ void QCocoaWindow::recreateWindowIfNeeded() void QCocoaWindow::requestUpdate() { - qCDebug(lcQpaCocoaWindow) << "QCocoaWindow::requestUpdate" << window(); + qCDebug(lcQpaCocoaDrawing) << "QCocoaWindow::requestUpdate" << window(); [m_view setNeedsDisplay:YES]; } diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index 32f73759c2..216b2f1287 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -314,7 +314,7 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet") for (int i = 0; i < numDirtyRects; ++i) exposedRegion += QRectF::fromCGRect(dirtyRects[i]).toRect(); - qCDebug(lcQpaCocoaWindow) << "[QNSView drawRect:]" << m_platformWindow->window() << exposedRegion; + qCDebug(lcQpaCocoaDrawing) << "[QNSView drawRect:]" << m_platformWindow->window() << exposedRegion; #ifndef QT_NO_OPENGL if (m_glContext && m_shouldSetGLContextinDrawRect) { @@ -331,7 +331,7 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet") // 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(lcQpaCocoaWindow) << "[QNSView drawRect:] issuing deferred setNeedsDisplay due to pending update request"; + qCDebug(lcQpaCocoaDrawing) << "[QNSView drawRect:] issuing deferred setNeedsDisplay due to pending update request"; dispatch_async(dispatch_get_main_queue (), ^{ [self setNeedsDisplay:YES]; }); @@ -348,7 +348,7 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet") if (!m_platformWindow) return; - qCDebug(lcQpaCocoaWindow) << "[QNSView updateLayer]" << m_platformWindow->window(); + qCDebug(lcQpaCocoaDrawing) << "[QNSView updateLayer]" << m_platformWindow->window(); // FIXME: Find out if there's a way to resolve the dirty rect like in drawRect: m_platformWindow->handleExposeEvent(QRectF::fromCGRect(self.bounds).toRect()); @@ -787,7 +787,7 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet") - (void)cursorUpdate:(NSEvent *)theEvent { - qCDebug(lcQpaCocoaWindow) << "[QNSView cursorUpdate:]" << self.cursor; + qCDebug(lcQpaCocoaMouse) << "[QNSView cursorUpdate:]" << self.cursor; // Note: We do not get this callback when moving from a subview that // uses the legacy cursorRect API, so the cursor is reset to the arrow |