Mir

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

Proposed by Alan Griffiths
Status: Merged
Approved by: Andreas Pokorny
Approved revision: no longer in the source branch.
Merged at revision: 1355
Proposed branch: lp:~alan-griffiths/mir/fix-1272143
Merge into: lp:mir
Diff against target: 151 lines (+36/-14)
5 files modified
doc/using_mir_on_pc.md (+2/-2)
examples/basic.c (+3/-3)
examples/flicker.c (+3/-3)
examples/multiwin.c (+25/-3)
examples/scroll.cpp (+3/-3)
To merge this branch: bzr merge lp:~alan-griffiths/mir/fix-1272143
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Alexandros Frantzis (community) Approve
Andreas Pokorny (community) Approve
Review via email: mp+203040@code.launchpad.net

Commit message

examples, doc: Make it clear and consistent how to use a non-root client with a root compositor endpoint

Description of the change

examples, doc: Make it clear and consistent how to use a non-root client with a root compositor endpoint

To post a comment you must log in.
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

Handy test script:

  sudo chmod 666 /tmp/mir_socket
  for x in bin/mir_demo_client_*; do echo ${x}; ${x} -m /tmp/mir_socket; done

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

the document states 777? Is that correct?

review: Needs Information
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> the document states 777? Is that correct?

That's what it has said "forever" - but 666 is good enough. Shall I change it too?

Revision history for this message
Andreas Pokorny (andreas-pokorny) :
review: Approve
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

OK.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'doc/using_mir_on_pc.md'
2--- doc/using_mir_on_pc.md 2014-01-13 06:12:33 +0000
3+++ doc/using_mir_on_pc.md 2014-01-24 14:37:55 +0000
4@@ -96,8 +96,8 @@
5
6 $ sudo mir_demo_server_basic
7 <Ctrl+Alt+F2> - log in to VT 2
8- $ sudo chmod 777 /tmp/mir_socket
9- $ some-mir-client
10+ $ sudo chmod a+rw /tmp/mir_socket
11+ $ some-mir-client -m /tmp/mir_socket
12 <Ctrl+Alt+F1> - switch back to Mir. Watch your friends be amazed!
13
14 In case you accidentally killed your X login and ended up with a failsafe
15
16=== modified file 'examples/basic.c'
17--- examples/basic.c 2013-08-29 03:48:16 +0000
18+++ examples/basic.c 2014-01-24 14:37:55 +0000
19@@ -201,14 +201,14 @@
20 {
21 int arg;
22 opterr = 0;
23- while ((arg = getopt (argc, argv, "c:hf:")) != -1)
24+ while ((arg = getopt (argc, argv, "c:hm:")) != -1)
25 {
26 switch (arg)
27 {
28 case 'c':
29 buffer_swap_count = atoi(optarg);
30 break;
31- case 'f':
32+ case 'm':
33 server = optarg;
34 break;
35
36@@ -217,7 +217,7 @@
37 default:
38 puts(argv[0]);
39 puts("Usage:");
40- puts(" -f <server name>");
41+ puts(" -m <Mir server socket>");
42 puts(" -h: this help text");
43 return -1;
44 }
45
46=== modified file 'examples/flicker.c'
47--- examples/flicker.c 2014-01-13 06:12:33 +0000
48+++ examples/flicker.c 2014-01-24 14:37:55 +0000
49@@ -98,11 +98,11 @@
50
51 int arg;
52 opterr = 0;
53- while ((arg = getopt (argc, argv, "qhnf:")) != -1)
54+ while ((arg = getopt (argc, argv, "qhnm:")) != -1)
55 {
56 switch (arg)
57 {
58- case 'f':
59+ case 'm':
60 socket_file = optarg;
61 break;
62 case 'n':
63@@ -118,7 +118,7 @@
64 case 'h':
65 default:
66 printf("Usage: %s [<options>]\n"
67- " -f <socket filename> Connect to a specific Mir socket\n"
68+ " -f <Mir server socket> Connect to a specific Mir socket\n"
69 " -h Show this help text\n"
70 " -n Don't sync to vblank\n"
71 " -q Quiet mode (no messages output)\n"
72
73=== modified file 'examples/multiwin.c'
74--- examples/multiwin.c 2013-09-19 13:24:22 +0000
75+++ examples/multiwin.c 2014-01-24 14:37:55 +0000
76@@ -20,6 +20,7 @@
77 #include <stdio.h>
78 #include <signal.h>
79 #include <stdint.h>
80+#include <getopt.h>
81
82 typedef struct
83 {
84@@ -117,6 +118,8 @@
85 mir_surface_swap_buffers_sync(win->surface);
86 }
87
88+static char const *socket_file = NULL;
89+
90 int main(int argc, char *argv[])
91 {
92 MirConnection *conn;
93@@ -124,9 +127,28 @@
94 Window win[3];
95 unsigned int f;
96
97- (void)argc;
98-
99- conn = mir_connect_sync(NULL, argv[0]);
100+ int arg;
101+ opterr = 0;
102+ while ((arg = getopt (argc, argv, "hm:")) != -1)
103+ {
104+ switch (arg)
105+ {
106+ case 'm':
107+ socket_file = optarg;
108+ break;
109+
110+ case '?':
111+ case 'h':
112+ default:
113+ puts(argv[0]);
114+ puts("Usage:");
115+ puts(" -m <Mir server socket>");
116+ puts(" -h: this help text");
117+ return -1;
118+ }
119+ }
120+
121+ conn = mir_connect_sync(socket_file, argv[0]);
122 if (!mir_connection_is_valid(conn))
123 {
124 fprintf(stderr, "Could not connect to a display server.\n");
125
126=== modified file 'examples/scroll.cpp'
127--- examples/scroll.cpp 2013-09-19 13:24:22 +0000
128+++ examples/scroll.cpp 2014-01-24 14:37:55 +0000
129@@ -36,11 +36,11 @@
130 MirSurface *surface = 0;
131 int arg;
132 opterr = 0;
133- while ((arg = getopt (argc, argv, "hf:")) != -1)
134+ while ((arg = getopt (argc, argv, "hm:")) != -1)
135 {
136 switch (arg)
137 {
138- case 'f':
139+ case 'm':
140 socket_file = optarg;
141 break;
142
143@@ -49,7 +49,7 @@
144 default:
145 puts(argv[0]);
146 puts("Usage:");
147- puts(" -f <socket filename>");
148+ puts(" -m <Mir server socket>");
149 puts(" -h: this help text");
150 return -1;
151 }

Subscribers

People subscribed via source and target branches