Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • wayland/weston
  • valpackett/weston
  • daniels/weston
  • pq/weston
  • pochu/weston
  • lubosz/weston
  • phomes/weston
  • mvlad/weston
  • etom/weston
  • agners/weston
  • m.tretter/weston
  • pH5/weston
  • rohanjulka19/weston
  • mvaldina/weston
  • drawat/weston
  • emersion/weston
  • linkmauve/weston
  • jadahl/weston
  • tzimmermann/weston
  • cwjo/weston
  • ktullavik/weston
  • orbitcowboy/weston
  • ivyl/weston
  • afrantzis/weston
  • mol/weston
  • vliaskov/weston
  • inzamam.15/weston
  • xexaxo/weston
  • rmader/weston
  • eucan/weston
  • Eugeniy.Paltsev/weston
  • aknautiyal/weston
  • ascent/weston
  • dima/weston
  • ollieparanoid/weston
  • ant8me/weston
  • rdp.effort/weston
  • ewtoombs/weston
  • sjoerd/weston
  • harishkrupo/weston
  • eyelash/weston
  • zubzub/weston
  • mtey/weston
  • strassek/weston
  • bluesirhl/weston
  • makepost/weston
  • bentiss/weston
  • bugaevc/weston
  • derekf/weston
  • Vivek/weston
  • Rigo-V/weston
  • learning/weston
  • mstoeckl/weston
  • ayaka/weston
  • zumbi/weston
  • maxice8/weston
  • romangg/weston
  • JaredHu/weston
  • justdoGIT/weston
  • swick/weston
  • lucaweiss/weston
  • jameshilliard/weston
  • barry.song/weston
  • borneoa/weston
  • bbeckett/weston
  • Kishore409/weston
  • AIDEA775/weston
  • arandomhuman/weston
  • maos20008/weston
  • mvicomoya/weston
  • creiter/weston
  • bbrezillon/weston
  • hedone21/weston
  • shadeslayer/weston
  • ericruei/weston
  • lujin/weston
  • xeechou/weston
  • JeffyCN/weston
  • ajax/weston
  • hwti/weston
  • VKadasani/weston
  • khosokawa/weston
  • nniro/weston
  • RAOF/weston
  • ofourdan/weston
  • eero-t/weston
  • renjiayuan1314/weston
  • leandrohrb/weston
  • heemin.lee/weston
  • archiesix/weston
  • dude/weston
  • mforney/weston
  • marimeireles/weston
  • vitalyp/weston
  • rajendraprasadkj/weston
  • ahe/weston
  • ekurzinger/weston
  • champagneg/weston
  • dbaker/weston
  • liyi42/weston
  • saavedra.pablo/weston
  • afd/weston
  • tomek/weston
  • Cwiiis/weston
  • pmenzel/weston
  • therealkenc/weston
  • Igortorrente/weston
  • azeps/weston
  • msisov/weston
  • whot/weston
  • Fahien/weston
  • doubleagent3276/weston
  • Heartyharts/weston
  • kchibisov/weston
  • christian-rauch/weston
  • krh/weston
  • JimmyOhn/weston
  • luigi.santivetti/weston
  • bnieuwenhuizen/weston
  • pedestrianlove/weston
  • trem/weston
  • Ganjing0224/weston
  • thewayoftherob/weston
  • harpreetbasra1313/weston
  • dmitry.batrak1/weston
  • carbn/weston
  • n3rdopolis/weston
  • denix0/weston
  • NaveenKumar/weston
  • macpijan/weston
  • bigbear1385/weston
  • ShivakumarVH/weston
  • Ts/weston
  • Rpegusus2233/weston
  • hthiery/weston
  • Laplac2/weston
  • bnlrnz/weston
  • anurup_m/weston
  • kennylevinsen/weston
  • fallahmahid.mahdi/weston
  • dwrobel/weston
  • Ambyjkl/weston
  • mroussin/weston
  • wolf._.lael666/weston
  • xndcn/weston
  • nicolesager7/weston
  • tantan/weston
  • zzag/weston
  • uniontechWu/weston
  • marex/weston
  • 9531718244loco/weston
  • dhobsong/weston
  • jcline/weston
  • marler8997/weston
  • dr3020187/weston
  • cardenasvitealejandro/weston
  • kxing/weston_hpd
  • Robyn.marie/weston
  • Bastian-Krause/weston
  • hitong602/weston
  • filip-hejsek/weston
  • yjheo/weston
  • Alvarito050506/weston
  • enocknyaega/weston
  • yuanye100/weston
  • ColinKinloch/weston
  • pritbisw/weston
  • sameer.lattannavar/weston
  • dos/weston
  • jesstindean85/weston
  • ashie/weston
  • JoseExposito/weston
  • bgjdarm/weston
  • fanbaby6/weston
  • pinchyguey45/weston
  • jayjona42/weston
  • hwentland/weston
  • davidre/weston
  • soerenmeier/weston
  • matth/weston
  • fifi899173/weston
  • HarshaMM/weston
  • obbardc/weston
  • Wladmis/weston
  • alex.kanavin/weston
  • qyliss/weston
  • ekapllaj/weston
  • luckyziv/weston
  • qaqsw24/weston
  • g0hl1n/weston
  • yayowd/qimm
  • Vivalavina/weston
  • Shugyousha/weston
  • flakylawww/weston
  • chewi/weston
  • martinetd/weston
  • jlindgren90/weston
  • jianglei121381/weston
  • tpetazzoni/weston
  • shierote/weston
  • LARathbone/weston
  • wengxt/weston
  • vvavrychuk/weston
  • kusma/weston
  • Emantor/weston
  • Ivaniku/tayland
  • 5HT/weston
  • iason.paraskevopoulos/weston
  • jpewhacker/weston
  • ivan.nikolaenko/weston
  • OctopusET/weston
  • paraaz4959/weston
  • vnguyentrong/weston
  • PaulKocialkowski/weston
  • vyivel/weston
  • khangtb/weston
  • isinyaaa/weston
  • meshki022/weston
  • adoan/weston
  • YDinhVan/weston
  • stolk/weston
  • amaksoft/weston
  • flto/weston
  • molinari/weston
  • k77951586/weston
  • t-8ch/weston
  • mominurisiamm887/weston
  • SergioGDR/weston
  • xiangxuy/weston
  • petervdperk/weston
  • zhourunsheng2008/weston
  • vanvugt/weston
  • gilvbp/weston
  • gfxstrand/weston
  • rhelmot/weston
  • yadneshk/weston
  • phnaharris/weston
  • pixellon/weston
  • askebm/weston
  • ChaoGuo/weston
  • lk1025/weston
  • jh-hsd/weston
  • mihlenfeldt/weston
  • wujiansun/weston
  • bmkimg/weston
  • smit-mayani/weston
  • pritamabiswas/weston
  • adarshgm/weston
  • zzyiwei/weston
  • enunes/weston
  • HeYong/weston
  • rawoul/weston
  • andreinonea/weston
  • pleasurefish/weston
  • Foreal/weston
  • kraj/weston
  • rsmith/weston
  • zhouliang/weston
  • Benjamin_Loison/weston
  • daissi/weston
  • sophia/weston
  • wismill/weston
  • rgonzalez/weston
  • diegonieto/weston
  • rgallaispou/weston
  • sardemff7/weston
  • puhui/weston
  • vanfanel/weston
  • jwillikers/weston
  • gtristan/weston
  • ghishadow/weston
  • antonino/weston
  • Zamundaaa/weston
  • bl4ckb0ne/weston
  • david.turner/weston
  • surban/weston
  • chienpv/weston
  • sami/weston
  • chiragkhurana/weston
  • Calandracas/weston
  • lfrb/weston
  • abhinavk/weston
  • joantolo/weston
  • leoli/weston
  • benh/weston
  • igor.torrente/weston
  • jeri.li/weston
  • C0rn3j/weston
  • bbara93/weston
  • heftig/weston
  • longjunyu2/weston
  • davidedmundson/weston
  • zeerd/weston
  • tmaillart1/weston
  • phreer/weston
  • ianr/weston
  • gyeyoung976/weston
  • Trigger.Huang/weston
  • ljia5/weston
  • snow/weston
  • kang-sooyeon/weston
  • marysaka/weston
  • tmaillart/weston
  • Qingwu-Li/weston
  • BBaoVanC/weston
305 results
Show changes
Commits on Source (114)
Showing with 2677 additions and 292 deletions
......@@ -9,12 +9,14 @@ before_script:
- echo '#!/bin/sh' > /usr/sbin/policy-rc.d
- echo 'exit 101' >> /usr/sbin/policy-rc.d
- chmod +x /usr/sbin/policy-rc.d
- echo 'deb http://deb.debian.org/debian stretch-backports main' >> /etc/apt/sources.list
- apt-get update
- apt-get -y --no-install-recommends install build-essential automake autoconf libtool pkg-config libexpat1-dev libffi-dev libxml2-dev libpixman-1-dev libpng-dev libjpeg-dev libcolord-dev mesa-common-dev libglu1-mesa-dev libegl1-mesa-dev libgles2-mesa-dev libwayland-dev libxcb1-dev libxcb-composite0-dev libxcb-xfixes0-dev libxcb-xkb-dev libx11-xcb-dev libx11-dev libudev-dev libgbm-dev libxkbcommon-dev libcairo2-dev libpango1.0-dev libgdk-pixbuf2.0-dev libxcursor-dev libmtdev-dev libpam0g-dev libvpx-dev libsystemd-dev libinput-dev libwebp-dev libjpeg-dev libva-dev liblcms2-dev git
- apt-get -y --no-install-recommends install build-essential automake autoconf libtool pkg-config libexpat1-dev libffi-dev libxml2-dev libpixman-1-dev libpng-dev libjpeg-dev libcolord-dev mesa-common-dev libglu1-mesa-dev libegl1-mesa-dev libgles2-mesa-dev libwayland-dev libxcb1-dev libxcb-composite0-dev libxcb-xfixes0-dev libxcb-xkb-dev libx11-xcb-dev libx11-dev libudev-dev libgbm-dev libxkbcommon-dev libcairo2-dev libpango1.0-dev libgdk-pixbuf2.0-dev libxcursor-dev libmtdev-dev libpam0g-dev libvpx-dev libsystemd-dev libevdev-dev libinput-dev libwebp-dev libjpeg-dev libva-dev liblcms2-dev git libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev freerdp2-dev curl python3-pip python3-setuptools ninja-build
- pip3 install --user git+https://github.com/mesonbuild/meson.git@0.49
- mkdir -p /tmp/.X11-unix
- chmod 777 /tmp/.X11-unix
build-native:
build-native-autotools:
stage: build
script:
- git clone --depth=1 git://anongit.freedesktop.org/git/wayland/wayland-protocols
......@@ -34,7 +36,7 @@ build-native:
- export BUILDDIR="$(pwd)/build-$BUILD_ID"
- mkdir "$BUILDDIR" "$PREFIX"
- cd "$BUILDDIR"
- ../autogen.sh --prefix="$PREFIX" --disable-setuid-install --enable-xwayland --enable-x11-compositor --enable-drm-compositor --enable-wayland-compositor --enable-headless-compositor --enable-fbdev-compositor --disable-rdp-compositor --enable-screen-sharing --enable-vaapi-recorder --enable-simple-clients --enable-simple-egl-clients --enable-simple-dmabuf-drm-client --enable-simple-dmabuf-v4l-client --enable-clients --enable-resize-optimization --enable-weston-launch --enable-fullscreen-shell --enable-colord --enable-dbus --enable-systemd-login --enable-junit-xml --enable-ivi-shell --enable-wcap-tools --disable-libunwind --enable-demo-clients-install --enable-lcms --with-cairo=image
- ../autogen.sh --prefix="$PREFIX" --disable-setuid-install --enable-xwayland --enable-x11-compositor --enable-drm-compositor --enable-wayland-compositor --enable-headless-compositor --enable-fbdev-compositor --enable-rdp-compositor --enable-screen-sharing --enable-vaapi-recorder --enable-simple-clients --enable-simple-egl-clients --enable-simple-dmabuf-drm-client --enable-simple-dmabuf-v4l-client --enable-clients --enable-resize-optimization --enable-weston-launch --enable-fullscreen-shell --enable-colord --enable-dbus --enable-systemd-login --enable-junit-xml --enable-ivi-shell --enable-wcap-tools --disable-libunwind --enable-demo-clients-install --enable-lcms --with-cairo=image --enable-remoting --enable-autotools
- make all
- make check
- make install
......@@ -47,3 +49,36 @@ build-native:
- build-*/*.log
- build-*/logs
- prefix-*
build-native-meson:
stage: build
script:
- git clone --depth=1 git://anongit.freedesktop.org/git/wayland/wayland-protocols
- export WAYLAND_PROTOCOLS_DIR="$(pwd)/prefix-wayland-protocols"
- export PKG_CONFIG_PATH="$WAYLAND_PROTOCOLS_DIR/share/pkgconfig:$PKG_CONFIG_PATH"
- export MAKEFLAGS="-j4"
- cd wayland-protocols
- git show -s HEAD
- mkdir build
- cd build
- ../autogen.sh --prefix="$WAYLAND_PROTOCOLS_DIR"
- make install
- cd ../../
- export XDG_RUNTIME_DIR="$(mktemp -p $(pwd) -d xdg-runtime-XXXXXX)"
- export BUILD_ID="weston-$CI_JOB_NAME_$CI_COMMIT_SHA-$CI_JOB_ID"
- export PREFIX="$(pwd)/prefix-$BUILD_ID"
- export BUILDDIR="$(pwd)/build-$BUILD_ID"
- export PATH=~/.local/bin:$PATH
- mkdir "$BUILDDIR" "$PREFIX"
- cd "$BUILDDIR"
- meson --prefix="$PREFIX" -Dsimple-dmabuf-drm=intel ..
- ninja -k0
- ninja install
- ninja test
- ninja clean
artifacts:
name: weston-$CI_COMMIT_SHA-$CI_JOB_ID
when: always
paths:
- build-*/meson-logs
- prefix-*
......@@ -10,7 +10,7 @@ libweston_module_LTLIBRARIES =
noinst_LTLIBRARIES =
BUILT_SOURCES =
AM_DISTCHECK_CONFIGURE_FLAGS = --disable-setuid-install
AM_DISTCHECK_CONFIGURE_FLAGS = --disable-setuid-install --enable-autotools
EXTRA_DIST = weston.ini.in ivi-shell/weston.ini.in
......@@ -57,7 +57,7 @@ CLEANFILES = weston.ini \
install-libweston_moduleLTLIBRARIES install-moduleLTLIBRARIES: install-libLTLIBRARIES
lib_LTLIBRARIES = libweston-@LIBWESTON_MAJOR@.la
libweston_@LIBWESTON_MAJOR@_la_CPPFLAGS = $(AM_CPPFLAGS) -DIN_WESTON
libweston_@LIBWESTON_MAJOR@_la_CPPFLAGS = $(AM_CPPFLAGS)
libweston_@LIBWESTON_MAJOR@_la_CFLAGS = $(AM_CFLAGS) \
$(COMPOSITOR_CFLAGS) $(EGL_CFLAGS) $(LIBDRM_CFLAGS)
libweston_@LIBWESTON_MAJOR@_la_LIBADD = $(COMPOSITOR_LIBS) \
......@@ -94,10 +94,15 @@ libweston_@LIBWESTON_MAJOR@_la_SOURCES = \
libweston/timeline-object.h \
libweston/linux-dmabuf.c \
libweston/linux-dmabuf.h \
libweston/linux-explicit-synchronization.c \
libweston/linux-explicit-synchronization.h \
libweston/linux-sync-file.c \
libweston/linux-sync-file.h \
libweston/pixel-formats.c \
libweston/pixel-formats.h \
libweston/weston-debug.c \
libweston/weston-debug.h \
shared/fd-util.h \
shared/helpers.h \
shared/matrix.c \
shared/matrix.h \
......@@ -111,7 +116,7 @@ dist_libweston_@LIBWESTON_MAJOR@_data_DATA = \
protocol/weston-debug.xml
lib_LTLIBRARIES += libweston-desktop-@LIBWESTON_MAJOR@.la
libweston_desktop_@LIBWESTON_MAJOR@_la_CPPFLAGS = $(AM_CPPFLAGS) -DIN_WESTON
libweston_desktop_@LIBWESTON_MAJOR@_la_CPPFLAGS = $(AM_CPPFLAGS)
libweston_desktop_@LIBWESTON_MAJOR@_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS)
libweston_desktop_@LIBWESTON_MAJOR@_la_LIBADD = \
libweston-@LIBWESTON_MAJOR@.la \
......@@ -177,23 +182,25 @@ nodist_libweston_@LIBWESTON_MAJOR@_la_SOURCES = \
protocol/input-timestamps-unstable-v1-protocol.c \
protocol/input-timestamps-unstable-v1-server-protocol.h \
protocol/weston-touch-calibration-protocol.c \
protocol/weston-touch-calibration-server-protocol.h
protocol/weston-touch-calibration-server-protocol.h \
protocol/linux-explicit-synchronization-unstable-v1-protocol.c \
protocol/linux-explicit-synchronization-unstable-v1-server-protocol.h
BUILT_SOURCES += $(nodist_libweston_@LIBWESTON_MAJOR@_la_SOURCES)
bin_PROGRAMS += weston
weston_LDFLAGS = -export-dynamic
weston_CPPFLAGS = $(AM_CPPFLAGS) -DIN_WESTON \
-DMODULEDIR='"$(moduledir)"' \
weston_CPPFLAGS = $(AM_CPPFLAGS) -DMODULEDIR='"$(moduledir)"' \
-DXSERVER_PATH='"@XSERVER_PATH@"'
weston_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) $(LIBINPUT_BACKEND_CFLAGS) \
$(PTHREAD_CFLAGS)
$(PTHREAD_CFLAGS) $(LIBEVDEV_CFLAGS)
weston_LDADD = libshared.la libweston-@LIBWESTON_MAJOR@.la \
$(COMPOSITOR_LIBS) \
$(DL_LIBS) $(LIBINPUT_BACKEND_LIBS) \
$(CLOCK_GETRES_LIBS) \
$(PTHREAD_LIBS) \
$(LIBEVDEV_LIBS) \
-lm
weston_SOURCES = \
......@@ -336,7 +343,9 @@ gl_renderer_la_SOURCES = \
libweston/gl-renderer.c \
libweston/vertex-clipping.c \
libweston/vertex-clipping.h \
libweston/weston-sync-file.h \
libweston/linux-sync-file.c \
libweston/linux-sync-file.h \
libweston/linux-sync-file-uapi.h \
shared/helpers.h
endif
......@@ -548,11 +557,10 @@ spring_tool_SOURCES = \
if BUILD_CLIENTS
bin_PROGRAMS += weston-terminal weston-info weston-debug
bin_PROGRAMS += weston-terminal weston-info weston-debug weston-screenshooter
libexec_PROGRAMS += \
weston-desktop-shell \
weston-screenshooter \
weston-keyboard \
weston-simple-im
......@@ -598,9 +606,7 @@ nodist_weston_simple_shm_SOURCES = \
protocol/xdg-shell-unstable-v6-protocol.c \
protocol/xdg-shell-unstable-v6-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
protocol/fullscreen-shell-unstable-v1-client-protocol.h
weston_simple_shm_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS)
weston_simple_shm_LDADD = $(SIMPLE_CLIENT_LIBS) libshared.la
......@@ -640,9 +646,7 @@ demo_clients += weston-simple-egl
weston_simple_egl_SOURCES = clients/simple-egl.c
nodist_weston_simple_egl_SOURCES = \
protocol/xdg-shell-unstable-v6-protocol.c \
protocol/xdg-shell-unstable-v6-client-protocol.h \
protocol/ivi-application-protocol.c \
protocol/ivi-application-client-protocol.h
protocol/xdg-shell-unstable-v6-client-protocol.h
weston_simple_egl_CFLAGS = $(AM_CFLAGS) $(SIMPLE_EGL_CLIENT_CFLAGS)
weston_simple_egl_LDADD = $(SIMPLE_EGL_CLIENT_LIBS) -lm
endif
......@@ -681,6 +685,22 @@ weston_simple_dmabuf_v4l_CFLAGS = $(AM_CFLAGS) $(SIMPLE_DMABUF_V4L_CLIENT_CFLAGS
weston_simple_dmabuf_v4l_LDADD = $(SIMPLE_DMABUF_V4L_CLIENT_LIBS) libshared.la
endif
if BUILD_SIMPLE_DMABUF_EGL_CLIENT
demo_clients += weston-simple-dmabuf-egl
weston_simple_dmabuf_egl_SOURCES = clients/simple-dmabuf-egl.c
nodist_weston_simple_dmabuf_egl_SOURCES = \
protocol/xdg-shell-unstable-v6-protocol.c \
protocol/xdg-shell-unstable-v6-client-protocol.h \
protocol/fullscreen-shell-unstable-v1-protocol.c \
protocol/fullscreen-shell-unstable-v1-client-protocol.h \
protocol/linux-dmabuf-unstable-v1-protocol.c \
protocol/linux-dmabuf-unstable-v1-client-protocol.h \
protocol/linux-explicit-synchronization-unstable-v1-protocol.c \
protocol/linux-explicit-synchronization-v1-client-protocol.h
weston_simple_dmabuf_egl_CFLAGS = $(AM_CFLAGS) $(SIMPLE_DMABUF_EGL_CLIENT_CFLAGS)
weston_simple_dmabuf_egl_LDADD = $(SIMPLE_DMABUF_EGL_CLIENT_LIBS) libshared.la -lm
endif
noinst_LTLIBRARIES += libtoytoolkit.la
libtoytoolkit_la_SOURCES = \
......@@ -695,8 +715,6 @@ nodist_libtoytoolkit_la_SOURCES = \
protocol/viewporter-client-protocol.h \
protocol/xdg-shell-unstable-v6-protocol.c \
protocol/xdg-shell-unstable-v6-client-protocol.h \
protocol/ivi-application-protocol.c \
protocol/ivi-application-client-protocol.h \
protocol/pointer-constraints-unstable-v1-protocol.c \
protocol/pointer-constraints-unstable-v1-client-protocol.h \
protocol/relative-pointer-unstable-v1-protocol.c \
......@@ -955,7 +973,9 @@ BUILT_SOURCES += \
protocol/input-timestamps-unstable-v1-protocol.c \
protocol/input-timestamps-unstable-v1-client-protocol.h \
protocol/xdg-output-unstable-v1-protocol.c \
protocol/xdg-output-unstable-v1-client-protocol.h
protocol/xdg-output-unstable-v1-client-protocol.h \
protocol/linux-explicit-synchronization-unstable-v1-protocol.c \
protocol/linux-explicit-synchronization-unstable-v1-client-protocol.h
westondatadir = $(datadir)/weston
dist_westondata_DATA = \
......@@ -1013,8 +1033,7 @@ desktop_shell_la_CPPFLAGS = \
-I$(top_srcdir)/libweston \
-I$(top_builddir)/desktop-shell \
-DMODULEDIR='"$(moduledir)"' \
-DLIBEXECDIR='"$(libexecdir)"' \
-DIN_WESTON
-DLIBEXECDIR='"$(libexecdir)"'
desktop_shell_la_LDFLAGS = -module -avoid-version
desktop_shell_la_LIBADD = libshared.la libweston-desktop-@LIBWESTON_MAJOR@.la $(COMPOSITOR_LIBS)
......@@ -1040,8 +1059,7 @@ fullscreen_shell_la_CPPFLAGS = \
-I$(top_builddir)/protocol \
-I$(top_srcdir)/shared \
-I$(top_builddir)/libweston \
-I$(top_srcdir)/libweston \
-DIN_WESTON
-I$(top_srcdir)/libweston
fullscreen_shell_la_LDFLAGS = -module -avoid-version
fullscreen_shell_la_LIBADD = \
......@@ -1069,6 +1087,7 @@ ivi_shell_la_LDFLAGS = -module -avoid-version
ivi_shell_la_LIBADD = \
libshared.la \
libweston-@LIBWESTON_MAJOR@.la \
libweston-desktop-@LIBWESTON_MAJOR@.la \
$(COMPOSITOR_LIBS)
ivi_shell_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS)
ivi_shell_la_SOURCES = \
......@@ -1297,7 +1316,8 @@ weston_tests = \
subsurface.weston \
subsurface-shot.weston \
devices.weston \
touch.weston
touch.weston \
linux-explicit-synchronization.weston
AM_TESTS_ENVIRONMENT = \
abs_builddir='$(abs_builddir)'; export abs_builddir; \
......@@ -1366,11 +1386,6 @@ weston_test_desktop_shell_la_SOURCES = \
tests/weston-test-desktop-shell.c \
shared/helpers.h
if ENABLE_EGL
weston_test_la_CFLAGS += $(EGL_TESTS_CFLAGS)
weston_test_la_LDFLAGS += $(EGL_TESTS_LIBS)
endif
libtest_runner_la_SOURCES = \
tests/weston-test-runner.c \
tests/weston-test-runner.h
......@@ -1496,6 +1511,14 @@ touch_weston_SOURCES = tests/touch-test.c
touch_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS)
touch_weston_LDADD = libtest-client.la
linux_explicit_synchronization_weston_SOURCES = \
tests/linux-explicit-synchronization-test.c
nodist_linux_explicit_synchronization_weston_SOURCES = \
protocol/linux-explicit-synchronization-unstable-v1-protocol.c \
protocol/linux-explicit-synchronization-unstable-v1-client-protocol.h
linux_explicit_synchronization_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS)
linux_explicit_synchronization_weston_LDADD = libtest-client.la
if ENABLE_XWAYLAND_TEST
weston_tests += xwayland-test.weston
xwayland_test_weston_SOURCES = tests/xwayland-test.c
......@@ -1619,7 +1642,7 @@ noinst_LTLIBRARIES += \
surface_screenshot_la_LIBADD = libshared.la $(test_module_libadd)
surface_screenshot_la_LDFLAGS = $(test_module_ldflags)
surface_screenshot_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS)
surface_screenshot_la_SOURCES = tests/surface-screenshot.c
surface_screenshot_la_SOURCES = tests/surface-screenshot-test.c
#
......@@ -1712,3 +1735,23 @@ protocol/%-server-protocol.h : $(top_srcdir)/protocol/%.xml
protocol/%-client-protocol.h : $(top_srcdir)/protocol/%.xml
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) client-header < $< > $@
EXTRA_DIST += \
clients/meson.build \
compositor/meson.build \
data/meson.build \
desktop-shell/meson.build \
fullscreen-shell/meson.build \
ivi-shell/meson.build \
libweston-desktop/meson.build \
libweston/git-version.h.meson \
libweston/meson.build \
man/meson.build \
meson.build \
meson_options.txt \
protocol/meson.build \
remoting/meson.build \
shared/meson.build \
tests/meson.build \
wcap/meson.build \
xwayland/meson.build
......@@ -39,11 +39,38 @@ to make code or non-technical contributions to Weston.
Building Weston
===============
Weston is built using autotools, with `autogen.sh` and `make`. It often depends
Weston is built using [Meson](https://mesonbuild.com/). Weston often depends
on the current release versions of
[Wayland](https://gitlab.freedesktop.org/wayland/wayland) and
[wayland-protocols](https://cgit.freedesktop.org/wayland/wayland-protocols).
If necessary, the latest Meson can be installed as a user with:
$ pip3 install --user meson
Weston's Meson build does not do autodetection and it defaults to all
features enabled, which means you likely hit missing dependencies on the first
try. If a dependency is avoidable through a build option, the error message
should tell you what option can be used to avoid it. You may need to disable
several features if you want to avoid certain dependencies.
$ git clone https://gitlab.freedesktop.org/wayland/weston.git
$ cd weston
$ meson build/ --prefix=...
$ ninja -C build/ install
$ cd ..
The `meson` command populates the build directory. This step can
fail due to missing dependencies. Any build options you want can be added on
that line, e.g. `meson build/ --prefix=... -Dsimple-dmabuf-drm=intel`.
All the build options can be found in the file
[meson_options.txt](meson_options.txt).
Once the build directory has been successfully populated, you can inspect the
configuration with `meson configure build/`. If you need to change an
option, you can do e.g.
`meson configure build/ -Dsimple-dmabuf-drm=intel`.
Every push to the Weston master repository and its forks is built using GitLab
CI. [Reading the configuration](.gitlab-ci.yml) may provide a useful example of
how to build and install Weston.
......@@ -88,6 +115,13 @@ Libweston was first introduced in Weston 1.12, and is expected to
continue evolving through many Weston releases before it achieves a
stable API and feature completeness.
Libweston's primary purpose is exporting an API for creating Wayland
compositors. Libweston's secondary purpose is to export the weston_config API
so that third party plugins and helper programs can read `weston.ini` if they
want to. However, these two scopes are orthogonal and independent. At no point
will the compositor functionality use or depend on the weston_config
functionality.
API/ABI (in)stability and parallel installability
-------------------------------------------------
......
......@@ -273,11 +273,10 @@ static void __attribute__ ((format (printf, 1, 2)))
dbg(const char *fmt, ...)
{
#ifdef DEBUG
int l;
va_list argp;
va_start(argp, fmt);
l = vfprintf(stderr, fmt, argp);
vfprintf(stderr, fmt, argp);
va_end(argp);
#endif
}
......
if get_option('resize-pool')
config_h.set('USE_RESIZE_POOL', '1')
endif
srcs_toytoolkit = [
'window.c',
xdg_shell_unstable_v6_client_protocol_h,
xdg_shell_unstable_v6_protocol_c,
text_cursor_position_client_protocol_h,
text_cursor_position_protocol_c,
relative_pointer_unstable_v1_client_protocol_h,
relative_pointer_unstable_v1_protocol_c,
pointer_constraints_unstable_v1_client_protocol_h,
pointer_constraints_unstable_v1_protocol_c,
ivi_application_client_protocol_h,
ivi_application_protocol_c,
]
deps_toytoolkit = [
dep_wayland_client,
dep_lib_cairo_shared,
dep_xkbcommon,
dependency('wayland-cursor'),
cc.find_library('util'),
]
lib_toytoolkit = static_library(
'toytoolkit',
srcs_toytoolkit,
include_directories: include_directories('..', '../shared'),
dependencies: deps_toytoolkit,
install: false,
)
dep_toytoolkit = declare_dependency(
link_with: lib_toytoolkit,
dependencies: deps_toytoolkit,
)
simple_clients = [
{
'name': 'damage',
'sources': [
'simple-damage.c',
viewporter_client_protocol_h,
viewporter_protocol_c,
xdg_shell_unstable_v6_client_protocol_h,
xdg_shell_unstable_v6_protocol_c,
fullscreen_shell_unstable_v1_client_protocol_h,
fullscreen_shell_unstable_v1_protocol_c,
],
'dep_objs': [ dep_wayland_client, dep_libshared ]
},
{
'name': 'dmabuf-egl',
'sources': [
'simple-dmabuf-egl.c',
linux_dmabuf_unstable_v1_client_protocol_h,
linux_dmabuf_unstable_v1_protocol_c,
linux_explicit_synchronization_unstable_v1_client_protocol_h,
linux_explicit_synchronization_unstable_v1_protocol_c,
xdg_shell_unstable_v6_client_protocol_h,
xdg_shell_unstable_v6_protocol_c,
fullscreen_shell_unstable_v1_client_protocol_h,
fullscreen_shell_unstable_v1_protocol_c,
],
'dep_objs': [
dep_wayland_client,
dep_libdrm,
dep_libm
],
'deps': [ 'egl', 'glesv2', 'gbm' ]
},
{
'name': 'dmabuf-v4l',
'sources': [
'simple-dmabuf-v4l.c',
linux_dmabuf_unstable_v1_client_protocol_h,
linux_dmabuf_unstable_v1_protocol_c,
xdg_shell_unstable_v6_client_protocol_h,
xdg_shell_unstable_v6_protocol_c,
fullscreen_shell_unstable_v1_client_protocol_h,
fullscreen_shell_unstable_v1_protocol_c,
],
'dep_objs': [ dep_wayland_client, dep_libdrm_headers ]
},
{
'name': 'egl',
'sources': [
'simple-egl.c',
xdg_shell_unstable_v6_client_protocol_h,
xdg_shell_unstable_v6_protocol_c,
ivi_application_client_protocol_h,
ivi_application_protocol_c,
],
'dep_objs': [ dep_wayland_client, dep_libshared, dep_libm ],
'deps': [ 'egl', 'wayland-egl', 'glesv2', 'wayland-cursor' ]
},
# weston-simple-im is handled specially separately due to install_dir and odd window.h usage
{
'name': 'shm',
'sources': [
'simple-shm.c',
xdg_shell_unstable_v6_client_protocol_h,
xdg_shell_unstable_v6_protocol_c,
fullscreen_shell_unstable_v1_client_protocol_h,
fullscreen_shell_unstable_v1_protocol_c,
ivi_application_client_protocol_h,
ivi_application_protocol_c,
],
'dep_objs': [ dep_wayland_client, dep_libshared ]
},
{
'name': 'touch',
'sources': [
'simple-touch.c',
],
'dep_objs': [ dep_wayland_client, dep_libshared ]
},
]
simple_clients_enabled = get_option('simple-clients')
simple_build_all = simple_clients_enabled.contains('all')
foreach t : simple_clients
if simple_build_all or simple_clients_enabled.contains(t.get('name'))
t_name = 'weston-simple-' + t.get('name')
t_deps = t.get('dep_objs', [])
foreach depname : t.get('deps', [])
dep = dependency(depname, required: false)
if not dep.found()
error('@0@ requires @1@ which was not found. If you rather not build this, drop "@2@" from simple-clients option.'.format(t_name, depname, t.get('name')))
endif
t_deps += dep
endforeach
executable(
t_name, t.get('sources'),
include_directories: include_directories('..'),
dependencies: t_deps,
install: true
)
endif
endforeach
if simple_build_all or simple_clients_enabled.contains('im')
executable(
'weston-simple-im', [
'simple-im.c',
input_method_unstable_v1_client_protocol_h,
input_method_unstable_v1_protocol_c,
],
include_directories: include_directories('..'),
dependencies: [
dep_libshared,
dep_wayland_client,
dep_xkbcommon,
dependency('wayland-cursor'),
dependency('cairo')
],
install: true,
install_dir: dir_libexec
)
endif
tools_enabled = get_option('tools')
tools_list = [
{
'name': 'calibrator',
'sources': [
'calibrator.c',
'../shared/matrix.c',
],
'deps': [ dep_toytoolkit ],
},
{
'name': 'debug',
'sources': [
'weston-debug.c',
weston_debug_client_protocol_h,
weston_debug_protocol_c,
],
'deps': [ dep_wayland_client ]
},
{
'name': 'info',
'sources': [
'weston-info.c',
presentation_time_client_protocol_h,
presentation_time_protocol_c,
linux_dmabuf_unstable_v1_client_protocol_h,
linux_dmabuf_unstable_v1_protocol_c,
tablet_unstable_v2_client_protocol_h,
tablet_unstable_v2_protocol_c,
xdg_output_unstable_v1_client_protocol_h,
xdg_output_unstable_v1_protocol_c,
],
'deps': [ dep_wayland_client, dep_libshared ]
},
{
'name': 'terminal',
'sources': [ 'terminal.c' ],
'deps': [ dep_toytoolkit ],
},
{
'name': 'touch-calibrator',
'sources': [
'touch-calibrator.c',
'../shared/matrix.c',
weston_touch_calibration_client_protocol_h,
weston_touch_calibration_protocol_c,
],
'deps': [ dep_toytoolkit ],
},
]
foreach t : tools_list
if tools_enabled.contains(t.get('name'))
executable(
'weston-@0@'.format(t.get('name')),
t.get('sources'),
include_directories: include_directories('..', '../shared'),
dependencies: t.get('deps', []),
install: true
)
endif
endforeach
demo_clients = [
{ 'basename': 'clickdot' },
{
'basename': 'cliptest',
'add_sources': [ '../libweston/vertex-clipping.c' ]
},
{ 'basename': 'confine' },
{ 'basename': 'dnd' },
{
'basename': 'editor',
'add_sources': [
text_input_unstable_v1_client_protocol_h,
text_input_unstable_v1_protocol_c,
],
'deps': [ 'pangocairo' ]
},
{ 'basename': 'eventdemo' },
{ 'basename': 'flower' },
{
'basename': 'fullscreen',
'add_sources': [
fullscreen_shell_unstable_v1_client_protocol_h,
fullscreen_shell_unstable_v1_protocol_c,
]
},
{ 'basename': 'image' },
{ 'basename': 'multi-resource' },
{
'basename': 'presentation-shm',
'add_sources': [
presentation_time_client_protocol_h,
presentation_time_protocol_c,
]
},
{ 'basename': 'resizor' },
{
'basename': 'scaler',
'add_sources': [
viewporter_client_protocol_h,
viewporter_protocol_c,
]
},
{ 'basename': 'smoke' },
{ 'basename': 'stacking' },
{
'basename': 'subsurfaces',
'deps': [ 'egl', 'glesv2', 'wayland-egl' ]
},
{ 'basename': 'transformed' },
]
if get_option('demo-clients')
foreach t : demo_clients
t_name = 'weston-' + t.get('basename')
t_srcs = [ t.get('basename') + '.c' ] + t.get('add_sources', [])
t_deps = [ dep_toytoolkit ]
foreach depname : t.get('deps', [])
dep = dependency(depname, required: false)
if not dep.found()
error('@0@ requires \'@1@\' which was not found. If you rather not build this, set \'-Ddemo-clients=false\'.'.format(t_name, depname))
endif
t_deps += dep
endforeach
executable(
t_name, t_srcs,
include_directories: include_directories('..', '../shared'),
dependencies: t_deps,
install: true
)
endforeach
endif
simple_dmabuf_drm_opts = get_option('simple-dmabuf-drm')
simple_dmabuf_drm_deps = []
foreach driver : [ 'etnaviv', 'intel', 'freedreno' ]
if simple_dmabuf_drm_opts.contains(driver)
required = true
enabled = true
elif simple_dmabuf_drm_opts.contains('auto')
required = get_option('auto_features').enabled()
enabled = not get_option('auto_features').disabled()
else
enabled = false
endif
if enabled
dep = dependency('libdrm_' + driver, required: false)
if dep.found()
simple_dmabuf_drm_deps += dep
config_h.set('HAVE_LIBDRM_' + driver.to_upper(), 1)
elif required
error('simple-dmabuf-drm is configured to use @0@ but it was not found. Or, you can remove @1@ from \'-Dsimple-dmabuf-drm\' list.'.format('libdrm_' + driver, driver))
endif
endif
endforeach
if simple_dmabuf_drm_deps.length() > 0
executable(
'weston-simple-dmabuf-drm',
'simple-dmabuf-drm.c',
xdg_shell_unstable_v6_client_protocol_h,
xdg_shell_unstable_v6_protocol_c,
fullscreen_shell_unstable_v1_client_protocol_h,
fullscreen_shell_unstable_v1_protocol_c,
linux_dmabuf_unstable_v1_client_protocol_h,
linux_dmabuf_unstable_v1_protocol_c,
include_directories: include_directories('..'),
dependencies: [
dep_wayland_client,
dep_libdrm,
simple_dmabuf_drm_deps
],
install: true
)
endif
if get_option('shell-desktop')
exe_keyboard = executable(
'weston-keyboard',
'keyboard.c',
text_input_unstable_v1_client_protocol_h,
text_input_unstable_v1_protocol_c,
input_method_unstable_v1_client_protocol_h,
input_method_unstable_v1_protocol_c,
include_directories: include_directories('..'),
dependencies: dep_toytoolkit,
install_dir: get_option('libexecdir'),
install: true
)
env_modmap += 'weston-keyboard=@0@;'.format(exe_keyboard.full_path())
exe_shooter = executable(
'weston-screenshooter',
'screenshot.c',
weston_screenshooter_client_protocol_h,
weston_screenshooter_protocol_c,
include_directories: include_directories('..'),
dependencies: dep_toytoolkit,
install_dir: get_option('bindir'),
install: true
)
env_modmap += 'weston-screenshooter=@0@;'.format(exe_shooter.full_path())
exe_shell_desktop = executable(
'weston-desktop-shell',
'desktop-shell.c',
weston_desktop_shell_client_protocol_h,
weston_desktop_shell_protocol_c,
include_directories: include_directories('..'),
dependencies: dep_toytoolkit,
install_dir: get_option('libexecdir'),
install: true
)
env_modmap += 'weston-desktop-shell=@0@;'.format(exe_shell_desktop.full_path())
endif
if get_option('shell-ivi')
exe_shell_ivi_ui = executable(
'weston-ivi-shell-user-interface',
'ivi-shell-user-interface.c',
ivi_hmi_controller_client_protocol_h,
ivi_hmi_controller_protocol_c,
ivi_application_client_protocol_h,
ivi_application_protocol_c,
include_directories: include_directories('..'),
dependencies: dep_toytoolkit,
install: true,
install_dir: get_option('libexecdir')
)
env_modmap += 'weston-ivi-shell-user-interface=@0@;'.format(exe_shell_ivi_ui.full_path())
endif
......@@ -45,11 +45,6 @@
* the compositor and serves as a test bed for implementing client
* side marshalling outside libwayland.so */
static struct wl_shm *shm;
static struct weston_screenshooter *screenshooter;
static struct wl_list output_list;
int min_x, min_y, max_x, max_y;
int buffer_copy_done;
struct screenshooter_output {
struct wl_output *output;
......@@ -59,6 +54,22 @@ struct screenshooter_output {
struct wl_list link;
};
struct buffer_size {
int width, height;
int min_x, min_y;
int max_x, max_y;
};
struct screenshooter_data {
struct wl_shm *shm;
struct wl_list output_list;
struct weston_screenshooter *screenshooter;
int buffer_copy_done;
};
static void
display_handle_geometry(void *data,
struct wl_output *wl_output,
......@@ -107,7 +118,8 @@ static const struct wl_output_listener output_listener = {
static void
screenshot_done(void *data, struct weston_screenshooter *screenshooter)
{
buffer_copy_done = 1;
struct screenshooter_data *sh_data = data;
sh_data->buffer_copy_done = 1;
}
static const struct weston_screenshooter_listener screenshooter_listener = {
......@@ -119,19 +131,20 @@ handle_global(void *data, struct wl_registry *registry,
uint32_t name, const char *interface, uint32_t version)
{
static struct screenshooter_output *output;
struct screenshooter_data *sh_data = data;
if (strcmp(interface, "wl_output") == 0) {
output = xmalloc(sizeof *output);
output->output = wl_registry_bind(registry, name,
&wl_output_interface, 1);
wl_list_insert(&output_list, &output->link);
wl_list_insert(&sh_data->output_list, &output->link);
wl_output_add_listener(output->output, &output_listener, output);
} else if (strcmp(interface, "wl_shm") == 0) {
shm = wl_registry_bind(registry, name, &wl_shm_interface, 1);
sh_data->shm = wl_registry_bind(registry, name, &wl_shm_interface, 1);
} else if (strcmp(interface, "weston_screenshooter") == 0) {
screenshooter = wl_registry_bind(registry, name,
&weston_screenshooter_interface,
1);
sh_data->screenshooter = wl_registry_bind(registry, name,
&weston_screenshooter_interface,
1);
}
}
......@@ -147,7 +160,8 @@ static const struct wl_registry_listener registry_listener = {
};
static struct wl_buffer *
create_shm_buffer(int width, int height, void **data_out)
screenshot_create_shm_buffer(int width, int height, void **data_out,
struct wl_shm *shm)
{
struct wl_shm_pool *pool;
struct wl_buffer *buffer;
......@@ -183,7 +197,8 @@ create_shm_buffer(int width, int height, void **data_out)
}
static void
write_png(int width, int height)
screenshot_write_png(const struct buffer_size *buff_size,
struct wl_list *output_list)
{
int output_stride, buffer_stride, i;
cairo_surface_t *surface;
......@@ -192,17 +207,17 @@ write_png(int width, int height)
FILE *fp;
char filepath[PATH_MAX];
buffer_stride = width * 4;
buffer_stride = buff_size->width * 4;
data = xmalloc(buffer_stride * height);
data = xmalloc(buffer_stride * buff_size->height);
if (!data)
return;
wl_list_for_each_safe(output, next, &output_list, link) {
wl_list_for_each_safe(output, next, output_list, link) {
output_stride = output->width * 4;
s = output->data;
d = data + (output->offset_y - min_y) * buffer_stride +
(output->offset_x - min_x) * 4;
d = data + (output->offset_y - buff_size->min_y) * buffer_stride +
(output->offset_x - buff_size->min_x) * 4;
for (i = 0; i < output->height; i++) {
memcpy(d, s, output_stride);
......@@ -215,7 +230,9 @@ write_png(int width, int height)
surface = cairo_image_surface_create_for_data(data,
CAIRO_FORMAT_ARGB32,
width, height, buffer_stride);
buff_size->width,
buff_size->height,
buffer_stride);
fp = file_create_dated(getenv("XDG_PICTURES_DIR"), "wayland-screenshot-",
".png", filepath, sizeof(filepath));
......@@ -228,30 +245,33 @@ write_png(int width, int height)
}
static int
set_buffer_size(int *width, int *height)
screenshot_set_buffer_size(struct buffer_size *buff_size, struct wl_list *output_list)
{
struct screenshooter_output *output;
min_x = min_y = INT_MAX;
max_x = max_y = INT_MIN;
buff_size->min_x = buff_size->min_y = INT_MAX;
buff_size->max_x = buff_size->max_y = INT_MIN;
int position = 0;
wl_list_for_each_reverse(output, &output_list, link) {
wl_list_for_each_reverse(output, output_list, link) {
output->offset_x = position;
position += output->width;
}
wl_list_for_each(output, &output_list, link) {
min_x = MIN(min_x, output->offset_x);
min_y = MIN(min_y, output->offset_y);
max_x = MAX(max_x, output->offset_x + output->width);
max_y = MAX(max_y, output->offset_y + output->height);
wl_list_for_each(output, output_list, link) {
buff_size->min_x = MIN(buff_size->min_x, output->offset_x);
buff_size->min_y = MIN(buff_size->min_y, output->offset_y);
buff_size->max_x =
MAX(buff_size->max_x, output->offset_x + output->width);
buff_size->max_y =
MAX(buff_size->max_y, output->offset_y + output->height);
}
if (max_x <= min_x || max_y <= min_y)
if (buff_size->max_x <= buff_size->min_x ||
buff_size->max_y <= buff_size->min_y)
return -1;
*width = max_x - min_x;
*height = max_y - min_y;
buff_size->width = buff_size->max_x - buff_size->min_x;
buff_size->height = buff_size->max_y - buff_size->min_y;
return 0;
}
......@@ -261,14 +281,8 @@ int main(int argc, char *argv[])
struct wl_display *display;
struct wl_registry *registry;
struct screenshooter_output *output;
int width, height;
if (getenv("WAYLAND_SOCKET") == NULL) {
fprintf(stderr, "%s must be launched by weston.\n"
"Use the MOD+S shortcut to take a screenshot.\n",
program_invocation_short_name);
return -1;
}
struct buffer_size buff_size = {};
struct screenshooter_data sh_data = {};
display = wl_display_connect(NULL);
if (display == NULL) {
......@@ -276,35 +290,39 @@ int main(int argc, char *argv[])
return -1;
}
wl_list_init(&output_list);
wl_list_init(&sh_data.output_list);
registry = wl_display_get_registry(display);
wl_registry_add_listener(registry, &registry_listener, NULL);
wl_registry_add_listener(registry, &registry_listener, &sh_data);
wl_display_dispatch(display);
wl_display_roundtrip(display);
if (screenshooter == NULL) {
if (sh_data.screenshooter == NULL) {
fprintf(stderr, "display doesn't support screenshooter\n");
return -1;
}
weston_screenshooter_add_listener(screenshooter,
weston_screenshooter_add_listener(sh_data.screenshooter,
&screenshooter_listener,
screenshooter);
&sh_data);
if (set_buffer_size(&width, &height))
if (screenshot_set_buffer_size(&buff_size, &sh_data.output_list))
return -1;
wl_list_for_each(output, &output_list, link) {
output->buffer = create_shm_buffer(output->width, output->height, &output->data);
weston_screenshooter_shoot(screenshooter,
wl_list_for_each(output, &sh_data.output_list, link) {
output->buffer =
screenshot_create_shm_buffer(output->width,
output->height,
&output->data,
sh_data.shm);
weston_screenshooter_shoot(sh_data.screenshooter,
output->output,
output->buffer);
buffer_copy_done = 0;
while (!buffer_copy_done)
sh_data.buffer_copy_done = 0;
while (!sh_data.buffer_copy_done)
wl_display_roundtrip(display);
}
write_png(width, height);
screenshot_write_png(&buff_size, &sh_data.output_list);
return 0;
}
This diff is collapsed.
......@@ -45,12 +45,10 @@
#include "xdg-shell-unstable-v6-client-protocol.h"
#include <sys/types.h>
#include <unistd.h>
#include "ivi-application-client-protocol.h"
#define IVI_SURFACE_ID 9000
#include "shared/helpers.h"
#include "shared/platform.h"
#include "weston-egl-ext.h"
#include "shared/weston-egl-ext.h"
struct window;
struct seat;
......@@ -74,7 +72,6 @@ struct display {
EGLConfig conf;
} egl;
struct window *window;
struct ivi_application *ivi_application;
PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC swap_buffers_with_damage;
};
......@@ -97,7 +94,6 @@ struct window {
struct wl_surface *surface;
struct zxdg_surface_v6 *xdg_surface;
struct zxdg_toplevel_v6 *xdg_toplevel;
struct ivi_surface *ivi_surface;
EGLSurface egl_surface;
struct wl_callback *callback;
int fullscreen, maximized, opaque, buffer_size, frame_sync, delay;
......@@ -359,27 +355,22 @@ static const struct zxdg_toplevel_v6_listener xdg_toplevel_listener = {
};
static void
handle_ivi_surface_configure(void *data, struct ivi_surface *ivi_surface,
int32_t width, int32_t height)
create_surface(struct window *window)
{
struct window *window = data;
wl_egl_window_resize(window->native, width, height, 0, 0);
window->geometry.width = width;
window->geometry.height = height;
struct display *display = window->display;
EGLBoolean ret;
if (!window->fullscreen)
window->window_size = window->geometry;
}
window->surface = wl_compositor_create_surface(display->compositor);
static const struct ivi_surface_listener ivi_surface_listener = {
handle_ivi_surface_configure,
};
window->native =
wl_egl_window_create(window->surface,
window->geometry.width,
window->geometry.height);
window->egl_surface =
weston_platform_create_egl_surface(display->egl.dpy,
display->egl.conf,
window->native, NULL);
static void
create_xdg_surface(struct window *window, struct display *display)
{
window->xdg_surface = zxdg_shell_v6_get_xdg_surface(display->shell,
window->surface);
zxdg_surface_v6_add_listener(window->xdg_surface,
......@@ -394,50 +385,6 @@ create_xdg_surface(struct window *window, struct display *display)
window->wait_for_configure = true;
wl_surface_commit(window->surface);
}
static void
create_ivi_surface(struct window *window, struct display *display)
{
uint32_t id_ivisurf = IVI_SURFACE_ID + (uint32_t)getpid();
window->ivi_surface =
ivi_application_surface_create(display->ivi_application,
id_ivisurf, window->surface);
if (window->ivi_surface == NULL) {
fprintf(stderr, "Failed to create ivi_client_surface\n");
abort();
}
ivi_surface_add_listener(window->ivi_surface,
&ivi_surface_listener, window);
}
static void
create_surface(struct window *window)
{
struct display *display = window->display;
EGLBoolean ret;
window->surface = wl_compositor_create_surface(display->compositor);
window->native =
wl_egl_window_create(window->surface,
window->geometry.width,
window->geometry.height);
window->egl_surface =
weston_platform_create_egl_surface(display->egl.dpy,
display->egl.conf,
window->native, NULL);
if (display->shell) {
create_xdg_surface(window, display);
} else if (display->ivi_application ) {
create_ivi_surface(window, display);
} else {
assert(0);
}
ret = eglMakeCurrent(window->display->egl.dpy, window->egl_surface,
window->egl_surface, window->display->egl.ctx);
......@@ -469,8 +416,6 @@ destroy_surface(struct window *window)
zxdg_toplevel_v6_destroy(window->xdg_toplevel);
if (window->xdg_surface)
zxdg_surface_v6_destroy(window->xdg_surface);
if (window->display->ivi_application)
ivi_surface_destroy(window->ivi_surface);
wl_surface_destroy(window->surface);
if (window->callback)
......@@ -825,10 +770,6 @@ registry_handle_global(void *data, struct wl_registry *registry,
fprintf(stderr, "unable to load default left pointer\n");
// TODO: abort ?
}
} else if (strcmp(interface, "ivi_application") == 0) {
d->ivi_application =
wl_registry_bind(registry, name,
&ivi_application_interface, 1);
}
}
......@@ -943,9 +884,6 @@ main(int argc, char **argv)
if (display.shell)
zxdg_shell_v6_destroy(display.shell);
if (display.ivi_application)
ivi_application_destroy(display.ivi_application);
if (display.compositor)
wl_compositor_destroy(display.compositor);
......
......@@ -40,10 +40,6 @@
#include "xdg-shell-unstable-v6-client-protocol.h"
#include "fullscreen-shell-unstable-v1-client-protocol.h"
#include <sys/types.h>
#include "ivi-application-client-protocol.h"
#define IVI_SURFACE_ID 9000
struct display {
struct wl_display *display;
struct wl_registry *registry;
......@@ -52,7 +48,6 @@ struct display {
struct zwp_fullscreen_shell_v1 *fshell;
struct wl_shm *shm;
bool has_xrgb;
struct ivi_application *ivi_application;
};
struct buffer {
......@@ -67,7 +62,6 @@ struct window {
struct wl_surface *surface;
struct zxdg_surface_v6 *xdg_surface;
struct zxdg_toplevel_v6 *xdg_toplevel;
struct ivi_surface *ivi_surface;
struct buffer buffers[2];
struct buffer *prev_buffer;
struct wl_callback *callback;
......@@ -165,17 +159,6 @@ static const struct zxdg_toplevel_v6_listener xdg_toplevel_listener = {
handle_xdg_toplevel_close,
};
static void
handle_ivi_surface_configure(void *data, struct ivi_surface *ivi_surface,
int32_t width, int32_t height)
{
/* Simple-shm is resizable */
}
static const struct ivi_surface_listener ivi_surface_listener = {
handle_ivi_surface_configure,
};
static struct window *
create_window(struct display *display, int width, int height)
{
......@@ -213,19 +196,6 @@ create_window(struct display *display, int width, int height)
window->surface,
ZWP_FULLSCREEN_SHELL_V1_PRESENT_METHOD_DEFAULT,
NULL);
} else if (display->ivi_application ) {
uint32_t id_ivisurf = IVI_SURFACE_ID + (uint32_t)getpid();
window->ivi_surface =
ivi_application_surface_create(display->ivi_application,
id_ivisurf, window->surface);
if (window->ivi_surface == NULL) {
fprintf(stderr, "Failed to create ivi_client_surface\n");
abort();
}
ivi_surface_add_listener(window->ivi_surface,
&ivi_surface_listener, window);
} else {
assert(0);
}
......@@ -407,11 +377,6 @@ registry_handle_global(void *data, struct wl_registry *registry,
id, &wl_shm_interface, 1);
wl_shm_add_listener(d->shm, &shm_listener, d);
}
else if (strcmp(interface, "ivi_application") == 0) {
d->ivi_application =
wl_registry_bind(registry, id,
&ivi_application_interface, 1);
}
}
static void
......@@ -555,11 +520,6 @@ main(int argc, char **argv)
fprintf(stderr, "simple-shm exiting\n");
if (window->display->ivi_application) {
ivi_surface_destroy(window->ivi_surface);
ivi_application_destroy(window->display->ivi_application);
}
destroy_window(window);
destroy_display(display);
......
......@@ -2610,7 +2610,7 @@ recompute_selection(struct terminal *terminal)
int side_margin, top_margin;
int start_x, end_x;
int cw, ch;
union utf8_char *data;
union utf8_char *data = NULL;
cw = terminal->average_width;
ch = terminal->extents.height;
......
......@@ -594,10 +594,10 @@ print_tablet_tool_info(const struct tablet_tool_info *info)
{
printf("\t\ttablet_tool: %s\n", tablet_tool_type_to_str(info->type));
if (info->hardware_serial) {
printf("\t\t\thardware serial: %lx\n", info->hardware_serial);
printf("\t\t\thardware serial: %" PRIx64 "\n", info->hardware_serial);
}
if (info->hardware_id_wacom) {
printf("\t\t\thardware wacom: %lx\n", info->hardware_id_wacom);
printf("\t\t\thardware wacom: %" PRIx64 "\n", info->hardware_id_wacom);
}
printf("\t\t\tcapabilities:");
......
......@@ -79,16 +79,15 @@ typedef void *EGLContext;
#include "pointer-constraints-unstable-v1-client-protocol.h"
#include "relative-pointer-unstable-v1-client-protocol.h"
#include "shared/os-compatibility.h"
#include "shared/string-helpers.h"
#include "window.h"
#include <sys/types.h>
#include "ivi-application-client-protocol.h"
#define IVI_SURFACE_ID 9000
#define ZWP_RELATIVE_POINTER_MANAGER_V1_VERSION 1
#define ZWP_POINTER_CONSTRAINTS_V1_VERSION 1
#define DEFAULT_XCURSOR_SIZE 32
struct shm_pool;
struct global {
......@@ -107,7 +106,6 @@ struct display {
struct wl_data_device_manager *data_device_manager;
struct text_cursor_position *text_cursor_position;
struct zxdg_shell_v6 *xdg_shell;
struct ivi_application *ivi_application; /* ivi style shell */
struct zwp_relative_pointer_manager_v1 *relative_pointer_manager;
struct zwp_pointer_constraints_v1 *pointer_constraints;
EGLDisplay dpy;
......@@ -269,8 +267,6 @@ struct window {
struct window *parent;
struct window *last_parent;
struct ivi_surface *ivi_surface;
struct window_frame *frame;
/* struct surface::link, contains also main_surface */
......@@ -278,7 +274,6 @@ struct window {
struct zwp_relative_pointer_v1 *relative_pointer;
struct zwp_locked_pointer_v1 *locked_pointer;
struct input *locked_input;
bool pointer_locked;
locked_pointer_locked_handler_t pointer_locked_handler;
locked_pointer_unlocked_handler_t pointer_unlocked_handler;
......@@ -286,7 +281,6 @@ struct window {
confined_pointer_unconfined_handler_t pointer_unconfined_handler;
struct zwp_confined_pointer_v1 *confined_pointer;
struct input *confined_input;
struct widget *confined_widget;
bool confined;
......@@ -345,6 +339,8 @@ struct input {
struct window *pointer_focus;
struct window *keyboard_focus;
struct window *touch_focus;
struct window *locked_window;
struct window *confined_window;
int current_cursor;
uint32_t cursor_anim_start;
struct wl_callback *cursor_frame_cb;
......@@ -1340,14 +1336,19 @@ create_cursors(struct display *display)
const char *config_file;
struct weston_config *config;
struct weston_config_section *s;
int size = 32;
char *theme = NULL;
int size = DEFAULT_XCURSOR_SIZE;
char *theme = NULL, *size_str;
unsigned int i, j;
struct wl_cursor *cursor;
theme = getenv("XCURSOR_THEME");
if (getenv("XCURSOR_SIZE"))
size = atoi(getenv("XCURSOR_SIZE"));
size_str = getenv("XCURSOR_SIZE");
if (size_str) {
safe_strtoint(size_str, &size);
if (size <= 0)
size = DEFAULT_XCURSOR_SIZE;
}
config_file = weston_config_get_name_from_env();
config = weston_config_parse(config_file);
......@@ -1443,19 +1444,6 @@ window_get_display(struct window *window)
return window->display;
}
static void
handle_ivi_surface_configure(void *data, struct ivi_surface *ivi_surface,
int32_t width, int32_t height)
{
struct window *window = data;
window_schedule_resize(window, width, height);
}
static const struct ivi_surface_listener ivi_surface_listener = {
handle_ivi_surface_configure,
};
static void
surface_create_surface(struct surface *surface, uint32_t flags)
{
......@@ -1586,6 +1574,10 @@ window_destroy(struct window *window)
input->pointer_focus = NULL;
if (input->keyboard_focus == window)
input->keyboard_focus = NULL;
if (input->locked_window == window)
input->locked_window = NULL;
if (input->confined_window == window)
input->confined_window = NULL;
if (input->focus_widget &&
input->focus_widget->window == window)
input->focus_widget = NULL;
......@@ -1606,9 +1598,6 @@ window_destroy(struct window *window)
if (window->xdg_surface)
zxdg_surface_v6_destroy(window->xdg_surface);
if (window->ivi_surface)
ivi_surface_destroy(window->ivi_surface);
surface_destroy(window->main_surface);
wl_list_remove(&window->link);
......@@ -4793,8 +4782,11 @@ static void
locked_pointer_locked(void *data,
struct zwp_locked_pointer_v1 *locked_pointer)
{
struct window *window = data;
struct input *input = window->locked_input;
struct input *input = data;
struct window *window = input->locked_window;
if (!window)
return;
window->pointer_locked = true;
......@@ -4809,11 +4801,16 @@ static void
locked_pointer_unlocked(void *data,
struct zwp_locked_pointer_v1 *locked_pointer)
{
struct window *window = data;
struct input *input = window->locked_input;
struct input *input = data;
struct window *window = input->locked_window;
if (!window)
return;
window_unlock_pointer(window);
input->locked_window = NULL;
if (window->pointer_unlocked_handler) {
window->pointer_unlocked_handler(window,
input,
......@@ -4865,11 +4862,11 @@ window_lock_pointer(struct window *window, struct input *input)
ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ONESHOT);
zwp_locked_pointer_v1_add_listener(locked_pointer,
&locked_pointer_listener,
window);
input);
window->locked_input = input;
window->locked_pointer = locked_pointer;
window->relative_pointer = relative_pointer;
input->locked_window = window;
return 0;
}
......@@ -4885,7 +4882,6 @@ window_unlock_pointer(struct window *window)
window->locked_pointer = NULL;
window->relative_pointer = NULL;
window->pointer_locked = false;
window->locked_input = NULL;
}
void
......@@ -4907,8 +4903,11 @@ static void
confined_pointer_confined(void *data,
struct zwp_confined_pointer_v1 *confined_pointer)
{
struct window *window = data;
struct input *input = window->confined_input;
struct input *input = data;
struct window *window = input->confined_window;
if (!window)
return;
window->confined = true;
......@@ -4923,12 +4922,16 @@ static void
confined_pointer_unconfined(void *data,
struct zwp_confined_pointer_v1 *confined_pointer)
{
struct window *window = data;
struct input *input = window->confined_input;
struct input *input = data;
struct window *window = input->confined_window;
if (!window)
return;
window_unconfine_pointer(window);
window->confined = false;
input->confined_window = NULL;
if (window->pointer_unconfined_handler) {
window->pointer_unconfined_handler(window,
......@@ -4989,11 +4992,11 @@ window_confine_pointer_to_rectangles(struct window *window,
zwp_confined_pointer_v1_add_listener(confined_pointer,
&confined_pointer_listener,
window);
input);
window->confined_input = input;
window->confined_pointer = confined_pointer;
window->confined_widget = NULL;
input->confined_window = window;
return 0;
}
......@@ -5052,7 +5055,6 @@ window_unconfine_pointer(struct window *window)
zwp_confined_pointer_v1_destroy(window->confined_pointer);
window->confined_pointer = NULL;
window->confined = false;
window->confined_input = NULL;
}
static void
......@@ -5156,7 +5158,7 @@ window_create_internal(struct display *display, int custom)
surface = surface_create(window);
window->main_surface = surface;
assert(custom || display->xdg_shell || display->ivi_application);
assert(custom || display->xdg_shell);
window->custom = custom;
window->preferred_format = WINDOW_PREFERRED_FORMAT_NONE;
......@@ -5176,7 +5178,6 @@ struct window *
window_create(struct display *display)
{
struct window *window;
uint32_t id_ivisurf;
window = window_create_internal(display, 0);
......@@ -5199,16 +5200,6 @@ window_create(struct display *display)
window_inhibit_redraw(window);
wl_surface_commit(window->main_surface->surface);
} else if (display->ivi_application) {
/* auto generation of ivi_id based on process id + basement of id */
id_ivisurf = IVI_SURFACE_ID + (uint32_t)getpid();
window->ivi_surface =
ivi_application_surface_create(display->ivi_application,
id_ivisurf, window->main_surface->surface);
fail_on_null(window->ivi_surface, 0, __FILE__, __LINE__);
ivi_surface_add_listener(window->ivi_surface,
&ivi_surface_listener, window);
}
return window;
......@@ -5963,11 +5954,6 @@ registry_handle_global(void *data, struct wl_registry *registry, uint32_t id,
wl_registry_bind(registry, id,
&wl_subcompositor_interface, 1);
}
else if (strcmp(interface, "ivi_application") == 0) {
d->ivi_application =
wl_registry_bind(registry, id,
&ivi_application_interface, 1);
}
if (d->global_handler)
d->global_handler(d, id, interface, version, d->user_data);
......@@ -6266,9 +6252,6 @@ display_destroy(struct display *display)
if (display->xdg_shell)
zxdg_shell_v6_destroy(display->xdg_shell);
if (display->ivi_application)
ivi_application_destroy(display->ivi_application);
if (display->shm)
wl_shm_destroy(display->shm);
......
......@@ -41,6 +41,8 @@
#include <sys/wait.h>
#include <sys/socket.h>
#include <libinput.h>
#include <libevdev/libevdev.h>
#include <linux/input-event-codes.h>
#include <sys/time.h>
#include <linux/limits.h>
......@@ -903,8 +905,8 @@ wet_load_shell(struct weston_compositor *compositor,
return 0;
}
WL_EXPORT char *
wet_get_binary_path(const char *name)
static char *
wet_get_binary_path(const char *name, const char *dir)
{
char path[PATH_MAX];
size_t len;
......@@ -913,13 +915,25 @@ wet_get_binary_path(const char *name)
if (len > 0)
return strdup(path);
len = snprintf(path, sizeof path, "%s/%s", LIBEXECDIR, name);
len = snprintf(path, sizeof path, "%s/%s", dir, name);
if (len >= sizeof path)
return NULL;
return strdup(path);
}
WL_EXPORT char *
wet_get_libexec_path(const char *name)
{
return wet_get_binary_path(name, LIBEXECDIR);
}
WL_EXPORT char *
wet_get_bindir_path(const char *name)
{
return wet_get_binary_path(name, BINDIR);
}
static int
load_modules(struct weston_compositor *ec, const char *modules,
int *argc, char *argv[], int32_t *xwayland)
......@@ -1446,28 +1460,206 @@ wet_set_simple_head_configurator(struct weston_compositor *compositor,
&wet->heads_changed_listener);
}
static void
configure_input_device_accel(struct weston_config_section *s,
struct libinput_device *device)
{
char *profile_string = NULL;
int is_a_profile = 1;
uint32_t profiles;
enum libinput_config_accel_profile profile;
double speed;
if (weston_config_section_get_string(s, "accel-profile",
&profile_string, NULL) == 0) {
if (strcmp(profile_string, "flat") == 0)
profile = LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT;
else if (strcmp(profile_string, "adaptive") == 0)
profile = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE;
else {
weston_log("warning: no such accel-profile: %s\n",
profile_string);
is_a_profile = 0;
}
profiles = libinput_device_config_accel_get_profiles(device);
if (is_a_profile && (profile & profiles) != 0) {
weston_log(" accel-profile=%s\n",
profile_string);
libinput_device_config_accel_set_profile(device,
profile);
}
}
if (weston_config_section_get_double(s, "accel-speed",
&speed, 0) == 0 &&
speed >= -1. && speed <= 1.) {
weston_log(" accel-speed=%.3f\n", speed);
libinput_device_config_accel_set_speed(device, speed);
}
free(profile_string);
}
static void
configure_input_device_scroll(struct weston_config_section *s,
struct libinput_device *device)
{
int natural;
char *method_string = NULL;
uint32_t methods;
enum libinput_config_scroll_method method;
char *button_string = NULL;
int button;
if (libinput_device_config_scroll_has_natural_scroll(device) &&
weston_config_section_get_bool(s, "natural-scroll",
&natural, 0) == 0) {
weston_log(" natural-scroll=%s\n",
natural ? "true" : "false");
libinput_device_config_scroll_set_natural_scroll_enabled(
device, natural);
}
if (weston_config_section_get_string(s, "scroll-method",
&method_string, NULL) != 0)
goto done;
if (strcmp(method_string, "two-finger") == 0)
method = LIBINPUT_CONFIG_SCROLL_2FG;
else if (strcmp(method_string, "edge") == 0)
method = LIBINPUT_CONFIG_SCROLL_EDGE;
else if (strcmp(method_string, "button") == 0)
method = LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN;
else if (strcmp(method_string, "none") == 0)
method = LIBINPUT_CONFIG_SCROLL_NO_SCROLL;
else {
weston_log("warning: no such scroll-method: %s\n",
method_string);
goto done;
}
methods = libinput_device_config_scroll_get_methods(device);
if (method != LIBINPUT_CONFIG_SCROLL_NO_SCROLL &&
(method & methods) == 0)
goto done;
weston_log(" scroll-method=%s\n", method_string);
libinput_device_config_scroll_set_method(device, method);
if (method == LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN) {
if (weston_config_section_get_string(s, "scroll-button",
&button_string,
NULL) != 0)
goto done;
button = libevdev_event_code_from_name(EV_KEY, button_string);
if (button == -1) {
weston_log(" Bad scroll-button: %s\n",
button_string);
goto done;
}
weston_log(" scroll-button=%s\n", button_string);
libinput_device_config_scroll_set_button(device, button);
}
done:
free(method_string);
free(button_string);
}
static void
configure_input_device(struct weston_compositor *compositor,
struct libinput_device *device)
{
struct weston_config_section *s;
struct weston_config *config = wet_get_config(compositor);
int has_enable_tap = 0;
int enable_tap;
int enable_tap_default;
int disable_while_typing;
int middle_emulation;
int tap_and_drag;
int tap_and_drag_lock;
int left_handed;
unsigned int rotation;
weston_log("libinput: configuring device \"%s\".\n",
libinput_device_get_name(device));
s = weston_config_get_section(config,
"libinput", NULL, NULL);
if (libinput_device_config_tap_get_finger_count(device) > 0) {
enable_tap_default =
libinput_device_config_tap_get_default_enabled(
device);
weston_config_section_get_bool(s, "enable_tap",
&enable_tap,
enable_tap_default);
libinput_device_config_tap_set_enabled(device,
enable_tap);
if (weston_config_section_get_bool(s, "enable_tap",
&enable_tap, 0) == 0) {
weston_log("!!DEPRECATION WARNING!!: In weston.ini, "
"enable_tap is deprecated in favour of "
"enable-tap. Support for it may be removed "
"at any time!");
has_enable_tap = 1;
}
if (weston_config_section_get_bool(s, "enable-tap",
&enable_tap, 0) == 0)
has_enable_tap = 1;
if (has_enable_tap) {
weston_log(" enable-tap=%s.\n",
enable_tap ? "true" : "false");
libinput_device_config_tap_set_enabled(device,
enable_tap);
}
if (weston_config_section_get_bool(s, "tap-and-drag",
&tap_and_drag, 0) == 0) {
weston_log(" tap-and-drag=%s.\n",
tap_and_drag ? "true" : "false");
libinput_device_config_tap_set_drag_enabled(device,
tap_and_drag);
}
if (weston_config_section_get_bool(s, "tap-and-drag-lock",
&tap_and_drag_lock, 0) == 0) {
weston_log(" tap-and-drag-lock=%s.\n",
tap_and_drag_lock ? "true" : "false");
libinput_device_config_tap_set_drag_lock_enabled(
device, tap_and_drag_lock);
}
}
if (libinput_device_config_dwt_is_available(device) &&
weston_config_section_get_bool(s, "disable-while-typing",
&disable_while_typing, 0) == 0) {
weston_log(" disable-while-typing=%s.\n",
disable_while_typing ? "true" : "false");
libinput_device_config_dwt_set_enabled(device,
disable_while_typing);
}
if (libinput_device_config_middle_emulation_is_available(device) &&
weston_config_section_get_bool(s, "middle-button-emulation",
&middle_emulation, 0) == 0) {
weston_log(" middle-button-emulation=%s\n",
middle_emulation ? "true" : "false");
libinput_device_config_middle_emulation_set_enabled(
device, middle_emulation);
}
if (libinput_device_config_left_handed_is_available(device) &&
weston_config_section_get_bool(s, "left-handed",
&left_handed, 0) == 0) {
weston_log(" left-handed=%s\n",
left_handed ? "true" : "false");
libinput_device_config_left_handed_set(device, left_handed);
}
if (libinput_device_config_rotation_is_available(device) &&
weston_config_section_get_uint(s, "rotation",
&rotation, 0) == 0) {
weston_log(" rotation=%u\n", rotation);
libinput_device_config_rotation_set_angle(device, rotation);
}
if (libinput_device_config_accel_is_available(device))
configure_input_device_accel(s, device);
configure_input_device_scroll(s, device);
}
static int
......@@ -2131,18 +2323,26 @@ load_drm_backend(struct weston_compositor *c,
struct wet_compositor *wet = to_wet_compositor(c);
int use_shadow;
int ret = 0;
int use_pixman_config_ = 0;
int32_t use_pixman_ = 0;
wet->drm_use_current_mode = false;
section = weston_config_get_section(wc, "core", NULL, NULL);
weston_config_section_get_bool(section, "use-pixman", &use_pixman_config_,
use_pixman_config_);
use_pixman_ = use_pixman_config_;
const struct weston_option options[] = {
{ WESTON_OPTION_STRING, "seat", 0, &config.seat_id },
{ WESTON_OPTION_INTEGER, "tty", 0, &config.tty },
{ WESTON_OPTION_STRING, "drm-device", 0, &config.specific_device },
{ WESTON_OPTION_BOOLEAN, "current-mode", 0, &wet->drm_use_current_mode },
{ WESTON_OPTION_BOOLEAN, "use-pixman", 0, &config.use_pixman },
{ WESTON_OPTION_BOOLEAN, "use-pixman", 0, &use_pixman_ },
};
parse_options(options, ARRAY_LENGTH(options), argc, argv);
config.use_pixman = use_pixman_;
section = weston_config_get_section(wc, "core", NULL, NULL);
weston_config_section_get_string(section,
......@@ -2192,23 +2392,32 @@ load_headless_backend(struct weston_compositor *c,
{
const struct weston_windowed_output_api *api;
struct weston_headless_backend_config config = {{ 0, }};
struct weston_config_section *section;
int no_outputs = 0;
int ret = 0;
char *transform = NULL;
int32_t use_pixman_config_ = 0;
int use_pixman_ = 0;
struct wet_output_config *parsed_options = wet_init_parsed_options(c);
if (!parsed_options)
return -1;
section = weston_config_get_section(wc, "core", NULL, NULL);
weston_config_section_get_bool(section, "use-pixman", &use_pixman_config_,
use_pixman_config_);
use_pixman_ = use_pixman_config_;
const struct weston_option options[] = {
{ WESTON_OPTION_INTEGER, "width", 0, &parsed_options->width },
{ WESTON_OPTION_INTEGER, "height", 0, &parsed_options->height },
{ WESTON_OPTION_BOOLEAN, "use-pixman", 0, &config.use_pixman },
{ WESTON_OPTION_BOOLEAN, "use-pixman", 0, &use_pixman_ },
{ WESTON_OPTION_STRING, "transform", 0, &transform },
{ WESTON_OPTION_BOOLEAN, "no-outputs", 0, &no_outputs },
};
parse_options(options, ARRAY_LENGTH(options), argc, argv);
config.use_pixman = use_pixman_;
if (transform) {
if (weston_parse_transform(transform, &parsed_options->transform) < 0) {
......@@ -2403,11 +2612,18 @@ load_x11_backend(struct weston_compositor *c,
int output_count = 0;
char const *section_name;
int i;
int32_t use_pixman_config_ = 0;
int use_pixman_ = 0;
struct wet_output_config *parsed_options = wet_init_parsed_options(c);
if (!parsed_options)
return -1;
section = weston_config_get_section(wc, "core", NULL, NULL);
weston_config_section_get_bool(section, "use-pixman", &use_pixman_config_,
use_pixman_config_);
use_pixman_ = use_pixman_config_;
const struct weston_option options[] = {
{ WESTON_OPTION_INTEGER, "width", 0, &parsed_options->width },
{ WESTON_OPTION_INTEGER, "height", 0, &parsed_options->height },
......@@ -2415,10 +2631,11 @@ load_x11_backend(struct weston_compositor *c,
{ WESTON_OPTION_BOOLEAN, "fullscreen", 'f', &config.fullscreen },
{ WESTON_OPTION_INTEGER, "output-count", 0, &option_count },
{ WESTON_OPTION_BOOLEAN, "no-input", 0, &config.no_input },
{ WESTON_OPTION_BOOLEAN, "use-pixman", 0, &config.use_pixman },
{ WESTON_OPTION_BOOLEAN, "use-pixman", 0, &use_pixman_ },
};
parse_options(options, ARRAY_LENGTH(options), argc, argv);
config.use_pixman = use_pixman_;
config.base.struct_version = WESTON_X11_BACKEND_CONFIG_VERSION;
config.base.struct_size = sizeof(struct weston_x11_backend_config);
......@@ -2510,6 +2727,7 @@ load_wayland_backend(struct weston_compositor *c,
int32_t use_pixman_ = 0;
int32_t sprawl_ = 0;
int32_t fullscreen_ = 0;
int use_pixman_config_ = 0;
struct wet_output_config *parsed_options = wet_init_parsed_options(c);
if (!parsed_options)
......@@ -2519,6 +2737,11 @@ load_wayland_backend(struct weston_compositor *c,
config.cursor_theme = NULL;
config.display_name = NULL;
section = weston_config_get_section(wc, "core", NULL, NULL);
weston_config_section_get_bool(section, "use-pixman", &use_pixman_config_,
use_pixman_config_);
use_pixman_ = use_pixman_config_;
const struct weston_option wayland_options[] = {
{ WESTON_OPTION_INTEGER, "width", 0, &parsed_options->width },
{ WESTON_OPTION_INTEGER, "height", 0, &parsed_options->height },
......@@ -2532,8 +2755,8 @@ load_wayland_backend(struct weston_compositor *c,
parse_options(wayland_options, ARRAY_LENGTH(wayland_options), argc, argv);
config.sprawl = sprawl_;
config.use_pixman = use_pixman_;
config.fullscreen = fullscreen_;
config.use_pixman = use_pixman_config_;
section = weston_config_get_section(wc, "shell", NULL, NULL);
weston_config_section_get_string(section, "cursor-theme",
......
srcs_weston = [
git_version_h,
'main.c',
'text-backend.c',
'weston-screenshooter.c',
text_input_unstable_v1_server_protocol_h,
text_input_unstable_v1_protocol_c,
input_method_unstable_v1_server_protocol_h,
input_method_unstable_v1_protocol_c,
weston_screenshooter_server_protocol_h,
weston_screenshooter_protocol_c,
]
deps_weston = [
dep_libshared,
dep_libweston,
dep_libinput,
dep_libevdev,
dep_libdl,
dep_threads,
]
if get_option('xwayland')
srcs_weston += 'xwayland.c'
config_h.set_quoted('XSERVER_PATH', get_option('xwayland-path'))
endif
exe_weston = executable(
'weston',
srcs_weston,
include_directories: include_directories('..', '../shared'),
link_args: [ '-Wl,-export-dynamic' ],
dependencies: deps_weston,
install: true
)
install_headers('weston.h', subdir: 'weston')
pkgconfig.generate(
filebase: 'weston',
name: 'Weston Plugin API',
version: version_weston,
description: 'Header files for Weston plugin development',
requires_private: [ lib_weston ],
variables: [
'libexecdir=' + join_paths('${prefix}', get_option('libexecdir')),
'pkglibexecdir=${libexecdir}/weston'
],
subdirs: 'weston'
)
install_data(
'weston.desktop',
install_dir: join_paths(dir_data, 'wayland-sessions')
)
if get_option('screenshare')
srcs_screenshare = [
'screen-share.c',
fullscreen_shell_unstable_v1_client_protocol_h,
fullscreen_shell_unstable_v1_protocol_c,
]
deps_screenshare = [
dep_libweston,
dep_wayland_client,
]
plugin_screenshare = shared_library(
'screen-share',
srcs_screenshare,
include_directories: include_directories('..', '../shared'),
dependencies: deps_screenshare,
name_prefix: '',
install: true,
install_dir: dir_module_weston
)
env_modmap += 'screen-share.so=@0@;'.format(plugin_screenshare.full_path())
endif
if get_option('color-management-lcms')
config_h.set('HAVE_LCMS', '1')
srcs_lcms = [
'cms-static.c',
'cms-helper.c',
]
dep_lcms2 = dependency('lcms2', required: false)
if not dep_lcms2.found()
error('cms-static requires lcms2 which was not found. Or, you can use \'-Dcolor-management-lcms=false\'.')
endif
plugin_lcms = shared_library(
'cms-static',
srcs_lcms,
include_directories: include_directories('..', '../shared'),
dependencies: [ dep_libweston, dep_lcms2 ],
name_prefix: '',
install: true,
install_dir: dir_module_weston
)
env_modmap += 'cms-static.so=@0@;'.format(plugin_lcms.full_path())
endif
if get_option('color-management-colord')
if not get_option('color-management-lcms')
error('LCMS must be enabled to support colord')
endif
srcs_colord = [
'cms-colord.c',
'cms-helper.c',
]
dep_colord = dependency('colord', version: '>= 0.1.27', required: false)
if not dep_colord.found()
error('cms-colord requires colord >= 0.1.27 which was not found. Or, you can use \'-Dcolor-management-colord=false\'.')
endif
plugin_colord = shared_library(
'cms-colord',
srcs_colord,
include_directories: include_directories('..', '../shared'),
dependencies: [ dep_libweston, dep_colord ],
name_prefix: '',
install: true,
install_dir: dir_module_weston
)
env_modmap += 'cms-colord.so=@0@;'.format(plugin_colord.full_path())
endif
if get_option('systemd')
dep_libsystemd = dependency('libsystemd', required: false)
if not dep_libsystemd.found()
error('systemd-notify requires libsystemd which was not found. Or, you can use \'-Dsystemd=false\'.')
endif
plugin_systemd_notify = shared_library(
'systemd-notify',
'systemd-notify.c',
include_directories: include_directories('..', '../shared'),
dependencies: [ dep_libweston, dep_libsystemd ],
name_prefix: '',
install: true,
install_dir: dir_module_weston
)
env_modmap += 'systemd-notify.so=@0@;'.format(plugin_systemd_notify.full_path())
endif
weston_ini_config = configuration_data()
weston_ini_config.set('bindir', dir_bin)
weston_ini_config.set('libexecdir', dir_libexec)
weston_ini_config.set('abs_top_srcdir', meson.source_root())
weston_ini_config.set('abs_top_builddir', meson.build_root())
configure_file(
input: '../weston.ini.in',
output: 'weston.ini',
configuration: weston_ini_config
)
......@@ -1049,7 +1049,7 @@ text_backend_configuration(struct text_backend *text_backend)
section = weston_config_get_section(config,
"input-method", NULL, NULL);
client = wet_get_binary_path("weston-keyboard");
client = wet_get_libexec_path("weston-keyboard");
weston_config_section_get_string(section, "path",
&text_backend->input_method.path,
client);
......
......@@ -32,6 +32,7 @@
#include "weston.h"
#include "weston-screenshooter-server-protocol.h"
#include "shared/helpers.h"
#include "weston-debug.h"
struct screenshooter {
struct weston_compositor *ec;
......@@ -88,13 +89,20 @@ bind_shooter(struct wl_client *client,
{
struct screenshooter *shooter = data;
struct wl_resource *resource;
bool debug_enabled =
weston_compositor_is_debug_protocol_enabled(shooter->ec);
resource = wl_resource_create(client,
&weston_screenshooter_interface, 1, id);
if (client != shooter->client) {
if (!debug_enabled && !shooter->client) {
wl_resource_post_error(resource, WL_DISPLAY_ERROR_INVALID_OBJECT,
"screenshooter failed: permission denied");
"screenshooter failed: permission denied. "\
"Debug protocol must be enabled");
return;
} else if (!debug_enabled && client != shooter->client) {
wl_resource_post_error(resource, WL_DISPLAY_ERROR_INVALID_OBJECT,
"screenshooter failed: permission denied.");
return;
}
......@@ -119,7 +127,7 @@ screenshooter_binding(struct weston_keyboard *keyboard,
char *screenshooter_exe;
screenshooter_exe = wet_get_binary_path("weston-screenshooter");
screenshooter_exe = wet_get_bindir_path("weston-screenshooter");
if (!screenshooter_exe) {
weston_log("Could not construct screenshooter path.\n");
return;
......
......@@ -78,7 +78,10 @@ module_init(struct weston_compositor *compositor,
int *argc, char *argv[]);
char *
wet_get_binary_path(const char *name);
wet_get_libexec_path(const char *name);
char *
wet_get_bindir_path(const char *name);
int
wet_load_xwayland(struct weston_compositor *comp);
......
......@@ -84,6 +84,21 @@ AC_PROG_SED
LT_PREREQ([2.2])
LT_INIT([disable-static])
AC_ARG_ENABLE(autotools,
AS_HELP_STRING([--enable-autotools],
[Allow building with autotools]),,
enable_autotools=no)
if test "x$enable_autotools" = "xno"; then
AC_ERROR([
*** Autotools support will be removed after the 6.0.0 release ***
Please, try the Meson based build and report any problems you might have
with it. Instructions and references can be found in README.md.
If you still want to continue building with autotools,
use --enable-autotools configure option.
])
fi
AC_ARG_VAR([WESTON_NATIVE_BACKEND],
[Set the native backend to use, if Weston is not running under Wayland nor X11. @<:@default=drm-backend.so@:>@])
AC_ARG_VAR([WESTON_SHELL_CLIENT],
......@@ -110,7 +125,6 @@ AC_CHECK_DECL(TFD_CLOEXEC,[],
AC_CHECK_DECL(CLOCK_MONOTONIC,[],
[AC_MSG_ERROR("CLOCK_MONOTONIC is needed to compile weston")],
[[#include <time.h>]])
AC_CHECK_HEADERS([execinfo.h])
AC_CHECK_FUNCS([mkostemp strchrnul initgroups posix_fallocate])
......@@ -149,7 +163,6 @@ AM_CONDITIONAL(ENABLE_EGL, test x$enable_egl = xyes)
if test x$enable_egl = xyes; then
AC_DEFINE([ENABLE_EGL], [1], [Build Weston with EGL support])
PKG_CHECK_MODULES(EGL, [egl glesv2])
PKG_CHECK_MODULES([EGL_TESTS], [egl glesv2 wayland-client wayland-egl])
AC_CHECK_HEADERS([linux/sync_file.h])
fi
......@@ -237,10 +250,14 @@ if test x$enable_remoting = xyes; then
fi
PKG_CHECK_MODULES(LIBEVDEV, [libevdev])
PKG_CHECK_MODULES(LIBINPUT_BACKEND, [libinput >= 0.8.0])
PKG_CHECK_MODULES(COMPOSITOR, [$COMPOSITOR_MODULES])
PKG_CHECK_MODULES(WAYLAND_PROTOCOLS, [wayland-protocols >= 1.14],
# XXX: For minor version 2 of zwp_linux_explicit_synchronization_v1, we
# actually need a development version after 1.17, but there is no way to
# express such a requirement at the moment.
PKG_CHECK_MODULES(WAYLAND_PROTOCOLS, [wayland-protocols >= 1.17],
[ac_wayland_protocols_pkgdatadir=`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`])
AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, $ac_wayland_protocols_pkgdatadir)
......@@ -452,6 +469,21 @@ if ! test "x$enable_simple_dmabuf_v4l_client" = "xno"; then
fi
AM_CONDITIONAL(BUILD_SIMPLE_DMABUF_V4L_CLIENT, test "x$enable_simple_dmabuf_v4l_client" = "xyes")
AC_ARG_ENABLE(simple-dmabuf-egl-client,
AS_HELP_STRING([--disable-simple-dmabuf-egl-client],
[do not build the simple dmabuf egl client]),,
enable_simple_dmabuf_egl_client="auto")
if ! test "x$enable_simple_dmabuf_egl_client" = "xno"; then
PKG_CHECK_MODULES(SIMPLE_DMABUF_EGL_CLIENT, [wayland-client libdrm gbm egl glesv2],
[have_simple_dmabuf_egl_client=yes], [have_simple_dmabuf_egl_client=no])
if test "x$have_simple_dmabuf_egl_client" = "xno" -a "x$enable_simple_dmabuf_egl_client" = "xyes"; then
AC_MSG_ERROR([EGL dmabuf client explicitly enabled, but libdrm/egl/glev2 couldn't be found])
fi
enable_simple_dmabuf_egl_client="$have_simple_dmabuf_egl_client"
fi
AM_CONDITIONAL(BUILD_SIMPLE_DMABUF_EGL_CLIENT, test "x$enable_simple_dmabuf_egl_client" = "xyes")
AC_ARG_ENABLE(clients, [ --enable-clients],, enable_clients=yes)
AM_CONDITIONAL(BUILD_CLIENTS, test x$enable_clients = xyes)
have_cairo_egl=no
......
install_data(
[
'background.png',
'border.png',
'fullscreen.png',
'home.png',
'icon_editor.png',
'icon_flower.png',
'icon_ivi_clickdot.png',
'icon_ivi_flower.png',
'icon_ivi_simple-egl.png',
'icon_ivi_simple-shm.png',
'icon_ivi_smoke.png',
'icon_terminal.png',
'icon_window.png',
'panel.png',
'pattern.png',
'random.png',
'sidebyside.png',
'sign_close.png',
'sign_maximize.png',
'sign_minimize.png',
'terminal.png',
'tiling.png',
'wayland.png',
'wayland.svg',
],
install_dir: join_paths(dir_data, 'weston')
)
if get_option('shell-desktop')
config_h.set_quoted('WESTON_SHELL_CLIENT', get_option('desktop-shell-client-default'))
srcs_shell_desktop = [
'shell.c',
'exposay.c',
'input-panel.c',
'../shared/matrix.c',
weston_desktop_shell_server_protocol_h,
weston_desktop_shell_protocol_c,
input_method_unstable_v1_server_protocol_h,
input_method_unstable_v1_protocol_c,
]
deps_shell_desktop = [
dep_libshared,
dep_lib_desktop,
dep_libweston,
]
plugin_shell_desktop = shared_library(
'desktop-shell',
srcs_shell_desktop,
include_directories: include_directories('..', '../shared'),
dependencies: deps_shell_desktop,
name_prefix: '',
install: true,
install_dir: dir_module_weston
)
env_modmap += 'desktop-shell.so=@0@;'.format(plugin_shell_desktop.full_path())
endif