Mir

Merge lp:~alan-griffiths/mir/miral-xrun-wayland into lp:mir

Proposed by Alan Griffiths on 2017-09-29
Status: Merged
Approved by: Brandon Schaefer on 2017-09-29
Approved revision: 4277
Merged at revision: 4278
Proposed branch: lp:~alan-griffiths/mir/miral-xrun-wayland
Merge into: lp:mir
Diff against target: 102 lines (+53/-29)
1 file modified
examples/miral-shell/miral-xrun.sh (+53/-29)
To merge this branch: bzr merge lp:~alan-griffiths/mir/miral-xrun-wayland
Reviewer Review Type Date Requested Status
Mir CI Bot continuous-integration Approve on 2017-09-29
Brandon Schaefer (community) Approve on 2017-09-29
Chris Halse Rogers 2017-09-29 Approve on 2017-09-29
Review via email: mp+331564@code.launchpad.net

Commit message

Extend miral-xrun to enable using Xwayland as an alternative to Xmir

To post a comment you must log in.
Chris Halse Rogers (raof) wrote :

This seems sensible.

review: Approve
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:4276
https://mir-jenkins.ubuntu.com/job/mir-ci/3708/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/5082/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/5320
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=artful/5307
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/5307
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/5307
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/5126
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/5126/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/5126
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/5126/artifact/output/*zip*/output.zip
    ABORTED: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/5126/console
    ABORTED: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/5126/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/5126
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/5126/artifact/output/*zip*/output.zip
    ABORTED: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/5126/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/5126
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/5126/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/3708/rebuild

review: Needs Fixing (continuous-integration)
4277. By Alan Griffiths on 2017-09-29

Fix the environment variable setting

Brandon Schaefer (brandontschaefer) wrote :

Nice, lgtm

review: Approve
Mir CI Bot (mir-ci-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'examples/miral-shell/miral-xrun.sh'
2--- examples/miral-shell/miral-xrun.sh 2017-08-21 15:58:34 +0000
3+++ examples/miral-shell/miral-xrun.sh 2017-09-29 16:20:28 +0000
4@@ -1,45 +1,69 @@
5 #!/bin/bash
6-port=0
7-
8-while [ -e "/tmp/.X11-unix/X${port}" ]; do
9- let port+=1
10-done
11-
12-unset QT_QPA_PLATFORMTHEME
13-unset GDK_BACKEND
14-unset QT_QPA_PLATFORM
15-unset SDL_VIDEODRIVER
16-
17-if [ -e "${XDG_RUNTIME_DIR}/miral_socket" ];
18-then
19- socket=${XDG_RUNTIME_DIR}/miral_socket
20-elif [ -e "${XDG_RUNTIME_DIR}/mir_socket" ];
21-then
22- socket=${XDG_RUNTIME_DIR}/mir_socket
23-else
24- echo "Error: Cannot detect Mir endpoint"; exit 1
25-fi
26+
27+x11_server=Xmir
28
29 while [ $# -gt 0 ]
30 do
31 if [ "$1" == "--help" -o "$1" == "-h" ]
32 then
33- echo "$(basename $0) - Handy launch script for providing an Xmir X11 server"
34+ echo "$(basename $0) - Handy launch script for providing an X11 server"
35 echo "Usage: $(basename $0) [options] command"
36 echo "Options are:"
37- echo " -force set toolkit environment variables to force X11 use"
38+ echo " -Xmir use Xmir"
39+ echo " -Xwayland use Xwayland"
40+ echo "(default is -${x11_server})"
41 exit 0
42- elif [ "$1" == "-force" ];
43- then
44- export XDG_SESSION_TYPE=x11
45- export GDK_BACKEND=x11
46- export QT_QPA_PLATFORM=xcb
47- export SDL_VIDEODRIVER=x11
48+ elif [ "$1" == "-Xmir" ]; then x11_server=Xmir
49+ elif [ "$1" == "-Xwayland" ]; then x11_server=Xwayland
50+ elif [ "${1:0:1}" == "-" ]; then echo "Unknown option: $1"; exit 1
51 else break
52 fi
53 shift
54 done
55
56-MIR_SOCKET=${socket} Xmir -rootless :${port} & pid=$!
57+unset QT_QPA_PLATFORMTHEME
58+export XDG_SESSION_TYPE=x11
59+export GDK_BACKEND=x11
60+export QT_QPA_PLATFORM=xcb
61+export SDL_VIDEODRIVER=x11
62+
63+if [ "${x11_server}" == "Xmir" ];
64+then
65+ x_server_installed=$(apt list xmir 2>/dev/null | grep installed | wc -l)
66+ if [ "${x_server_installed}" == "0" ]; then echo "Need Xmir - run \"sudo apt install xmir\""; exit 1 ;fi
67+
68+ if [ -e "${XDG_RUNTIME_DIR}/miral_socket" ];
69+ then
70+ socket_value=${XDG_RUNTIME_DIR}/miral_socket
71+ elif [ -e "${XDG_RUNTIME_DIR}/mir_socket" ];
72+ then
73+ socket_value=${XDG_RUNTIME_DIR}/mir_socket
74+ else
75+ echo "Error: Cannot detect Mir endpoint"; exit 1
76+ fi
77+ MIR_SOCKET=${socket_value}
78+ x11_server_args=-rootless
79+elif [ "${x11_server}" == "Xwayland" ];
80+then
81+ x_server_installed=$(apt list xwayland 2>/dev/null | grep installed | wc -l)
82+ if [ "${x_server_installed}" == "0" ]; then echo "Need Xwayland - run \"sudo apt install xwayland\""; exit 1 ;fi
83+
84+ if [ -e "${XDG_RUNTIME_DIR}/miral_wayland" ];
85+ then
86+ socket_value=miral_wayland
87+ else
88+ echo "Error: Cannot detect Mir-Wayland endpoint"; exit 1
89+ fi
90+ WAYLAND_DISPLAY=${socket_value}
91+ x11_server_args=
92+fi
93+
94+port=0
95+
96+while [ -e "/tmp/.X11-unix/X${port}" ]; do
97+ let port+=1
98+done
99+
100+${x11_server} ${x11_server_args} :${port} & pid=$!
101 DISPLAY=:${port} "$@"
102 kill ${pid}

Subscribers

People subscribed via source and target branches