Windows: Align QWindowsWindow logging category name with other platforms

Other platforms name it singular 'qt.qpa.window'.

Change-Id: I668ed67e1686605fe5f77313c7a01c31fd574c32
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This commit is contained in:
Tor Arne Vestbø 2022-07-04 15:29:49 +02:00
parent b5d5385201
commit 836c7f2b30
5 changed files with 51 additions and 51 deletions

View File

@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals; using namespace Qt::StringLiterals;
Q_LOGGING_CATEGORY(lcQpaWindows, "qt.qpa.windows") Q_LOGGING_CATEGORY(lcQpaWindow, "qt.qpa.window")
Q_LOGGING_CATEGORY(lcQpaEvents, "qt.qpa.events") Q_LOGGING_CATEGORY(lcQpaEvents, "qt.qpa.events")
Q_LOGGING_CATEGORY(lcQpaGl, "qt.qpa.gl") Q_LOGGING_CATEGORY(lcQpaGl, "qt.qpa.gl")
Q_LOGGING_CATEGORY(lcQpaMime, "qt.qpa.mime") Q_LOGGING_CATEGORY(lcQpaMime, "qt.qpa.mime")
@ -372,11 +372,11 @@ int QWindowsContext::processDpiAwareness()
void QWindowsContext::setProcessDpiAwareness(QtWindows::ProcessDpiAwareness dpiAwareness) void QWindowsContext::setProcessDpiAwareness(QtWindows::ProcessDpiAwareness dpiAwareness)
{ {
qCDebug(lcQpaWindows) << __FUNCTION__ << dpiAwareness; qCDebug(lcQpaWindow) << __FUNCTION__ << dpiAwareness;
const HRESULT hr = SetProcessDpiAwareness(static_cast<PROCESS_DPI_AWARENESS>(dpiAwareness)); const HRESULT hr = SetProcessDpiAwareness(static_cast<PROCESS_DPI_AWARENESS>(dpiAwareness));
// E_ACCESSDENIED means set externally (MSVC manifest or external app loading Qt plugin). // E_ACCESSDENIED means set externally (MSVC manifest or external app loading Qt plugin).
// Silence warning in that case unless debug is enabled. // Silence warning in that case unless debug is enabled.
if (FAILED(hr) && (hr != E_ACCESSDENIED || lcQpaWindows().isDebugEnabled())) { if (FAILED(hr) && (hr != E_ACCESSDENIED || lcQpaWindow().isDebugEnabled())) {
qWarning().noquote().nospace() << "SetProcessDpiAwareness(" qWarning().noquote().nospace() << "SetProcessDpiAwareness("
<< dpiAwareness << ") failed: " << QWindowsContext::comErrorString(hr) << dpiAwareness << ") failed: " << QWindowsContext::comErrorString(hr)
<< ", using " << QWindowsContext::processDpiAwareness(); << ", using " << QWindowsContext::processDpiAwareness();
@ -385,11 +385,11 @@ void QWindowsContext::setProcessDpiAwareness(QtWindows::ProcessDpiAwareness dpiA
bool QWindowsContext::setProcessDpiV2Awareness() bool QWindowsContext::setProcessDpiV2Awareness()
{ {
qCDebug(lcQpaWindows) << __FUNCTION__; qCDebug(lcQpaWindow) << __FUNCTION__;
const BOOL ok = SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2); const BOOL ok = SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
if (!ok) { if (!ok) {
const HRESULT errorCode = GetLastError(); const HRESULT errorCode = GetLastError();
qCWarning(lcQpaWindows).noquote().nospace() << "setProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2) failed: " qCWarning(lcQpaWindow).noquote().nospace() << "setProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2) failed: "
<< QWindowsContext::comErrorString(errorCode); << QWindowsContext::comErrorString(errorCode);
return false; return false;
} }
@ -591,7 +591,7 @@ QString QWindowsContext::registerWindowClass(QString cname,
qPrintable(cname)); qPrintable(cname));
d->m_registeredWindowClassNames.insert(cname); d->m_registeredWindowClassNames.insert(cname);
qCDebug(lcQpaWindows).nospace() << __FUNCTION__ << ' ' << cname qCDebug(lcQpaWindow).nospace() << __FUNCTION__ << ' ' << cname
<< " style=0x" << Qt::hex << style << Qt::dec << " style=0x" << Qt::hex << style << Qt::dec
<< " brush=" << brush << " icon=" << icon << " atom=" << atom; << " brush=" << brush << " icon=" << icon << " atom=" << atom;
return cname; return cname;
@ -1564,7 +1564,7 @@ extern "C" LRESULT QT_WIN_CALLBACK qWindowsWndProc(HWND hwnd, UINT message, WPAR
marginsFromRects(ncCalcSizeFrame, rectFromNcCalcSize(message, wParam, lParam, 0)); marginsFromRects(ncCalcSizeFrame, rectFromNcCalcSize(message, wParam, lParam, 0));
if (margins.left() >= 0) { if (margins.left() >= 0) {
if (platformWindow) { if (platformWindow) {
qCDebug(lcQpaWindows) << __FUNCTION__ << "WM_NCCALCSIZE for" << hwnd << margins; qCDebug(lcQpaWindow) << __FUNCTION__ << "WM_NCCALCSIZE for" << hwnd << margins;
platformWindow->setFullFrameMargins(margins); platformWindow->setFullFrameMargins(margins);
} else { } else {
const QSharedPointer<QWindowCreationContext> ctx = QWindowsContext::instance()->windowCreationContext(); const QSharedPointer<QWindowCreationContext> ctx = QWindowsContext::instance()->windowCreationContext();

View File

@ -20,7 +20,7 @@ struct _SHSTOCKICONINFO;
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
Q_DECLARE_LOGGING_CATEGORY(lcQpaWindows) Q_DECLARE_LOGGING_CATEGORY(lcQpaWindow)
Q_DECLARE_LOGGING_CATEGORY(lcQpaEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaEvents)
Q_DECLARE_LOGGING_CATEGORY(lcQpaGl) Q_DECLARE_LOGGING_CATEGORY(lcQpaGl)
Q_DECLARE_LOGGING_CATEGORY(lcQpaMime) Q_DECLARE_LOGGING_CATEGORY(lcQpaMime)

View File

@ -229,7 +229,7 @@ void QWindowsIntegrationPrivate::parseOptions(QWindowsIntegration *q, const QStr
if (dpiAwareness == QtWindows::ProcessPerMonitorV2DpiAware) { if (dpiAwareness == QtWindows::ProcessPerMonitorV2DpiAware) {
// DpiAwareV2 requires using new API // DpiAwareV2 requires using new API
if (m_context.setProcessDpiV2Awareness()) { if (m_context.setProcessDpiV2Awareness()) {
qCDebug(lcQpaWindows, "DpiAwareness: DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2"); qCDebug(lcQpaWindow, "DpiAwareness: DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2");
dpiAwarenessSet = true; dpiAwarenessSet = true;
} else { } else {
// fallback to old API // fallback to old API
@ -239,7 +239,7 @@ void QWindowsIntegrationPrivate::parseOptions(QWindowsIntegration *q, const QStr
if (!dpiAwarenessSet) { if (!dpiAwarenessSet) {
m_context.setProcessDpiAwareness(dpiAwareness); m_context.setProcessDpiAwareness(dpiAwareness);
qCDebug(lcQpaWindows) << "DpiAwareness=" << dpiAwareness qCDebug(lcQpaWindow) << "DpiAwareness=" << dpiAwareness
<< "effective process DPI awareness=" << QWindowsContext::processDpiAwareness(); << "effective process DPI awareness=" << QWindowsContext::processDpiAwareness();
} }
} }
@ -318,7 +318,7 @@ QPlatformWindow *QWindowsIntegration::createPlatformWindow(QWindow *window) cons
{ {
if (window->type() == Qt::Desktop) { if (window->type() == Qt::Desktop) {
auto *result = new QWindowsDesktopWindow(window); auto *result = new QWindowsDesktopWindow(window);
qCDebug(lcQpaWindows) << "Desktop window:" << window qCDebug(lcQpaWindow) << "Desktop window:" << window
<< Qt::showbase << Qt::hex << result->winId() << Qt::noshowbase << Qt::dec << result->geometry(); << Qt::showbase << Qt::hex << result->winId() << Qt::noshowbase << Qt::dec << result->geometry();
return result; return result;
} }
@ -336,7 +336,7 @@ QPlatformWindow *QWindowsIntegration::createPlatformWindow(QWindow *window) cons
QWindowsWindowData obtained = QWindowsWindowData obtained =
QWindowsWindowData::create(window, requested, QWindowsWindowData::create(window, requested,
QWindowsWindow::formatWindowTitle(window->title())); QWindowsWindow::formatWindowTitle(window->title()));
qCDebug(lcQpaWindows).nospace() qCDebug(lcQpaWindow).nospace()
<< __FUNCTION__ << ' ' << window << __FUNCTION__ << ' ' << window
<< "\n Requested: " << requested.geometry << " frame incl.=" << "\n Requested: " << requested.geometry << " frame incl.="
<< QWindowsGeometryHint::positionIncludesFrame(window) << QWindowsGeometryHint::positionIncludesFrame(window)
@ -373,7 +373,7 @@ QPlatformWindow *QWindowsIntegration::createForeignWindow(QWindow *window, WId n
screen = pScreen->screen(); screen = pScreen->screen();
if (screen && screen != window->screen()) if (screen && screen != window->screen())
window->setScreen(screen); window->setScreen(screen);
qCDebug(lcQpaWindows) << "Foreign window:" << window << Qt::showbase << Qt::hex qCDebug(lcQpaWindow) << "Foreign window:" << window << Qt::showbase << Qt::hex
<< result->winId() << Qt::noshowbase << Qt::dec << obtainedGeometry << screen; << result->winId() << Qt::noshowbase << Qt::dec << obtainedGeometry << screen;
return result; return result;
} }

View File

@ -658,7 +658,7 @@ void QWindowsTheme::refreshFonts()
NONCLIENTMETRICS ncm; NONCLIENTMETRICS ncm;
auto &screenManager = QWindowsContext::instance()->screenManager(); auto &screenManager = QWindowsContext::instance()->screenManager();
QWindowsContext::nonClientMetricsForScreen(&ncm, screenManager.screens().value(0)); QWindowsContext::nonClientMetricsForScreen(&ncm, screenManager.screens().value(0));
qCDebug(lcQpaWindows) << __FUNCTION__ << ncm; qCDebug(lcQpaWindow) << __FUNCTION__ << ncm;
const QFont menuFont = QWindowsFontDatabase::LOGFONT_to_QFont(ncm.lfMenuFont); const QFont menuFont = QWindowsFontDatabase::LOGFONT_to_QFont(ncm.lfMenuFont);
const QFont messageBoxFont = QWindowsFontDatabase::LOGFONT_to_QFont(ncm.lfMessageFont); const QFont messageBoxFont = QWindowsFontDatabase::LOGFONT_to_QFont(ncm.lfMessageFont);
const QFont statusFont = QWindowsFontDatabase::LOGFONT_to_QFont(ncm.lfStatusFont); const QFont statusFont = QWindowsFontDatabase::LOGFONT_to_QFont(ncm.lfStatusFont);
@ -731,7 +731,7 @@ void QWindowsTheme::refreshIconPixmapSizes()
int *availEnd = fileIconSizes + LargeFileIcon + 1; int *availEnd = fileIconSizes + LargeFileIcon + 1;
#endif // USE_IIMAGELIST #endif // USE_IIMAGELIST
m_fileIconSizes = QAbstractFileIconEngine::toSizeList(fileIconSizes, availEnd); m_fileIconSizes = QAbstractFileIconEngine::toSizeList(fileIconSizes, availEnd);
qCDebug(lcQpaWindows) << __FUNCTION__ << m_fileIconSizes; qCDebug(lcQpaWindow) << __FUNCTION__ << m_fileIconSizes;
} }
// Defined in qpixmap_win.cpp // Defined in qpixmap_win.cpp

View File

@ -891,7 +891,7 @@ QWindowsWindowData
QMargins invMargins = topLevel && hasFrame && QWindowsGeometryHint::positionIncludesFrame(w) QMargins invMargins = topLevel && hasFrame && QWindowsGeometryHint::positionIncludesFrame(w)
? invisibleMargins(QPoint(context->frameX, context->frameY)) : QMargins(); ? invisibleMargins(QPoint(context->frameX, context->frameY)) : QMargins();
qCDebug(lcQpaWindows).nospace() qCDebug(lcQpaWindow).nospace()
<< "CreateWindowEx: " << w << " class=" << windowClassName << " title=" << title << "CreateWindowEx: " << w << " class=" << windowClassName << " title=" << title
<< '\n' << *this << "\nrequested: " << rect << ": " << '\n' << *this << "\nrequested: " << rect << ": "
<< context->frameWidth << 'x' << context->frameHeight << context->frameWidth << 'x' << context->frameHeight
@ -917,7 +917,7 @@ QWindowsWindowData
pos.x(), pos.y(), pos.x(), pos.y(),
context->frameWidth, context->frameHeight, context->frameWidth, context->frameHeight,
parentHandle, nullptr, appinst, nullptr); parentHandle, nullptr, appinst, nullptr);
qCDebug(lcQpaWindows).nospace() qCDebug(lcQpaWindow).nospace()
<< "CreateWindowEx: returns " << w << ' ' << result.hwnd << " obtained geometry: " << "CreateWindowEx: returns " << w << ' ' << result.hwnd << " obtained geometry: "
<< context->obtainedPos << context->obtainedSize << ' ' << context->margins; << context->obtainedPos << context->obtainedSize << ' ' << context->margins;
@ -960,7 +960,7 @@ void WindowCreationData::applyWindowFlags(HWND hwnd) const
const LONG_PTR newExStyle = exStyle; const LONG_PTR newExStyle = exStyle;
if (newExStyle != oldExStyle) if (newExStyle != oldExStyle)
SetWindowLongPtr(hwnd, GWL_EXSTYLE, newExStyle); SetWindowLongPtr(hwnd, GWL_EXSTYLE, newExStyle);
qCDebug(lcQpaWindows).nospace() << __FUNCTION__ << hwnd << *this qCDebug(lcQpaWindow).nospace() << __FUNCTION__ << hwnd << *this
<< "\n Style from " << debugWinStyle(DWORD(oldStyle)) << "\n to " << "\n Style from " << debugWinStyle(DWORD(oldStyle)) << "\n to "
<< debugWinStyle(DWORD(newStyle)) << "\n ExStyle from " << debugWinStyle(DWORD(newStyle)) << "\n ExStyle from "
<< debugWinExStyle(DWORD(oldExStyle)) << " to " << debugWinExStyle(DWORD(oldExStyle)) << " to "
@ -1034,7 +1034,7 @@ QMargins QWindowsGeometryHint::frameOnPrimaryScreen(const QWindow *w, DWORD styl
qErrnoWarning("%s: AdjustWindowRectEx failed", __FUNCTION__); qErrnoWarning("%s: AdjustWindowRectEx failed", __FUNCTION__);
const QMargins result(qAbs(rect.left), qAbs(rect.top), const QMargins result(qAbs(rect.left), qAbs(rect.top),
qAbs(rect.right), qAbs(rect.bottom)); qAbs(rect.right), qAbs(rect.bottom));
qCDebug(lcQpaWindows).nospace() << __FUNCTION__ << " style=" qCDebug(lcQpaWindow).nospace() << __FUNCTION__ << " style="
<< Qt::showbase << Qt::hex << style << " exStyle=" << exStyle << Qt::dec << Qt::noshowbase << Qt::showbase << Qt::hex << style << " exStyle=" << exStyle << Qt::dec << Qt::noshowbase
<< ' ' << rect << ' ' << result; << ' ' << rect << ' ' << result;
return result; return result;
@ -1059,7 +1059,7 @@ QMargins QWindowsGeometryHint::frame(const QWindow *w, DWORD style, DWORD exStyl
} }
const QMargins result(qAbs(rect.left), qAbs(rect.top), const QMargins result(qAbs(rect.left), qAbs(rect.top),
qAbs(rect.right), qAbs(rect.bottom)); qAbs(rect.right), qAbs(rect.bottom));
qCDebug(lcQpaWindows).nospace() << __FUNCTION__ << " style=" qCDebug(lcQpaWindow).nospace() << __FUNCTION__ << " style="
<< Qt::showbase << Qt::hex << style << " exStyle=" << exStyle << Qt::dec << Qt::noshowbase << Qt::showbase << Qt::hex << style << " exStyle=" << exStyle << Qt::dec << Qt::noshowbase
<< " dpi=" << dpi << " dpi=" << dpi
<< ' ' << rect << ' ' << result; << ' ' << rect << ' ' << result;
@ -1121,7 +1121,7 @@ bool QWindowsGeometryHint::handleCalculateSize(const QMargins &customMargins, co
ncp->rgrc[0].right -= customMargins.right(); ncp->rgrc[0].right -= customMargins.right();
ncp->rgrc[0].bottom -= customMargins.bottom(); ncp->rgrc[0].bottom -= customMargins.bottom();
result = nullptr; result = nullptr;
qCDebug(lcQpaWindows).nospace() << __FUNCTION__ << oldClientArea << '+' << customMargins << "-->" qCDebug(lcQpaWindow).nospace() << __FUNCTION__ << oldClientArea << '+' << customMargins << "-->"
<< ncp->rgrc[0] << ' ' << ncp->rgrc[1] << ' ' << ncp->rgrc[2] << ncp->rgrc[0] << ' ' << ncp->rgrc[1] << ' ' << ncp->rgrc[2]
<< ' ' << ncp->lppos->cx << ',' << ncp->lppos->cy; << ' ' << ncp->lppos->cx << ',' << ncp->lppos->cy;
return true; return true;
@ -1157,7 +1157,7 @@ void QWindowsGeometryHint::applyToMinMaxInfo(const QWindow *w,
QSize minimumSize; QSize minimumSize;
QSize maximumSize; QSize maximumSize;
frameSizeConstraints(w, screen, margins, &minimumSize, &maximumSize); frameSizeConstraints(w, screen, margins, &minimumSize, &maximumSize);
qCDebug(lcQpaWindows).nospace() << '>' << __FUNCTION__ << '<' << " min=" qCDebug(lcQpaWindow).nospace() << '>' << __FUNCTION__ << '<' << " min="
<< minimumSize.width() << ',' << minimumSize.height() << minimumSize.width() << ',' << minimumSize.height()
<< " max=" << maximumSize.width() << ',' << maximumSize.height() << " max=" << maximumSize.width() << ',' << maximumSize.height()
<< " margins=" << margins << " margins=" << margins
@ -1172,7 +1172,7 @@ void QWindowsGeometryHint::applyToMinMaxInfo(const QWindow *w,
mmi->ptMaxTrackSize.x = maximumSize.width(); mmi->ptMaxTrackSize.x = maximumSize.width();
if (maximumSize.height() < QWINDOWSIZE_MAX) if (maximumSize.height() < QWINDOWSIZE_MAX)
mmi->ptMaxTrackSize.y = maximumSize.height(); mmi->ptMaxTrackSize.y = maximumSize.height();
qCDebug(lcQpaWindows).nospace() << '<' << __FUNCTION__ << " out " << *mmi; qCDebug(lcQpaWindow).nospace() << '<' << __FUNCTION__ << " out " << *mmi;
} }
void QWindowsGeometryHint::applyToMinMaxInfo(const QWindow *w, void QWindowsGeometryHint::applyToMinMaxInfo(const QWindow *w,
@ -1268,7 +1268,7 @@ void QWindowsBaseWindow::hide_sys() // Normal hide, do not activate other window
void QWindowsBaseWindow::raise_sys() void QWindowsBaseWindow::raise_sys()
{ {
qCDebug(lcQpaWindows) << __FUNCTION__ << this << window(); qCDebug(lcQpaWindow) << __FUNCTION__ << this << window();
const Qt::WindowType type = window()->type(); const Qt::WindowType type = window()->type();
if (type == Qt::Popup if (type == Qt::Popup
|| type == Qt::SubWindow // Special case for QTBUG-63121: MDI subwindows with WindowStaysOnTopHint || type == Qt::SubWindow // Special case for QTBUG-63121: MDI subwindows with WindowStaysOnTopHint
@ -1279,14 +1279,14 @@ void QWindowsBaseWindow::raise_sys()
void QWindowsBaseWindow::lower_sys() void QWindowsBaseWindow::lower_sys()
{ {
qCDebug(lcQpaWindows) << __FUNCTION__ << this << window(); qCDebug(lcQpaWindow) << __FUNCTION__ << this << window();
if (!(window()->flags() & Qt::WindowStaysOnTopHint)) if (!(window()->flags() & Qt::WindowStaysOnTopHint))
SetWindowPos(handle(), HWND_BOTTOM, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE); SetWindowPos(handle(), HWND_BOTTOM, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
} }
void QWindowsBaseWindow::setWindowTitle_sys(const QString &title) void QWindowsBaseWindow::setWindowTitle_sys(const QString &title)
{ {
qCDebug(lcQpaWindows) << __FUNCTION__ << this << window() << title; qCDebug(lcQpaWindow) << __FUNCTION__ << this << window() << title;
SetWindowText(handle(), reinterpret_cast<const wchar_t *>(title.utf16())); SetWindowText(handle(), reinterpret_cast<const wchar_t *>(title.utf16()));
} }
@ -1353,7 +1353,7 @@ void QWindowsForeignWindow::setParent(const QPlatformWindow *newParentWindow)
const HWND newParent = newParentWindow ? reinterpret_cast<HWND>(newParentWindow->winId()) : HWND(nullptr); const HWND newParent = newParentWindow ? reinterpret_cast<HWND>(newParentWindow->winId()) : HWND(nullptr);
const bool isTopLevel = !newParent; const bool isTopLevel = !newParent;
const DWORD oldStyle = style(); const DWORD oldStyle = style();
qCDebug(lcQpaWindows) << __FUNCTION__ << window() << "newParent=" qCDebug(lcQpaWindow) << __FUNCTION__ << window() << "newParent="
<< newParentWindow << newParent << "oldStyle=" << debugWinStyle(oldStyle); << newParentWindow << newParent << "oldStyle=" << debugWinStyle(oldStyle);
SetParent(m_hwnd, newParent); SetParent(m_hwnd, newParent);
if (wasTopLevel != isTopLevel) { // Top level window flags need to be set/cleared manually. if (wasTopLevel != isTopLevel) { // Top level window flags need to be set/cleared manually.
@ -1371,7 +1371,7 @@ void QWindowsForeignWindow::setParent(const QPlatformWindow *newParentWindow)
void QWindowsForeignWindow::setVisible(bool visible) void QWindowsForeignWindow::setVisible(bool visible)
{ {
qCDebug(lcQpaWindows) << __FUNCTION__ << window() << visible; qCDebug(lcQpaWindow) << __FUNCTION__ << window() << visible;
if (visible) if (visible)
ShowWindow(handle(), SW_SHOWNOACTIVATE); ShowWindow(handle(), SW_SHOWNOACTIVATE);
else else
@ -1433,7 +1433,7 @@ QWindowCreationContext::QWindowCreationContext(const QWindow *w, const QScreen *
} }
} }
qCDebug(lcQpaWindows).nospace() qCDebug(lcQpaWindow).nospace()
<< __FUNCTION__ << ' ' << w << ' ' << geometry << __FUNCTION__ << ' ' << w << ' ' << geometry
<< " pos incl. frame=" << QWindowsGeometryHint::positionIncludesFrame(w) << " pos incl. frame=" << QWindowsGeometryHint::positionIncludesFrame(w)
<< " frame=" << frameWidth << 'x' << frameHeight << '+' << " frame=" << frameWidth << 'x' << frameHeight << '+'
@ -1569,7 +1569,7 @@ void QWindowsWindow::fireFullExpose(bool force)
void QWindowsWindow::destroyWindow() void QWindowsWindow::destroyWindow()
{ {
qCDebug(lcQpaWindows) << __FUNCTION__ << this << window() << m_data.hwnd; qCDebug(lcQpaWindow) << __FUNCTION__ << this << window() << m_data.hwnd;
if (m_data.hwnd) { // Stop event dispatching before Window is destroyed. if (m_data.hwnd) { // Stop event dispatching before Window is destroyed.
setFlag(WithinDestroy); setFlag(WithinDestroy);
// Clear any transient child relationships as Windows will otherwise destroy them (QTBUG-35499, QTBUG-36666) // Clear any transient child relationships as Windows will otherwise destroy them (QTBUG-35499, QTBUG-36666)
@ -1718,7 +1718,7 @@ QWindowsWindowData
void QWindowsWindow::setVisible(bool visible) void QWindowsWindow::setVisible(bool visible)
{ {
const QWindow *win = window(); const QWindow *win = window();
qCDebug(lcQpaWindows) << __FUNCTION__ << this << win << m_data.hwnd << visible; qCDebug(lcQpaWindow) << __FUNCTION__ << this << win << m_data.hwnd << visible;
if (m_data.hwnd) { if (m_data.hwnd) {
if (visible) { if (visible) {
show_sys(); show_sys();
@ -1898,7 +1898,7 @@ void QWindowsWindow::show_sys() const
void QWindowsWindow::setParent(const QPlatformWindow *newParent) void QWindowsWindow::setParent(const QPlatformWindow *newParent)
{ {
qCDebug(lcQpaWindows) << __FUNCTION__ << window() << newParent; qCDebug(lcQpaWindow) << __FUNCTION__ << window() << newParent;
if (m_data.hwnd) if (m_data.hwnd)
setParent_sys(newParent); setParent_sys(newParent);
@ -2187,7 +2187,7 @@ void QWindowsWindow::checkForScreenChanged(ScreenChangeMode mode)
&& !equalDpi(currentScreen->logicalDpi(), newScreen->logicalDpi())) { && !equalDpi(currentScreen->logicalDpi(), newScreen->logicalDpi())) {
return; return;
} }
qCDebug(lcQpaWindows).noquote().nospace() << __FUNCTION__ qCDebug(lcQpaWindow).noquote().nospace() << __FUNCTION__
<< ' ' << window() << " \"" << (currentScreen ? currentScreen->name() : QString()) << ' ' << window() << " \"" << (currentScreen ? currentScreen->name() : QString())
<< "\"->\"" << newScreen->name() << '"'; << "\"->\"" << newScreen->name() << '"';
updateFullFrameMargins(); updateFullFrameMargins();
@ -2225,7 +2225,7 @@ void QWindowsBaseWindow::setGeometry_sys(const QRect &rect) const
const QMargins margins = fullFrameMargins(); const QMargins margins = fullFrameMargins();
const QRect frameGeometry = rect + margins; const QRect frameGeometry = rect + margins;
qCDebug(lcQpaWindows) << '>' << __FUNCTION__ << window() qCDebug(lcQpaWindow) << '>' << __FUNCTION__ << window()
<< "\n from " << geometry_sys() << " frame: " << "\n from " << geometry_sys() << " frame: "
<< margins << " to " <<rect << margins << " to " <<rect
<< " new frame: " << frameGeometry; << " new frame: " << frameGeometry;
@ -2256,7 +2256,7 @@ void QWindowsBaseWindow::setGeometry_sys(const QRect &rect) const
result = MoveWindow(hwnd, x, frameGeometry.y(), result = MoveWindow(hwnd, x, frameGeometry.y(),
frameGeometry.width(), frameGeometry.height(), true); frameGeometry.width(), frameGeometry.height(), true);
} }
qCDebug(lcQpaWindows) << '<' << __FUNCTION__ << window() qCDebug(lcQpaWindow) << '<' << __FUNCTION__ << window()
<< "\n resulting " << result << geometry_sys(); << "\n resulting " << result << geometry_sys();
} }
@ -2342,7 +2342,7 @@ void QWindowsWindow::setWindowTitle(const QString &title)
void QWindowsWindow::setWindowFlags(Qt::WindowFlags flags) void QWindowsWindow::setWindowFlags(Qt::WindowFlags flags)
{ {
qCDebug(lcQpaWindows) << '>' << __FUNCTION__ << this << window() << "\n from: " qCDebug(lcQpaWindow) << '>' << __FUNCTION__ << this << window() << "\n from: "
<< m_data.flags << "\n to: " << flags; << m_data.flags << "\n to: " << flags;
const QRect oldGeometry = geometry(); const QRect oldGeometry = geometry();
if (m_data.flags != flags) { if (m_data.flags != flags) {
@ -2360,7 +2360,7 @@ void QWindowsWindow::setWindowFlags(Qt::WindowFlags flags)
if (oldGeometry != newGeometry) if (oldGeometry != newGeometry)
handleGeometryChange(); handleGeometryChange();
qCDebug(lcQpaWindows) << '<' << __FUNCTION__ << "\n returns: " qCDebug(lcQpaWindow) << '<' << __FUNCTION__ << "\n returns: "
<< m_data.flags << " geometry " << oldGeometry << "->" << newGeometry; << m_data.flags << " geometry " << oldGeometry << "->" << newGeometry;
} }
@ -2381,7 +2381,7 @@ QWindowsWindowData QWindowsWindow::setWindowFlags_sys(Qt::WindowFlags wt,
void QWindowsWindow::handleWindowStateChange(Qt::WindowStates state) void QWindowsWindow::handleWindowStateChange(Qt::WindowStates state)
{ {
qCDebug(lcQpaWindows) << __FUNCTION__ << this << window() qCDebug(lcQpaWindow) << __FUNCTION__ << this << window()
<< "\n from " << m_windowState << " to " << state; << "\n from " << m_windowState << " to " << state;
m_windowState = state; m_windowState = state;
QWindowSystemInterface::handleWindowStateChanged(window(), state); QWindowSystemInterface::handleWindowStateChanged(window(), state);
@ -2448,7 +2448,7 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowStates newState)
const Qt::WindowStates oldState = m_windowState; const Qt::WindowStates oldState = m_windowState;
if (oldState == newState) if (oldState == newState)
return; return;
qCDebug(lcQpaWindows) << '>' << __FUNCTION__ << this << window() qCDebug(lcQpaWindow) << '>' << __FUNCTION__ << this << window()
<< " from " << oldState << " to " << newState; << " from " << oldState << " to " << newState;
const bool visible = isVisible(); const bool visible = isVisible();
@ -2574,12 +2574,12 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowStates newState)
setRestoreMaximizedFlag(m_data.hwnd, newState & Qt::WindowMaximized); setRestoreMaximizedFlag(m_data.hwnd, newState & Qt::WindowMaximized);
} }
} }
qCDebug(lcQpaWindows) << '<' << __FUNCTION__ << this << window() << newState; qCDebug(lcQpaWindow) << '<' << __FUNCTION__ << this << window() << newState;
} }
void QWindowsWindow::setStyle(unsigned s) const void QWindowsWindow::setStyle(unsigned s) const
{ {
qCDebug(lcQpaWindows) << __FUNCTION__ << this << window() << debugWinStyle(s); qCDebug(lcQpaWindow) << __FUNCTION__ << this << window() << debugWinStyle(s);
setFlag(WithinSetStyle); setFlag(WithinSetStyle);
SetWindowLongPtr(m_data.hwnd, GWL_STYLE, s); SetWindowLongPtr(m_data.hwnd, GWL_STYLE, s);
clearFlag(WithinSetStyle); clearFlag(WithinSetStyle);
@ -2587,7 +2587,7 @@ void QWindowsWindow::setStyle(unsigned s) const
void QWindowsWindow::setExStyle(unsigned s) const void QWindowsWindow::setExStyle(unsigned s) const
{ {
qCDebug(lcQpaWindows) << __FUNCTION__ << this << window() << debugWinExStyle(s); qCDebug(lcQpaWindow) << __FUNCTION__ << this << window() << debugWinExStyle(s);
SetWindowLongPtr(m_data.hwnd, GWL_EXSTYLE, s); SetWindowLongPtr(m_data.hwnd, GWL_EXSTYLE, s);
} }
@ -2613,7 +2613,7 @@ bool QWindowsWindow::windowEvent(QEvent *event)
void QWindowsWindow::propagateSizeHints() void QWindowsWindow::propagateSizeHints()
{ {
qCDebug(lcQpaWindows) << __FUNCTION__ << this << window(); qCDebug(lcQpaWindow) << __FUNCTION__ << this << window();
} }
bool QWindowsWindow::handleGeometryChangingMessage(MSG *message, const QWindow *qWindow, const QMargins &margins) bool QWindowsWindow::handleGeometryChangingMessage(MSG *message, const QWindow *qWindow, const QMargins &margins)
@ -2663,7 +2663,7 @@ bool QWindowsWindow::handleGeometryChanging(MSG *message) const
void QWindowsWindow::setFullFrameMargins(const QMargins &newMargins) void QWindowsWindow::setFullFrameMargins(const QMargins &newMargins)
{ {
if (m_data.fullFrameMargins != newMargins) { if (m_data.fullFrameMargins != newMargins) {
qCDebug(lcQpaWindows) << __FUNCTION__ << window() << m_data.fullFrameMargins << "->" << newMargins; qCDebug(lcQpaWindow) << __FUNCTION__ << window() << m_data.fullFrameMargins << "->" << newMargins;
m_data.fullFrameMargins = newMargins; m_data.fullFrameMargins = newMargins;
} }
} }
@ -2702,7 +2702,7 @@ QMargins QWindowsWindow::fullFrameMargins() const
void QWindowsWindow::setOpacity(qreal level) void QWindowsWindow::setOpacity(qreal level)
{ {
qCDebug(lcQpaWindows) << __FUNCTION__ << level; qCDebug(lcQpaWindow) << __FUNCTION__ << level;
if (!qFuzzyCompare(m_opacity, level)) { if (!qFuzzyCompare(m_opacity, level)) {
m_opacity = level; m_opacity = level;
if (m_data.hwnd) if (m_data.hwnd)
@ -2762,7 +2762,7 @@ void QWindowsWindow::setMask(const QRegion &region)
void QWindowsWindow::requestActivateWindow() void QWindowsWindow::requestActivateWindow()
{ {
qCDebug(lcQpaWindows) << __FUNCTION__ << this << window(); qCDebug(lcQpaWindow) << __FUNCTION__ << this << window();
// 'Active' state handling is based in focus since it needs to work for // 'Active' state handling is based in focus since it needs to work for
// child windows as well. // child windows as well.
if (m_data.hwnd) { if (m_data.hwnd) {
@ -2805,7 +2805,7 @@ bool QWindowsWindow::setKeyboardGrabEnabled(bool grab)
qWarning("%s: No handle", __FUNCTION__); qWarning("%s: No handle", __FUNCTION__);
return false; return false;
} }
qCDebug(lcQpaWindows) << __FUNCTION__ << this << window() << grab; qCDebug(lcQpaWindow) << __FUNCTION__ << this << window() << grab;
QWindowsContext *context = QWindowsContext::instance(); QWindowsContext *context = QWindowsContext::instance();
if (grab) { if (grab) {
@ -2819,7 +2819,7 @@ bool QWindowsWindow::setKeyboardGrabEnabled(bool grab)
bool QWindowsWindow::setMouseGrabEnabled(bool grab) bool QWindowsWindow::setMouseGrabEnabled(bool grab)
{ {
qCDebug(lcQpaWindows) << __FUNCTION__ << window() << grab; qCDebug(lcQpaWindow) << __FUNCTION__ << window() << grab;
if (!m_data.hwnd) { if (!m_data.hwnd) {
qWarning("%s: No handle", __FUNCTION__); qWarning("%s: No handle", __FUNCTION__);
return false; return false;
@ -2924,7 +2924,7 @@ void QWindowsWindow::getSizeHints(MINMAXINFO *mmi) const
} }
} }
qCDebug(lcQpaWindows) << __FUNCTION__ << window() << *mmi; qCDebug(lcQpaWindow) << __FUNCTION__ << window() << *mmi;
} }
bool QWindowsWindow::handleNonClientHitTest(const QPoint &globalPos, LRESULT *result) const bool QWindowsWindow::handleNonClientHitTest(const QPoint &globalPos, LRESULT *result) const
@ -3036,7 +3036,7 @@ void QWindowsWindow::setCursor(const CursorHandlePtr &c)
} }
if (changed) { if (changed) {
const bool apply = applyNewCursor(window()); const bool apply = applyNewCursor(window());
qCDebug(lcQpaWindows) << window() << __FUNCTION__ qCDebug(lcQpaWindow) << window() << __FUNCTION__
<< c->handle() << " doApply=" << apply; << c->handle() << " doApply=" << apply;
m_cursor = c; m_cursor = c;
if (apply) if (apply)
@ -3199,7 +3199,7 @@ void QWindowsWindow::setCustomMargins(const QMargins &newCustomMargins)
const QPoint topLeft = currentFrameGeometry.topLeft(); const QPoint topLeft = currentFrameGeometry.topLeft();
QRect newFrame = currentFrameGeometry.marginsRemoved(oldCustomMargins) + m_data.customMargins; QRect newFrame = currentFrameGeometry.marginsRemoved(oldCustomMargins) + m_data.customMargins;
newFrame.moveTo(topLeft); newFrame.moveTo(topLeft);
qCDebug(lcQpaWindows) << __FUNCTION__ << oldCustomMargins << "->" << newCustomMargins qCDebug(lcQpaWindow) << __FUNCTION__ << oldCustomMargins << "->" << newCustomMargins
<< currentFrameGeometry << "->" << newFrame; << currentFrameGeometry << "->" << newFrame;
SetWindowPos(m_data.hwnd, nullptr, newFrame.x(), newFrame.y(), newFrame.width(), newFrame.height(), SWP_NOZORDER | SWP_FRAMECHANGED | SWP_NOACTIVATE); SetWindowPos(m_data.hwnd, nullptr, newFrame.x(), newFrame.y(), newFrame.width(), newFrame.height(), SWP_NOZORDER | SWP_FRAMECHANGED | SWP_NOACTIVATE);
} }