qgenericunixservices: Move x11 specific code to the Xcb backend
QGenericUnixServices is an abstract class subclassed by the wayland backend for wayland specific functionality. This moves to a consistent pattern where X11 code is also the X11 backend rather than guarded with if statements. Change-Id: I1cc7ebac811463451d744fdc034f5ad5fd022bc6 Reviewed-by: Liang Qi <liang.qi@qt.io>
This commit is contained in:
parent
d2a73883ae
commit
d0a5866f6f
@ -554,9 +554,7 @@ QPlatformServiceColorPicker *QGenericUnixServices::colorPicker(QWindow *parent)
|
||||
|
||||
QString QGenericUnixServices::portalWindowIdentifier(QWindow *window)
|
||||
{
|
||||
if (QGuiApplication::platformName() == QLatin1String("xcb"))
|
||||
return "x11:"_L1 + QString::number(window->winId(), 16);
|
||||
|
||||
Q_UNUSED(window);
|
||||
return QString();
|
||||
}
|
||||
|
||||
|
@ -93,10 +93,17 @@ static bool runningUnderDebugger()
|
||||
#endif
|
||||
}
|
||||
|
||||
class QXcbUnixServices : public QGenericUnixServices
|
||||
{
|
||||
public:
|
||||
QString portalWindowIdentifier(QWindow *window) override;
|
||||
};
|
||||
|
||||
|
||||
QXcbIntegration *QXcbIntegration::m_instance = nullptr;
|
||||
|
||||
QXcbIntegration::QXcbIntegration(const QStringList ¶meters, int &argc, char **argv)
|
||||
: m_services(new QGenericUnixServices)
|
||||
: m_services(new QXcbUnixServices)
|
||||
, m_instanceName(nullptr)
|
||||
, m_canGrab(true)
|
||||
, m_defaultVisualId(UINT_MAX)
|
||||
@ -593,4 +600,9 @@ void QXcbIntegration::setApplicationBadge(qint64 number)
|
||||
unixServices->setApplicationBadge(number);
|
||||
}
|
||||
|
||||
QString QXcbUnixServices::portalWindowIdentifier(QWindow *window)
|
||||
{
|
||||
return "x11:"_L1 + QString::number(window->winId(), 16);
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
Loading…
x
Reference in New Issue
Block a user