[PATCH weston 2/3] man: fix prefixes for weston.ini(5)

2018-06-10 Thread Peter Hutterer
Replace a few hardcoded paths with the substitutes

https://gitlab.freedesktop.org/wayland/weston/issues/105

Signed-off-by: Peter Hutterer 
---
 Makefile.am| 2 ++
 man/weston.ini.man | 6 +++---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 9d23b50d..248f0319 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1597,6 +1597,8 @@ MAN_SUBSTS =  
\
-e 's|__weston_native_backend__|$(WESTON_NATIVE_BACKEND)|g' \
-e 's|__weston_modules_dir__|$(pkglibdir)|g'\
-e 's|__weston_shell_client__|$(WESTON_SHELL_CLIENT)|g' \
+   -e 's|__weston_libexecdir__|$(libexecdir)|g'\
+   -e 's|__weston_bindir__|$(bindir)|g'\
-e 's|__version__|$(PACKAGE_VERSION)|g'
 
 SUFFIXES = .1 .5 .7 .man
diff --git a/man/weston.ini.man b/man/weston.ini.man
index b5668b5a..b6bf842f 100644
--- a/man/weston.ini.man
+++ b/man/weston.ini.man
@@ -477,7 +477,7 @@ present. This seat can be constrained like any other.
 .RE
 .SH "INPUT-METHOD SECTION"
 .TP 7
-.BI "path=" "/usr/libexec/weston-keyboard"
+.BI "path=" "__weston_libexecdir__/weston-keyboard"
 sets the path of the on screen keyboard input method (string).
 .RE
 .RE
@@ -560,13 +560,13 @@ The terminal shell (string). Sets the $TERM variable.
 .RE
 .SH "XWAYLAND SECTION"
 .TP 7
-.BI "path=" "/usr/bin/Xwayland"
+.BI "path=" "__weston_bindir__/Xwayland"
 sets the path to the xserver to run (string).
 .RE
 .RE
 .SH "SCREEN-SHARE SECTION"
 .TP 7
-.BI "command=" "/usr/bin/weston --backend=rdp-backend.so \
+.BI "command=" "__weston_bindir__/weston --backend=rdp-backend.so \
 --shell=fullscreen-shell.so --no-clients-resize"
 sets the command to start a fullscreen-shell server for screen sharing 
(string).
 .RE
-- 
2.14.4

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH weston 3/3] compositor: print usage to stdout on success (not stderr)

2018-06-10 Thread Peter Hutterer
Triggered by weston --help, the usage() output should not look like an error.

Note that there is only one caller of usage() at the moment, but let's handle
this here based on the status in case we add other cases.

https://gitlab.freedesktop.org/wayland/weston/issues/112

Signed-off-by: Peter Hutterer 
---
 compositor/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compositor/main.c b/compositor/main.c
index e84857f7..93f92fdc 100644
--- a/compositor/main.c
+++ b/compositor/main.c
@@ -438,7 +438,7 @@ verify_xdg_runtime_dir(void)
 static int
 usage(int error_code)
 {
-   fprintf(stderr,
+   fprintf(error_code == EXIT_SUCCESS ? stdout : stderr,
"Usage: weston [OPTIONS]\n\n"
"This is weston version " VERSION ", the Wayland reference 
compositor.\n"
"Weston supports multiple backends, and depending on which 
backend is in use\n"
-- 
2.14.4

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH weston 1/3] weston-launch: always run through all groups

2018-06-10 Thread Peter Hutterer
If the user is in group 0, we'd exit the loop early with a failure. Make sure
we run through all groups.

https://gitlab.freedesktop.org/wayland/weston/issues/86

Signed-off-by: Peter Hutterer 
---
 libweston/weston-launch.c | 14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/libweston/weston-launch.c b/libweston/weston-launch.c
index 1adcf21a..c076577e 100644
--- a/libweston/weston-launch.c
+++ b/libweston/weston-launch.c
@@ -121,7 +121,7 @@ struct weston_launch {
 union cmsg_data { unsigned char b[4]; int fd; };
 
 static gid_t *
-read_groups(void)
+read_groups(int *ngroups)
 {
int n;
gid_t *groups;
@@ -142,6 +142,8 @@ read_groups(void)
free(groups);
return NULL;
}
+
+   *ngroups = n;
return groups;
 }
 
@@ -150,7 +152,7 @@ weston_launch_allowed(struct weston_launch *wl)
 {
struct group *gr;
gid_t *groups;
-   int i;
+   int ngroups;
 #ifdef HAVE_SYSTEMD_LOGIN
char *session, *seat;
int err;
@@ -161,10 +163,10 @@ weston_launch_allowed(struct weston_launch *wl)
 
gr = getgrnam("weston-launch");
if (gr) {
-   groups = read_groups();
-   if (groups) {
-   for (i = 0; groups[i]; ++i) {
-   if (groups[i] == gr->gr_gid) {
+   groups = read_groups();
+   if (groups && ngroups > 0) {
+   while(ngroups--) {
+   if (groups[ngroups] == gr->gr_gid) {
free(groups);
return true;
}
-- 
2.14.4

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH weston] configure.ac: bump libdrm requirement to 2.4.68

2018-06-10 Thread Peter Hutterer
Had a stale libdrm sitting around which gave me errors, both fixed with the
.68 version.

libweston/pixel-formats.c:291:13: error: ‘DRM_FORMAT_NV24’ undeclared here
(not in a function); did you mean ‘DRM_FORMAT_NV21’?
   .format = DRM_FORMAT_NV24,
 ^~~
 DRM_FORMAT_NV21
libweston/pixel-formats.c:296:13: error: ‘DRM_FORMAT_NV42’ undeclared here
(not in a function); did you mean ‘DRM_FORMAT_NV12’?
   .format = DRM_FORMAT_NV42,
 ^~~
 DRM_FORMAT_NV12

Signed-off-by: Peter Hutterer 
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index ba11b6c8..98887502 100644
--- a/configure.ac
+++ b/configure.ac
@@ -113,7 +113,7 @@ AC_CHECK_FUNCS([mkostemp strchrnul initgroups 
posix_fallocate])
 
 # check for libdrm as a build-time dependency only
 # libdrm 2.4.30 introduced drm_fourcc.h.
-PKG_CHECK_MODULES(LIBDRM, [libdrm >= 2.4.30], [], [AC_MSG_ERROR([
+PKG_CHECK_MODULES(LIBDRM, [libdrm >= 2.4.68], [], [AC_MSG_ERROR([
  libdrm is a hard build-time dependency for libweston core,
  but a sufficient version was not found. However, libdrm
  is not a runtime dependency unless you have features
-- 
2.14.4

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH xserver] xwayland: add "tablet" into the tablet device names

2018-06-10 Thread Peter Hutterer
Changes the device name from "xwayland-stylus" to "xwayland-tablet stylus".
This doesn't fully address #26 but it goes a little step into making it more
human-readable.

https://gitlab.freedesktop.org/wayland/wayland/issues/26

Signed-off-by: Peter Hutterer 
---
 hw/xwayland/xwayland-input.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index 0a37f97bd..a602f0887 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -1389,19 +1389,19 @@ tablet_handle_done(void *data, struct zwp_tablet_v2 
*tablet)
 struct xwl_seat *xwl_seat = xwl_tablet->seat;
 
 if (xwl_seat->stylus == NULL) {
-xwl_seat->stylus = add_device(xwl_seat, "xwayland-stylus", 
xwl_tablet_proc);
+xwl_seat->stylus = add_device(xwl_seat, "xwayland-tablet stylus", 
xwl_tablet_proc);
 ActivateDevice(xwl_seat->stylus, TRUE);
 }
 EnableDevice(xwl_seat->stylus, TRUE);
 
 if (xwl_seat->eraser == NULL) {
-xwl_seat->eraser = add_device(xwl_seat, "xwayland-eraser", 
xwl_tablet_proc);
+xwl_seat->eraser = add_device(xwl_seat, "xwayland-tablet eraser", 
xwl_tablet_proc);
 ActivateDevice(xwl_seat->eraser, TRUE);
 }
 EnableDevice(xwl_seat->eraser, TRUE);
 
 if (xwl_seat->puck == NULL) {
-xwl_seat->puck = add_device(xwl_seat, "xwayland-cursor", 
xwl_tablet_proc);
+xwl_seat->puck = add_device(xwl_seat, "xwayland-tablet cursor", 
xwl_tablet_proc);
 ActivateDevice(xwl_seat->puck, TRUE);
 }
 EnableDevice(xwl_seat->puck, TRUE);
@@ -2147,7 +2147,7 @@ tablet_pad_done(void *data,
 {
 struct xwl_tablet_pad *pad = data;
 
-pad->xdevice = add_device(pad->seat, "xwayland-pad",
+pad->xdevice = add_device(pad->seat, "xwayland-tablet-pad",
   xwl_tablet_pad_proc);
 pad->xdevice->public.devicePrivate = pad;
 ActivateDevice(pad->xdevice, TRUE);
-- 
2.14.4

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel