@@ -61,8 +61,8 @@ int startShell(int argc, const char** argv, void* server)
6161 "Allow the mouse to provide touch input");
6262 parser.addOption(mousetouchOption);
6363
64− QCommandLineOption windowGeometryOption("windowgeometry",
65− "Specify the window geometry as [<width>x<height>]");
64+ QCommandLineOption windowGeometryOption(QStringList() << "windowgeometry",
65+ "Specify the window geometry as [<width>x<height>]", "windowgeometry", "1");
6666 parser.addOption(windowGeometryOption);
6767
6868 QCommandLineOption testabilityOption("testability",
@@ -98,8 +98,16 @@ Load the testability driver");
9898
9999 resolveIconTheme();
100100
101− QStringList args = application->arguments();
102− ApplicationArguments qmlArgs(args);
101+ std::auto_ptr<ApplicationArguments> appArgs;
102+ if (parser.isSet(windowGeometryOption) &&
103+ parser.value(windowGeometryOption).split('x').size() == 2) {
104+ QStringList geom =
105+ parser.value(windowGeometryOption).split('x');
106+ appArgs.reset(new ApplicationArguments(geom.at(0).toInt(), geom.at(1).toInt()));
107+ } else {
108+ appArgs.reset(new ApplicationArguments());
109+ }
110+ ApplicationArguments& qmlArgs = *appArgs;
103111
104112 // The testability driver is only loaded by QApplication but not by QGuiApplication.
105113 // However, QApplication depends on QWidget which would add some unneeded overhead => Let's load the testability driver on our own.