macOS: Improve QCocoaWindow logging a bit

Change-Id: Ic3555445b045edda884983aa01834a4ae243d6fa
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Tor Arne Vestbø 2017-07-18 12:56:22 +02:00
parent deb7f9a7c3
commit 73274860dd

View File

@ -725,11 +725,10 @@ void QCocoaWindow::propagateSizeHints()
if (!isContentView()) if (!isContentView())
return; return;
qCDebug(lcQpaCocoaWindow) << "QCocoaWindow::propagateSizeHints" << window() << "\n" qCDebug(lcQpaCocoaWindow) << "QCocoaWindow::propagateSizeHints" << window()
<< " min/max" << windowMinimumSize() << windowMaximumSize() << "min:" << windowMinimumSize() << "max:" << windowMaximumSize()
<< "size increment" << windowSizeIncrement() << "increment:" << windowSizeIncrement()
<< " basesize" << windowBaseSize() << "base:" << windowBaseSize();
<< " geometry" << windowGeometry();
const NSWindow *window = m_view.window; const NSWindow *window = m_view.window;
@ -1081,6 +1080,9 @@ void QCocoaWindow::handleWindowStateChanged(HandleFlags flags)
if (!(flags & HandleUnconditionally) && currentState == m_lastReportedWindowState) if (!(flags & HandleUnconditionally) && currentState == m_lastReportedWindowState)
return; return;
qCDebug(lcQpaCocoaWindow) << "QCocoaWindow::handleWindowStateChanged" <<
m_lastReportedWindowState << "-->" << currentState;
QWindowSystemInterface::handleWindowStateChanged<QWindowSystemInterface::SynchronousDelivery>( QWindowSystemInterface::handleWindowStateChanged<QWindowSystemInterface::SynchronousDelivery>(
window(), currentState, m_lastReportedWindowState); window(), currentState, m_lastReportedWindowState);
m_lastReportedWindowState = currentState; m_lastReportedWindowState = currentState;
@ -1173,6 +1175,7 @@ void QCocoaWindow::recreateWindowIfNeeded()
// Remove current window (if any) // Remove current window (if any)
if ((isContentView() && !shouldBeContentView) || (recreateReason & PanelChanged)) { if ((isContentView() && !shouldBeContentView) || (recreateReason & PanelChanged)) {
if (m_nsWindow) {
qCDebug(lcQpaCocoaWindow) << "Getting rid of existing window" << m_nsWindow; qCDebug(lcQpaCocoaWindow) << "Getting rid of existing window" << m_nsWindow;
[m_nsWindow closeAndRelease]; [m_nsWindow closeAndRelease];
if (isContentView()) { if (isContentView()) {
@ -1184,6 +1187,7 @@ void QCocoaWindow::recreateWindowIfNeeded()
} }
m_nsWindow = 0; m_nsWindow = 0;
} }
}
if (shouldBeContentView) { if (shouldBeContentView) {
bool noPreviousWindow = m_nsWindow == 0; bool noPreviousWindow = m_nsWindow == 0;
@ -1193,7 +1197,7 @@ void QCocoaWindow::recreateWindowIfNeeded()
// Move view to new NSWindow if needed // Move view to new NSWindow if needed
if (newWindow) { if (newWindow) {
qCDebug(lcQpaCocoaWindow) << "Ensuring that view is content view for" << m_nsWindow; qCDebug(lcQpaCocoaWindow) << "Ensuring that" << m_view << "is content view for" << newWindow;
[m_view setPostsFrameChangedNotifications:NO]; [m_view setPostsFrameChangedNotifications:NO];
[newWindow setContentView:m_view]; [newWindow setContentView:m_view];
[m_view setPostsFrameChangedNotifications:YES]; [m_view setPostsFrameChangedNotifications:YES];
@ -1245,8 +1249,6 @@ void QCocoaWindow::requestActivateWindow()
QCocoaNSWindow *QCocoaWindow::createNSWindow(bool shouldBePanel) QCocoaNSWindow *QCocoaWindow::createNSWindow(bool shouldBePanel)
{ {
qCDebug(lcQpaCocoaWindow) << "createNSWindow, shouldBePanel =" << shouldBePanel;
QMacAutoReleasePool pool; QMacAutoReleasePool pool;
QRect rect = geometry(); QRect rect = geometry();