Merge lp:~alan-griffiths/miral/script-testrun-with-xmir into lp:miral

Proposed by Alan Griffiths on 2016-07-22
Status: Merged
Approved by: Alan Griffiths on 2016-07-25
Approved revision: 228
Merged at revision: 231
Proposed branch: lp:~alan-griffiths/miral/script-testrun-with-xmir
Merge into: lp:miral
Diff against target: 43 lines (+16/-2)
3 files modified
miral-shell/miral-run.sh (+0/-1)
miral/runner.cpp (+0/-1)
scripts/testrun-with-xmir (+16/-0)
To merge this branch: bzr merge lp:~alan-griffiths/miral/script-testrun-with-xmir
Reviewer Review Type Date Requested Status
Alan Griffiths Approve on 2016-07-25
Review via email: mp+300866@code.launchpad.net

Commit Message

Script to initialize test environment with Xmir

To post a comment you must log in.
Alan Griffiths (alan-griffiths) wrote :

<duflu> alan_g: That's the correct minimal syntax, yes, with two caveats: (1) The default renderer on desktop is dri2 which is less reliable so sometimes try -sw. (2) The -rootless option is not yet used by Unity8 but we hope to in future

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'miral-shell/miral-run.sh'
2--- miral-shell/miral-run.sh 2016-06-08 18:20:21 +0000
3+++ miral-shell/miral-run.sh 2016-07-22 10:40:31 +0000
4@@ -2,6 +2,5 @@
5 if [ "$1" = "gnome-terminal" ]
6 then extras='--app-id com.canonical.miral.Terminal'
7 fi
8-unset DISPLAY
9 unset QT_QPA_PLATFORMTHEME
10 GDK_BACKEND=mir QT_QPA_PLATFORM=ubuntumirclient SDL_VIDEODRIVER=mir $* ${extras}&
11
12=== modified file 'miral/runner.cpp'
13--- miral/runner.cpp 2016-06-08 18:20:21 +0000
14+++ miral/runner.cpp 2016-07-22 10:40:31 +0000
15@@ -74,7 +74,6 @@
16 }
17 while (std::chrono::steady_clock::now() < time_limit);
18
19- unsetenv("DISPLAY"); // Discourage toolkits from using X11
20 setenv("GDK_BACKEND", "mir", true); // configure GTK to use Mir
21 setenv("QT_QPA_PLATFORM", "ubuntumirclient", true); // configure Qt to use Mir
22 unsetenv("QT_QPA_PLATFORMTHEME"); // Discourage Qt from unsupported theme
23
24=== added file 'scripts/testrun-with-xmir'
25--- scripts/testrun-with-xmir 1970-01-01 00:00:00 +0000
26+++ scripts/testrun-with-xmir 2016-07-22 10:40:31 +0000
27@@ -0,0 +1,16 @@
28+#! /bin/bash
29+
30+# Usage: testrun [<build dir> [<switches passed to miral-shell>]]
31+
32+socket=${XDG_RUNTIME_DIR}/mir_socket
33+xmir_display=:1
34+builddir=$(dirname $0)/../build/
35+if [ $# -gt 0 ]; then builddir=$1/; shift; fi
36+
37+if [ -e "${socket}" ]; then echo "Error: '${socket}' already exists"; exit 1 ;fi
38+
39+sudo ls >> /dev/null
40+sudo DISPLAY=${xmir_display} ${builddir}bin/miral-shell --vt 4 --arw-file --file ${socket} $* &
41+while [ ! -e "${socket}" ]; do echo "waiting for ${socket}"; sleep 1 ;done
42+Xmir ${xmir_display} -rootless&
43+DISPLAY=${xmir_display} ${builddir}bin/miral-run gnome-terminal&

Subscribers

People subscribed via source and target branches