Revert "Revert "Remove deprecated screen maintenance functions in QPlatformIntegration""
This reverts commit 300940a6c9eb0f74cefda7d76a5d19f56ec50253. The fixes for leaf modules landed already. Task-number: QTBUG-74816 Change-Id: I1c7f0705c20d030419ceedca485106af73946b3c Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
This commit is contained in:
parent
a49c564891
commit
ad313595e0
@ -462,44 +462,6 @@ QList<int> QPlatformIntegration::possibleKeys(const QKeyEvent *) const
|
|||||||
return QList<int>();
|
return QList<int>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
|
||||||
\deprecated Use QWindowSystemInterface::handleScreenAdded instead.
|
|
||||||
*/
|
|
||||||
void QPlatformIntegration::screenAdded(QPlatformScreen *ps, bool isPrimary)
|
|
||||||
{
|
|
||||||
QWindowSystemInterface::handleScreenAdded(ps, isPrimary);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\deprecated Use QWindowSystemInterface::handleScreenRemoved instead.
|
|
||||||
*/
|
|
||||||
void QPlatformIntegration::removeScreen(QScreen *screen)
|
|
||||||
{
|
|
||||||
const bool wasPrimary = (!QGuiApplicationPrivate::screen_list.isEmpty() && QGuiApplicationPrivate::screen_list.at(0) == screen);
|
|
||||||
QGuiApplicationPrivate::screen_list.removeOne(screen);
|
|
||||||
|
|
||||||
QGuiApplicationPrivate::resetCachedDevicePixelRatio();
|
|
||||||
|
|
||||||
if (wasPrimary && qGuiApp && !QGuiApplicationPrivate::screen_list.isEmpty())
|
|
||||||
emit qGuiApp->primaryScreenChanged(QGuiApplicationPrivate::screen_list.at(0));
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\deprecated Use QWindowSystemInterface::handleScreenRemoved instead.
|
|
||||||
*/
|
|
||||||
void QPlatformIntegration::destroyScreen(QPlatformScreen *platformScreen)
|
|
||||||
{
|
|
||||||
QWindowSystemInterface::handleScreenRemoved(platformScreen);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\deprecated Use QWindowSystemInterface::handlePrimaryScreenChanged instead.
|
|
||||||
*/
|
|
||||||
void QPlatformIntegration::setPrimaryScreen(QPlatformScreen *newPrimary)
|
|
||||||
{
|
|
||||||
QWindowSystemInterface::handlePrimaryScreenChanged(newPrimary);
|
|
||||||
}
|
|
||||||
|
|
||||||
QStringList QPlatformIntegration::themeNames() const
|
QStringList QPlatformIntegration::themeNames() const
|
||||||
{
|
{
|
||||||
return QStringList();
|
return QStringList();
|
||||||
|
@ -192,10 +192,6 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
virtual void setApplicationIcon(const QIcon &icon) const;
|
virtual void setApplicationIcon(const QIcon &icon) const;
|
||||||
|
|
||||||
#if QT_DEPRECATED_SINCE(5, 12)
|
|
||||||
QT_DEPRECATED_X("Use QWindowSystemInterface::handleScreenRemoved") void removeScreen(QScreen *screen);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
virtual void beep() const;
|
virtual void beep() const;
|
||||||
|
|
||||||
#if QT_CONFIG(vulkan) || defined(Q_CLANG_QDOC)
|
#if QT_CONFIG(vulkan) || defined(Q_CLANG_QDOC)
|
||||||
@ -204,12 +200,6 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
QPlatformIntegration() = default;
|
QPlatformIntegration() = default;
|
||||||
|
|
||||||
#if QT_DEPRECATED_SINCE(5, 12)
|
|
||||||
QT_DEPRECATED_X("Use QWindowSystemInterface::handleScreenAdded") void screenAdded(QPlatformScreen *screen, bool isPrimary = false);
|
|
||||||
QT_DEPRECATED_X("Use QWindowSystemInterface::handleScreenRemoved") void destroyScreen(QPlatformScreen *screen);
|
|
||||||
QT_DEPRECATED_X("Use QWindowSystemInterface::handlePrimaryScreenChanged") void setPrimaryScreen(QPlatformScreen *newPrimary);
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@ -62,10 +62,6 @@ QPlatformScreen::~QPlatformScreen()
|
|||||||
Q_D(QPlatformScreen);
|
Q_D(QPlatformScreen);
|
||||||
if (d->screen) {
|
if (d->screen) {
|
||||||
qWarning("Manually deleting a QPlatformScreen. Call QWindowSystemInterface::handleScreenRemoved instead.");
|
qWarning("Manually deleting a QPlatformScreen. Call QWindowSystemInterface::handleScreenRemoved instead.");
|
||||||
QT_WARNING_PUSH
|
|
||||||
QT_WARNING_DISABLE_DEPRECATED
|
|
||||||
QGuiApplicationPrivate::platformIntegration()->removeScreen(d->screen);
|
|
||||||
QT_WARNING_POP
|
|
||||||
delete d->screen;
|
delete d->screen;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -106,9 +106,18 @@ void QScreenPrivate::setPlatformScreen(QPlatformScreen *screen)
|
|||||||
*/
|
*/
|
||||||
QScreen::~QScreen()
|
QScreen::~QScreen()
|
||||||
{
|
{
|
||||||
if (!qApp)
|
// Remove screen
|
||||||
|
const bool wasPrimary = QGuiApplication::primaryScreen() == this;
|
||||||
|
QGuiApplicationPrivate::screen_list.removeOne(this);
|
||||||
|
QGuiApplicationPrivate::resetCachedDevicePixelRatio();
|
||||||
|
|
||||||
|
if (!qGuiApp)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
QScreen *newPrimaryScreen = QGuiApplication::primaryScreen();
|
||||||
|
if (wasPrimary && newPrimaryScreen)
|
||||||
|
emit qGuiApp->primaryScreenChanged(newPrimaryScreen);
|
||||||
|
|
||||||
// Allow clients to manage windows that are affected by the screen going
|
// Allow clients to manage windows that are affected by the screen going
|
||||||
// away, before we fall back to moving them to the primary screen.
|
// away, before we fall back to moving them to the primary screen.
|
||||||
emit qApp->screenRemoved(this);
|
emit qApp->screenRemoved(this);
|
||||||
@ -116,11 +125,8 @@ QScreen::~QScreen()
|
|||||||
if (QGuiApplication::closingDown())
|
if (QGuiApplication::closingDown())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QScreen *primaryScreen = QGuiApplication::primaryScreen();
|
bool movingFromVirtualSibling = newPrimaryScreen
|
||||||
if (this == primaryScreen)
|
&& newPrimaryScreen->handle()->virtualSiblings().contains(handle());
|
||||||
return;
|
|
||||||
|
|
||||||
bool movingFromVirtualSibling = primaryScreen && primaryScreen->handle()->virtualSiblings().contains(handle());
|
|
||||||
|
|
||||||
// Move any leftover windows to the primary screen
|
// Move any leftover windows to the primary screen
|
||||||
const auto allWindows = QGuiApplication::allWindows();
|
const auto allWindows = QGuiApplication::allWindows();
|
||||||
@ -129,7 +135,7 @@ QScreen::~QScreen()
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
const bool wasVisible = window->isVisible();
|
const bool wasVisible = window->isVisible();
|
||||||
window->setScreen(primaryScreen);
|
window->setScreen(newPrimaryScreen);
|
||||||
|
|
||||||
// Re-show window if moved from a virtual sibling screen. Otherwise
|
// Re-show window if moved from a virtual sibling screen. Otherwise
|
||||||
// leave it up to the application developer to show the window.
|
// leave it up to the application developer to show the window.
|
||||||
|
@ -818,11 +818,6 @@ void QWindowSystemInterface::handleScreenAdded(QPlatformScreen *ps, bool isPrima
|
|||||||
*/
|
*/
|
||||||
void QWindowSystemInterface::handleScreenRemoved(QPlatformScreen *platformScreen)
|
void QWindowSystemInterface::handleScreenRemoved(QPlatformScreen *platformScreen)
|
||||||
{
|
{
|
||||||
QT_WARNING_PUSH
|
|
||||||
QT_WARNING_DISABLE_DEPRECATED
|
|
||||||
QGuiApplicationPrivate::platformIntegration()->removeScreen(platformScreen->screen());
|
|
||||||
QT_WARNING_POP
|
|
||||||
|
|
||||||
// Important to keep this order since the QSceen doesn't own the platform screen
|
// Important to keep this order since the QSceen doesn't own the platform screen
|
||||||
delete platformScreen->screen();
|
delete platformScreen->screen();
|
||||||
delete platformScreen;
|
delete platformScreen;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user