Merge "wayland: Remove bogus warning about ignoring WAYLAND_DISPLAY"
This commit is contained in:
commit
09d36158d3
@ -1409,18 +1409,16 @@ void QGuiApplicationPrivate::createPlatformIntegration()
|
|||||||
}
|
}
|
||||||
|
|
||||||
const bool defaultIsWayland = !defaultIsXcb && platformPluginBase.startsWith("wayland");
|
const bool defaultIsWayland = !defaultIsXcb && platformPluginBase.startsWith("wayland");
|
||||||
|
bool isGnome = false;
|
||||||
const QByteArray waylandPlatformName = defaultIsWayland ? platformName : "wayland";
|
const QByteArray waylandPlatformName = defaultIsWayland ? platformName : "wayland";
|
||||||
if (hasWaylandDisplay || isWaylandSessionType) {
|
if (hasWaylandDisplay || isWaylandSessionType) {
|
||||||
const QByteArray currentDesktop = qgetenv("XDG_CURRENT_DESKTOP").toLower();
|
const QByteArray currentDesktop = qgetenv("XDG_CURRENT_DESKTOP").toLower();
|
||||||
const QByteArray sessionDesktop = qgetenv("XDG_SESSION_DESKTOP").toLower();
|
const QByteArray sessionDesktop = qgetenv("XDG_SESSION_DESKTOP").toLower();
|
||||||
const bool isGnome = currentDesktop.contains("gnome") || sessionDesktop.contains("gnome");
|
isGnome = currentDesktop.contains("gnome") || sessionDesktop.contains("gnome");
|
||||||
if (isGnome) {
|
if (isGnome)
|
||||||
qInfo() << "Warning: Ignoring WAYLAND_DISPLAY on Gnome."
|
|
||||||
<< "Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.";
|
|
||||||
preferredPlatformOrder.append(waylandPlatformName);
|
preferredPlatformOrder.append(waylandPlatformName);
|
||||||
} else {
|
else
|
||||||
preferredPlatformOrder.prepend(waylandPlatformName);
|
preferredPlatformOrder.prepend(waylandPlatformName);
|
||||||
}
|
|
||||||
|
|
||||||
if (defaultIsWayland)
|
if (defaultIsWayland)
|
||||||
platformName.clear();
|
platformName.clear();
|
||||||
@ -1432,9 +1430,11 @@ void QGuiApplicationPrivate::createPlatformIntegration()
|
|||||||
platformName = preferredPlatformOrder.join(';');
|
platformName = preferredPlatformOrder.join(';');
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
bool platformExplicitlySelected = false;
|
||||||
QByteArray platformNameEnv = qgetenv("QT_QPA_PLATFORM");
|
QByteArray platformNameEnv = qgetenv("QT_QPA_PLATFORM");
|
||||||
if (!platformNameEnv.isEmpty()) {
|
if (!platformNameEnv.isEmpty()) {
|
||||||
platformName = platformNameEnv;
|
platformName = platformNameEnv;
|
||||||
|
platformExplicitlySelected = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString platformThemeName = QString::fromLocal8Bit(qgetenv("QT_QPA_PLATFORMTHEME"));
|
QString platformThemeName = QString::fromLocal8Bit(qgetenv("QT_QPA_PLATFORMTHEME"));
|
||||||
@ -1459,8 +1459,10 @@ void QGuiApplicationPrivate::createPlatformIntegration()
|
|||||||
if (++i < argc)
|
if (++i < argc)
|
||||||
platformPluginPath = QString::fromLocal8Bit(argv[i]);
|
platformPluginPath = QString::fromLocal8Bit(argv[i]);
|
||||||
} else if (strcmp(arg, "-platform") == 0) {
|
} else if (strcmp(arg, "-platform") == 0) {
|
||||||
if (++i < argc)
|
if (++i < argc) {
|
||||||
|
platformExplicitlySelected = true;
|
||||||
platformName = argv[i];
|
platformName = argv[i];
|
||||||
|
}
|
||||||
} else if (strcmp(arg, "-platformtheme") == 0) {
|
} else if (strcmp(arg, "-platformtheme") == 0) {
|
||||||
if (++i < argc)
|
if (++i < argc)
|
||||||
platformThemeName = QString::fromLocal8Bit(argv[i]);
|
platformThemeName = QString::fromLocal8Bit(argv[i]);
|
||||||
@ -1484,6 +1486,15 @@ void QGuiApplicationPrivate::createPlatformIntegration()
|
|||||||
argc = j;
|
argc = j;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(Q_OS_UNIX) && !defined(Q_OS_DARWIN)
|
||||||
|
if ((hasWaylandDisplay || isWaylandSessionType) && isGnome && !platformExplicitlySelected) {
|
||||||
|
qInfo() << "Warning: Ignoring WAYLAND_DISPLAY on Gnome."
|
||||||
|
<< "Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.";
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
Q_UNUSED(platformExplicitlySelected);
|
||||||
|
#endif
|
||||||
|
|
||||||
init_platform(QLatin1String(platformName), platformPluginPath, platformThemeName, argc, argv);
|
init_platform(QLatin1String(platformName), platformPluginPath, platformThemeName, argc, argv);
|
||||||
|
|
||||||
if (!icon.isEmpty())
|
if (!icon.isEmpty())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user