on xenial help sign in
Make geometry calls for autopilot work again

-geometry is a internal Qt argument that only works for QWidget based apps Before it was being returned to us in -args but now it's eaten so we need to use a different one, -windowgeometry

commit1e13602dfa3754ed661e79d623da5c813cecf387 authorAlbert Astals <albert.astals@canonical.com> dateThu 27 Mar 2014, 12:37 (13 years ago) parentf702e5d6db9e9d
3 files changed+5−5
src/ApplicationArguments.h+2−2 src/Panel/Indicators/client/indicatorsclient.cpp+2−2 tests/autopilot/unity8/shell/tests/__init__.py+1−1
src/ApplicationArguments.h+2−2
@@ -29,8 +29,8 @@ class ApplicationArguments : public QObject
2929 Q_OBJECT
3030public:
3131 ApplicationArguments(const QStringList& args) {
32− if (args.contains(QLatin1String("-geometry")) && args.size() > args.indexOf(QLatin1String("-geometry")) + 1) {
33− QStringList geometryArg = args.at(args.indexOf(QLatin1String("-geometry")) + 1).split('x');
32+ if (args.contains(QLatin1String("-windowgeometry")) && args.size() > args.indexOf(QLatin1String("-windowgeometry")) + 1) {
33+ QStringList geometryArg = args.at(args.indexOf(QLatin1String("-windowgeometry")) + 1).split('x');
3434 if (geometryArg.size() == 2) {
3535 m_size.rwidth() = geometryArg.at(0).toInt();
3636 m_size.rheight() = geometryArg.at(1).toInt();
src/Panel/Indicators/client/indicatorsclient.cpp+2−2
@@ -49,8 +49,8 @@ IndicatorsClient::IndicatorsClient(int &argc, char **argv)
4949
5050 m_view->setSource(QUrl("IndicatorsClient.qml"));
5151 m_view->setResizeMode(QQuickView::SizeRootObjectToView);
52− if (args.contains(QLatin1String("-geometry")) && args.size() > args.indexOf(QLatin1String("-geometry")) + 1) {
53− QStringList geometryArg = args.at(args.indexOf(QLatin1String("-geometry")) + 1).split('x');
52+ if (args.contains(QLatin1String("-windowgeometry")) && args.size() > args.indexOf(QLatin1String("-windowgeometry")) + 1) {
53+ QStringList geometryArg = args.at(args.indexOf(QLatin1String("-windowgeometry")) + 1).split('x');
5454 if (geometryArg.size() == 2) {
5555 m_view->resize(geometryArg.at(0).toInt(), geometryArg.at(1).toInt());
5656 }
tests/autopilot/unity8/shell/tests/__init__.py+1−1
@@ -181,7 +181,7 @@ class UnityTestCase(AutopilotTestCase):
181181 )
182182 geo_string = "%dx%d" % (width, height)
183183 self.unity_geometry_args = [
184− '-geometry',
184+ '-windowgeometry',
185185 geo_string,
186186 '-frameless',
187187 '-mousetouch'