[PATCH weston 01/10] Use fullscreen-shell.xml from wayland-protocols

Bryce Harrington bryce at osg.samsung.com
Thu Nov 5 11:36:09 PST 2015


On Thu, Nov 05, 2015 at 01:19:27PM +0200, Pekka Paalanen wrote:
> On Wed,  4 Nov 2015 16:49:50 +0800
> Jonas Ådahl <jadahl at gmail.com> wrote:
> 
> > Use the fullscreen-shell protocol XML from the wayland-protocols
> > installation, and remove the one we provide ourself.
> > 
> > Signed-off-by: Jonas Ådahl <jadahl at gmail.com>
> > ---
> >  Makefile.am                         |  44 +++++---
> >  clients/fullscreen.c                |  60 +++++------
> >  clients/simple-damage.c             |  18 ++--
> >  clients/simple-dmabuf.c             |  18 ++--
> >  clients/simple-shm.c                |  18 ++--
> >  configure.ac                        |   7 ++
> >  fullscreen-shell/fullscreen-shell.c |  54 +++++-----
> >  protocol/fullscreen-shell.xml       | 206 ------------------------------------
> >  src/compositor-wayland.c            |  48 ++++-----
> >  src/screen-share.c                  |  34 +++---
> >  10 files changed, 159 insertions(+), 348 deletions(-)
> >  delete mode 100644 protocol/fullscreen-shell.xml
> 
> Hi Jonas,
> 
> I'm looking at this just to see how you hooked up the build. Nothing
> too important here. The general idea of the patch is good.
> 
> > 
> > diff --git a/Makefile.am b/Makefile.am
> > index 55e3bcb..2524591 100644
> > --- a/Makefile.am
> > +++ b/Makefile.am
> > @@ -309,8 +309,8 @@ wayland_backend_la_SOURCES = 			\
> >  	src/compositor-wayland.c		\
> >  	shared/helpers.h
> >  nodist_wayland_backend_la_SOURCES =			\
> > -	protocol/fullscreen-shell-protocol.c		\
> > -	protocol/fullscreen-shell-client-protocol.h
> > +	protocol/fullscreen-shell-unstable-v1-protocol.c		\
> > +	protocol/fullscreen-shell-unstable-v1-client-protocol.h
> >  endif
> >  
> >  if ENABLE_RPI_COMPOSITOR
> > @@ -475,8 +475,8 @@ weston_simple_shm_SOURCES = clients/simple-shm.c
> >  nodist_weston_simple_shm_SOURCES =		\
> >  	protocol/xdg-shell-protocol.c		\
> >  	protocol/xdg-shell-client-protocol.h	\
> > -	protocol/fullscreen-shell-protocol.c	\
> > -	protocol/fullscreen-shell-client-protocol.h	\
> > +	protocol/fullscreen-shell-unstable-v1-protocol.c	\
> > +	protocol/fullscreen-shell-unstable-v1-client-protocol.h	\
> >  	protocol/ivi-application-protocol.c		\
> >  	protocol/ivi-application-client-protocol.h
> >  weston_simple_shm_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS)
> > @@ -488,8 +488,8 @@ nodist_weston_simple_damage_SOURCES =		\
> >  	protocol/scaler-client-protocol.h	\
> >  	protocol/xdg-shell-protocol.c		\
> >  	protocol/xdg-shell-client-protocol.h	\
> > -	protocol/fullscreen-shell-protocol.c	\
> > -	protocol/fullscreen-shell-client-protocol.h
> > +	protocol/fullscreen-shell-unstable-v1-protocol.c	\
> > +	protocol/fullscreen-shell-unstable-v1-client-protocol.h
> >  weston_simple_damage_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS)
> >  weston_simple_damage_LDADD = $(SIMPLE_CLIENT_LIBS) libshared.la
> >  
> > @@ -531,8 +531,8 @@ weston_simple_dmabuf_SOURCES = clients/simple-dmabuf.c
> >  nodist_weston_simple_dmabuf_SOURCES =		\
> >  	protocol/xdg-shell-protocol.c		\
> >  	protocol/xdg-shell-client-protocol.h	\
> > -	protocol/fullscreen-shell-protocol.c	\
> > -	protocol/fullscreen-shell-client-protocol.h \
> > +	protocol/fullscreen-shell-unstable-v1-protocol.c	\
> > +	protocol/fullscreen-shell-unstable-v1-client-protocol.h \
> >  	protocol/linux-dmabuf-protocol.c \
> >  	protocol/linux-dmabuf-client-protocol.h
> >  weston_simple_dmabuf_CFLAGS = $(AM_CFLAGS) $(SIMPLE_DMABUF_CLIENT_CFLAGS)
> > @@ -649,8 +649,8 @@ weston_transformed_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
> >  
> >  weston_fullscreen_SOURCES = clients/fullscreen.c
> >  nodist_weston_fullscreen_SOURCES =			\
> > -	protocol/fullscreen-shell-protocol.c		\
> > -	protocol/fullscreen-shell-client-protocol.h
> > +	protocol/fullscreen-shell-unstable-v1-protocol.c		\
> > +	protocol/fullscreen-shell-unstable-v1-client-protocol.h
> >  weston_fullscreen_LDADD = libtoytoolkit.la
> >  weston_fullscreen_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
> >  
> > @@ -763,8 +763,8 @@ BUILT_SOURCES +=					\
> >  	protocol/scaler-protocol.c			\
> >  	protocol/workspaces-client-protocol.h		\
> >  	protocol/workspaces-protocol.c			\
> > -	protocol/fullscreen-shell-protocol.c		\
> > -	protocol/fullscreen-shell-client-protocol.h	\
> > +	protocol/fullscreen-shell-unstable-v1-protocol.c		\
> > +	protocol/fullscreen-shell-unstable-v1-client-protocol.h	\
> >  	protocol/xdg-shell-protocol.c			\
> >  	protocol/xdg-shell-client-protocol.h		\
> >  	protocol/ivi-hmi-controller-protocol.c		\
> > @@ -865,8 +865,8 @@ fullscreen_shell_la_SOURCES =			\
> >  	fullscreen-shell/fullscreen-shell.c	\
> >  	shared/helpers.h
> >  nodist_fullscreen_shell_la_SOURCES =			\
> > -	protocol/fullscreen-shell-protocol.c		\
> > -	protocol/fullscreen-shell-server-protocol.h
> > +	protocol/fullscreen-shell-unstable-v1-protocol.c		\
> > +	protocol/fullscreen-shell-unstable-v1-server-protocol.h
> >  
> >  BUILT_SOURCES += $(nodist_fullscreen_shell_la_SOURCES)
> >  endif
> > @@ -931,8 +931,8 @@ screen_share_la_SOURCES =			\
> >  	src/screen-share.c			\
> >  	shared/helpers.h
> >  nodist_screen_share_la_SOURCES =			\
> > -	protocol/fullscreen-shell-protocol.c		\
> > -	protocol/fullscreen-shell-client-protocol.h
> > +	protocol/fullscreen-shell-unstable-v1-protocol.c		\
> > +	protocol/fullscreen-shell-unstable-v1-client-protocol.h
> >  
> >  endif
> >  
> > @@ -1348,7 +1348,6 @@ EXTRA_DIST +=					\
> >  	protocol/text-cursor-position.xml	\
> >  	protocol/weston-test.xml		\
> >  	protocol/xdg-shell.xml			\
> > -	protocol/fullscreen-shell.xml		\
> >  	protocol/presentation_timing.xml	\
> >  	protocol/scaler.xml			\
> >  	protocol/ivi-application.xml		\
> > @@ -1417,6 +1416,17 @@ $(DOCDIRS):
> >  
> >  doc: $(DOXYGEN_INDICES)
> >  
> > +.SECONDEXPANSION:
> > +
> > +protocol/%-unstable-v1-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/$$*/$$*-unstable-v1.xml
> > +	$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) code < $< > $@
> > +
> > +protocol/%-unstable-v1-server-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/$$*/$$*-unstable-v1.xml
> > +	$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) server-header < $< > $@
> > +
> > +protocol/%-unstable-v1-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/$$*/$$*-unstable-v1.xml
> > +	$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) client-header < $< > $@
> > +
> 
> Slightly unfortunate to have "v1" hardcoded there. I wonder if it'd be
> possible to have some sort of pattern rules and in addition define the
> dependencies explicitly?
> 
> Something in the direction of:
> 
> .-server-protocol.h: .xml
> 	$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) server-header < $< > $@
> 
> protocol/fullscreen-shell-unstable-v1-server-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/fullscreen-shell/fullscreen-shell-unstable-v1.xml
> 
> Oh that gets ugly and long fast, too... not to mention needing three
> lines per xml file. Bleh, whatever works.

Well, we can always optimize these rules to cleanup repetition later,
those are easy refactoring patches.  This is probably fine to take for
now just to get the change into place.

But I also wondered about the v1's everywhere, and how often those will
need changed.  If it's going to be more frequently than hardly ever, we
might want to add a makefile variable so that future number changes are
one liners, and less search and replace exercises.  However, adding this
variable could certainly wait until there is a v2 we have to actually
deal with.

> >  protocol/%-protocol.c : $(top_srcdir)/protocol/%.xml
> >  	$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) code < $< > $@
> >  
> 
> > diff --git a/configure.ac b/configure.ac
> > index e5afbc0..cfac579 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -181,6 +181,13 @@ fi
> >  PKG_CHECK_MODULES(LIBINPUT_BACKEND, [libinput >= 0.8.0])
> >  PKG_CHECK_MODULES(COMPOSITOR, [$COMPOSITOR_MODULES])
> >  
> > +PKG_CHECK_MODULES(WAYLAND_PROTOCOLS, [wayland-protocols >= 0.1.0],
> > +		  [ac_wayland_protocols_pkgdatadir=`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`],
> > +		  [ac_wayland_protocols_pkgdatadir=;])
> 
> Would it not be better to just omit ACTION-IF-NOT-FOUND so that
> PKG_CHECK_MODULES gives the standard error in case wayland-protocols.pc
> is missing?
> 
> > +AS_IF([test "x$ac_wayland_protocols_pkgdatadir" = x],
> > +      [AC_MSG_ERROR([Couldn't find Wayland protocol directory])])
> > +AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, $ac_wayland_protocols_pkgdatadir)
> > +
> >  AC_ARG_ENABLE(wayland-compositor, [  --enable-wayland-compositor],,
> >  	      enable_wayland_compositor=yes)
> >  AM_CONDITIONAL(ENABLE_WAYLAND_COMPOSITOR,
> 
> 
> Thanks,
> pq

> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2
> 
> iQIVAwUBVjs7SCNf5bQRqqqnAQhmFg//ehJGusg65qw+9yuVwmZjtgz7LAiBsWGZ
> rj0oklyZ96EbbB73e1qyRK+o/l0BpSeZQTsD+XhGrh9IHBWUpntjUgayGW16hFUR
> UqbZi73f6/ynXpWA02FyLyCcVjgEuZfNywoJY9btduyA6KCGVDcbDp+vQXQmehbW
> SMRKeJoLOw2Rhc/V7ifVWyaptlMzQQmJ+tpBz5oWMNtLdDpue88bHl0g60qNb069
> GHYaHyrjzSFpxPgHLRT0zZsmDFQXiL55wVqF9YccIudmEgyNLmf4dGyt8+emO33p
> rJnRCYq90mvMkfjnL4M6R3XiucEhuDMqTYd8v2OdoJeriGeuh/naR7q7ey6fIGmV
> x+OUhHdXjB/I1NpIyqbEUnRb3YV3w6jJHwTLStUtmtJxQkfLgnSPZ6VfU49/y1fp
> yBpovFhCs662iOnf/GA+u39dr/wKY06qu/brecx7nXPwVSCtpM0ySr0VuLfP31bt
> nvAY4ESTu+2Ecn0Hen+c0w99kil6MqkXbosAJYLcF5i/5cP6g9efwy5y0C7N5EDt
> k9w/YICN+v9G1alv4XZQ7lG3oHGHCt743MfzL1wnoW9zl+/5b1i8xDvdMio4pDfC
> qoQQdtpkHlNoTHWqKrGEM9szc7uZFxyCp3+D1GLEvtOw+xZfNOzn+FtFpuOaeRMZ
> T2WApCk7AJE=
> =neS/
> -----END PGP SIGNATURE-----


> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel



More information about the wayland-devel mailing list