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

Jonas Ådahl jadahl at gmail.com
Thu Nov 5 18:47:15 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.

I fixed this in a later patch, replacing it with Makefile and regular
expression magic. In the end, for external protocols, it'll be just
three rules, one for eath generated file. See 'Makefile.am: Make the
external xml scanning rule version generic'.

> 
> 
> >  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?

True. Will fix.


Jonas

> 
> > +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




More information about the wayland-devel mailing list