summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2014-12-01 15:25:59 +0100
committerAndy Nichols <andy.nichols@theqtcompany.com>2014-12-02 17:37:50 +0200
commit6fbc0bcce1e4f082ddedc8a48cadf3e4214e94fa (patch)
treef9a39734e03d0d90d5ef4161c8fcb0ba69fe3f55
parentdaf7b6840eca677f12e98eb4e0d12e895fe9be81 (diff)
Restrict the qtlauncher window size on Wayland
The window management capabilities of Weston are limited, to put it mildly, so creating large windows should be avoided. Restrict the size to 800x600. Change-Id: I1fbbe1c68a4ab56cfcbbb688265f6c43ac3d8473 Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
-rw-r--r--qml/Main.qml4
-rw-r--r--src/main.cpp1
2 files changed, 3 insertions, 2 deletions
diff --git a/qml/Main.qml b/qml/Main.qml
index 0b7557b..a5fece0 100644
--- a/qml/Main.qml
+++ b/qml/Main.qml
@@ -25,8 +25,8 @@ Window {
id: window
visible: true
- width: Screen.desktopAvailableWidth
- height: Screen.desktopAvailableHeight
+ width: qpa_platform == "wayland" ? 800 : Screen.desktopAvailableWidth
+ height: qpa_platform == "wayland" ? 600 : Screen.desktopAvailableHeight
color: "black"
property color qtpurple: '#ae32a0'
diff --git a/src/main.cpp b/src/main.cpp
index b07ee8f..22bcb1c 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -98,6 +98,7 @@ int main(int argc, char **argv)
QQmlApplicationEngine engine;
engine.rootContext()->setContextProperty("applicationSettings", &applicationSettings);
+ engine.rootContext()->setContextProperty("qpa_platform", qGuiApp->platformName());
engine.load(applicationSettings.mainFile());
app.exec();