Mir

Merge lp:~alan-griffiths/mir/fix-1716353 into lp:mir

Proposed by Alan Griffiths on 2017-09-11
Status: Superseded
Proposed branch: lp:~alan-griffiths/mir/fix-1716353
Merge into: lp:mir
Diff against target: 81 lines (+20/-6)
3 files modified
examples/miral-shell/miral-desktop.sh (+1/-1)
src/server/frontend/wayland/wayland_connector.cpp (+12/-2)
src/server/frontend/wayland/wayland_default_configuration.cpp (+7/-3)
To merge this branch: bzr merge lp:~alan-griffiths/mir/fix-1716353
Reviewer Review Type Date Requested Status
Mir development team 2017-09-11 Pending
Review via email: mp+330516@code.launchpad.net

Commit message

Provide XDB_RUNTIME_DIR to wayland in the miral-desktop script and apply --arw-file in WaylandConnector. (LP: #1716353)

To post a comment you must log in.
lp:~alan-griffiths/mir/fix-1716353 updated on 2017-09-14
4249. By Alan Griffiths on 2017-09-14

merge :parent

4250. By Alan Griffiths on 2017-09-14

Lost checkin

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'examples/miral-shell/miral-desktop.sh'
2--- examples/miral-shell/miral-desktop.sh 2017-09-06 16:44:12 +0000
3+++ examples/miral-shell/miral-desktop.sh 2017-09-11 13:29:14 +0000
4@@ -35,7 +35,7 @@
5
6 sudo ls >> /dev/null
7 oldvt=$(sudo fgconsole)
8-sudo sh -c "LD_LIBRARY_PATH=${LD_LIBRARY_PATH} ${bindir}${miral_server} --vt ${vt} --arw-file --file ${socket} $*; chvt ${oldvt}"&
9+sudo sh -c "LD_LIBRARY_PATH=${LD_LIBRARY_PATH} XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR} ${bindir}${miral_server} --vt ${vt} --arw-file --file ${socket} $*; chvt ${oldvt}"&
10
11 while [ ! -e "${socket}" ]; do echo "waiting for ${socket}"; sleep 1 ;done
12
13
14=== modified file 'src/server/frontend/wayland/wayland_connector.cpp'
15--- src/server/frontend/wayland/wayland_connector.cpp 2017-09-07 01:27:49 +0000
16+++ src/server/frontend/wayland/wayland_connector.cpp 2017-09-11 13:29:14 +0000
17@@ -61,6 +61,8 @@
18 #include "mir/fd.h"
19 #include "../../../platforms/common/server/shm_buffer.h"
20
21+#include <sys/stat.h>
22+
23 namespace mf = mir::frontend;
24 namespace mg = mir::graphics;
25 namespace mc = mir::compositor;
26@@ -1680,7 +1682,8 @@
27 mf::WaylandConnector::WaylandConnector(
28 std::shared_ptr<mf::Shell> const& shell,
29 DisplayChanger& display_config,
30- std::shared_ptr<mg::GraphicBufferAllocator> const& allocator)
31+ std::shared_ptr<mg::GraphicBufferAllocator> const& allocator,
32+ bool arw_socket)
33 : display{wl_display_create(), &cleanup_display},
34 pause_signal{eventfd(0, EFD_CLOEXEC | EFD_SEMAPHORE)},
35 allocator{std::dynamic_pointer_cast<mg::WaylandAllocator>(allocator)}
36@@ -1730,7 +1733,14 @@
37 mir::log_warning("No WaylandAllocator EGL support!");
38 }
39
40- wl_display_add_socket_auto(display.get());
41+ if (auto const wayland_display = wl_display_add_socket_auto(display.get()))
42+ {
43+ if (arw_socket)
44+ {
45+ chmod((std::string{getenv("XDG_RUNTIME_DIR")} + "/" + wayland_display).c_str(),
46+ S_IRUSR|S_IWUSR| S_IRGRP|S_IWGRP | S_IROTH|S_IWOTH);
47+ };
48+ }
49
50 auto wayland_loop = wl_display_get_event_loop(display.get());
51
52
53=== modified file 'src/server/frontend/wayland/wayland_default_configuration.cpp'
54--- src/server/frontend/wayland/wayland_default_configuration.cpp 2017-09-07 00:33:58 +0000
55+++ src/server/frontend/wayland/wayland_default_configuration.cpp 2017-09-11 13:29:14 +0000
56@@ -19,8 +19,9 @@
57 #include "mir/default_server_configuration.h"
58 #include "wayland_connector.h"
59
60-#include "../../scene/mediating_display_changer.h"
61+#include "mir/frontend/display_changer.h"
62 #include "mir/graphics/platform.h"
63+#include "mir/options/default_configuration.h"
64
65 namespace mf = mir::frontend;
66
67@@ -30,10 +31,13 @@
68 return wayland_connector(
69 [this]() -> std::shared_ptr<mf::Connector>
70 {
71+ bool const arw_socket = the_options()->is_set(options::arw_server_socket_opt);
72+
73 return std::make_shared<mf::WaylandConnector>(
74 the_frontend_shell(),
75- *the_mediating_display_changer(),
76- the_buffer_allocator());
77+ *the_frontend_display_changer(),
78+ the_buffer_allocator(),
79+ arw_socket);
80 });
81 }
82

Subscribers

People subscribed via source and target branches