Windows: Destroy display change window before unregistering window class
The QWindowsScreenManager's m_displayChangeObserver window would still be alive at the time ~QWindowsContext would unregister window classes, resulting in a warning that was hidden by the default verbosity of QWindowsContext::verbose. The result was that we would get a warning when then trying to re-register the already registered window class. We now do what we do for m_powerNotification and m_powerDummyWindow, which is to destroy them explicitly before unregistering their class. Fixes: QTBUG-125058 Pick-to: 6.5 Change-Id: Id3b02237fdd81f734a58a2314a157cad1289a82c Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit 48cc43a1e00e564438227dc0c251c988cee22483) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
f6b4a48498
commit
107f76f29a
@ -204,6 +204,8 @@ QWindowsContext::~QWindowsContext()
|
|||||||
if (d->m_powerDummyWindow)
|
if (d->m_powerDummyWindow)
|
||||||
DestroyWindow(d->m_powerDummyWindow);
|
DestroyWindow(d->m_powerDummyWindow);
|
||||||
|
|
||||||
|
d->m_screenManager.destroyWindow();
|
||||||
|
|
||||||
unregisterWindowClasses();
|
unregisterWindowClasses();
|
||||||
if (d->m_oleInitializeResult == S_OK || d->m_oleInitializeResult == S_FALSE) {
|
if (d->m_oleInitializeResult == S_OK || d->m_oleInitializeResult == S_FALSE) {
|
||||||
#ifdef QT_USE_FACTORY_CACHE_REGISTRATION
|
#ifdef QT_USE_FACTORY_CACHE_REGISTRATION
|
||||||
|
@ -698,11 +698,15 @@ void QWindowsScreenManager::initialize()
|
|||||||
handleScreenChanges();
|
handleScreenChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
QWindowsScreenManager::~QWindowsScreenManager()
|
void QWindowsScreenManager::destroyWindow()
|
||||||
{
|
{
|
||||||
|
qCDebug(lcQpaScreen) << "Destroying display change observer" << m_displayChangeObserver;
|
||||||
DestroyWindow(m_displayChangeObserver);
|
DestroyWindow(m_displayChangeObserver);
|
||||||
|
m_displayChangeObserver = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QWindowsScreenManager::~QWindowsScreenManager() = default;
|
||||||
|
|
||||||
bool QWindowsScreenManager::isSingleScreen()
|
bool QWindowsScreenManager::isSingleScreen()
|
||||||
{
|
{
|
||||||
return QWindowsContext::instance()->screenManager().screens().size() < 2;
|
return QWindowsContext::instance()->screenManager().screens().size() < 2;
|
||||||
|
@ -105,6 +105,7 @@ public:
|
|||||||
|
|
||||||
QWindowsScreenManager();
|
QWindowsScreenManager();
|
||||||
void initialize();
|
void initialize();
|
||||||
|
void destroyWindow();
|
||||||
~QWindowsScreenManager();
|
~QWindowsScreenManager();
|
||||||
|
|
||||||
void clearScreens();
|
void clearScreens();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user