diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2018-02-19 12:34:04 +0100 |
---|---|---|
committer | Johan Helsing <johan.helsing@qt.io> | 2018-02-20 09:22:51 +0000 |
commit | ddf6f57f212da5555d799d9f3ac9faff093891d0 (patch) | |
tree | 8c980ece3de6c309d3f8178e13c113d417a7399f /src/gui/kernel/qguiapplication.cpp | |
parent | 093d85393fbacf68028e3b5fd39329878757d603 (diff) |
xcb: Fix -geometry argument for platformName with arguments or fallbacks
-geometry, -title and -icon for xcb did not work if the platform string had
arguments or there were fallback platforms.
Only accept the arguments if xcb is the default platform. I.e. ignore the
arguments if xcb is a fallback.
This now works:
./application -platform "xcb:someArg=value" -title specialXcbTitle
./application -platform "xcb;wayland" -title specialXcbTitle
./application -platform "xcb:someArg=value;wayland" -title specialXcbTitle
But this does not:
./application -platform "wayland;xcb:someArg=value" -title specialXcbTitle
Change-Id: I4ee20b1ed722bc98417a5e75db7d8c98ffcdfcfe
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Diffstat (limited to 'src/gui/kernel/qguiapplication.cpp')
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index fdc27b760c..12390928f0 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -1304,7 +1304,7 @@ void QGuiApplicationPrivate::createPlatformIntegration() argv[j++] = argv[i]; continue; } - const bool isXcb = platformName == "xcb"; + const bool xcbIsDefault = platformName.startsWith("xcb"); const char *arg = argv[i]; if (arg[1] == '-') // startsWith("--") ++arg; @@ -1317,13 +1317,13 @@ void QGuiApplicationPrivate::createPlatformIntegration() } else if (strcmp(arg, "-platformtheme") == 0) { if (++i < argc) platformThemeName = QString::fromLocal8Bit(argv[i]); - } else if (strcmp(arg, "-qwindowgeometry") == 0 || (isXcb && strcmp(arg, "-geometry") == 0)) { + } else if (strcmp(arg, "-qwindowgeometry") == 0 || (xcbIsDefault && strcmp(arg, "-geometry") == 0)) { if (++i < argc) windowGeometrySpecification = QWindowGeometrySpecification::fromArgument(argv[i]); - } else if (strcmp(arg, "-qwindowtitle") == 0 || (isXcb && strcmp(arg, "-title") == 0)) { + } else if (strcmp(arg, "-qwindowtitle") == 0 || (xcbIsDefault && strcmp(arg, "-title") == 0)) { if (++i < argc) firstWindowTitle = QString::fromLocal8Bit(argv[i]); - } else if (strcmp(arg, "-qwindowicon") == 0 || (isXcb && strcmp(arg, "-icon") == 0)) { + } else if (strcmp(arg, "-qwindowicon") == 0 || (xcbIsDefault && strcmp(arg, "-icon") == 0)) { if (++i < argc) { icon = QString::fromLocal8Bit(argv[i]); } |