Commit graph

1467 commits

Author SHA1 Message Date
Drew DeVault a1eeaf48c6 simple-dmabuf-egl: update to xdg-shell stable 2019-11-12 11:35:56 -05:00
Sebastian Wick ac1b92dfea clients/window: bump wl_seat version to 7
Since version 7 clients must use MAP_PRIVATE to map the keymap fd.

Signed-off-by: Sebastian Wick <sebastian@sebastianwick.net>
2019-11-04 15:10:05 +01:00
Sebastian Wick 5b64fbd965 clients/window: bump wl_seat version to 6
Hook up listeners for touch shape and touch orientation.

Signed-off-by: Sebastian Wick <sebastian@sebastianwick.net>
2019-11-04 15:10:04 +01:00
Stefan Agner 88c8f69a2f clients: avoid build error without gl-renderer
Make sure gl-renderer is enabled when building the EGL and EGL
dmabuf clients. This avoids missing declaration warnings and
linking errors such as:
  ../clients/simple-dmabuf-egl.c:1142: undefined reference to `weston_check_egl_extension
  ...
  ../clients/simple-egl.c:206: undefined reference to `weston_check_egl_extension'

Signed-off-by: Stefan Agner <stefan@agner.ch>
2019-10-24 09:09:33 +00:00
Pekka Paalanen 4f5e360180 build: simplify include_directories
Define common_inc which includes both public_inc and the project root directory.
The project root directory will allow access to config.h and all the shared/
headers.

Replacing all custom '.', '..', '../..', '../shared' etc. include paths with
common_inc reduces clutter in the target definitions and enforces the common
 #include directive style, as e.g. including shared/ headers without the
subdirectory name no longer works.

Unfortunately this does not prevent one from using private libweston headers
with the usual include pattern for public headers.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-10-04 17:14:22 +03:00
Pekka Paalanen c232f8d934 Unify the include style of shared/ headers
When all shared/ headers are included in the same way, we can drop unnecessary
include seach paths from the compiler.

This include style was chosen because it is prevalent in the code base. Doing
anything different would have been a bigger patch.

This also means that we need to keep the project root directory in the include
search path, which means that one could accidentally include private headers
with

	#include "libweston/dbus.h"

or even

	#include <libweston/dbus.h>

IMO such problem is smaller than the churn caused by any of the alternatives,
and we should be able to catch those in review. We might even be able to catch
those with grep in CI if necessary.

The "bad" include style was found with:
$ for h in shared/*.h; do git grep -F $(basename $h); done | grep -vF '"shared/'

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-10-04 16:04:48 +03:00
Pekka Paalanen b6c7a3020c build: use dependency for matrix.c
matrix.c needs to be built differently for a test program vs. everything else,
so it cannot be in a helper lib. Instead, make a dependency object for it for
easy use which always gets all the paths correct automatically.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-10-04 15:55:55 +03:00
Adam Jackson 95efe82982 simple-dmabuf-egl: Allow QueryDmaBufModifiers to report no modifiers
Some drivers expose the extension so they can expose
eglQueryDmaBufFormatsEXT, but don't support any modifiers. Treat this the
same as if the extension wasn't present.
2019-10-01 10:24:57 +00:00
Pekka Paalanen 1ca4ed2015 clients: fix len-string formatting
All these have the printf format string wrong. "%*s" sets the field width but
does not limit the string to len bytes. You need to set precision instead to
limit to len bytes: "%.*s".

Found by grepping, after wondering why my WIP prints printed garbage at the
end.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-09-23 17:27:09 +03:00
Manuel Stoeckl 5f592c7855 weston-terminal: Ignore SIGPIPE
This ensures that the default signal action doesn't kill weston-terminal
when the terminal tries to paste into a pipe whose read end has already
been shut down. (For example, a pipe from a misconfigured program or from
one which crashes/exits before the terminal calls write().)

Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
2019-08-23 11:53:13 +00:00
Manuel Stoeckl 324d846567 clients/simple-egl: Exit when display has an error
Check return values for wl_display_dispatch_* functions, so that
the program stops running when the compositor that it is connected
to crashes.

Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
2019-08-12 18:43:30 +00:00
Ankit Nautiyal 8b40deaaaa clients: Add content-protection client app
This patch adds a client app which can be used to show the
implementation of weston content-protection protocol. The app can
request for Type-0 and Type-1 content or request for disabling
content-protection to the content-protection server.
It listens for the content-protection status change event from the
server and accordingly display the required content.

The content Type-0, Type-1 and unprotected contents are prepared
using cairo surface, with different color and text to distinguish
between the contents.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
2019-07-05 14:13:30 +05:30
random human 6d9fda7156
clients/presentation-shm: use xdg_shell instead of wl_shell
wl_shell is deprecated, and using xdg_shell allows the client to run on
compositors which do not implement the old protocol. Functionality
should be identical.

Signed-off-by: Astatos Aner <random.bored.human@gmail.com>
2019-06-27 17:44:19 +00:00
- c505af8820 desktop-shell: Click top left and align clock
Pads launchers with the empty space that used to be around them. Moving
pointer to 0,0 and clicking launches the preferred app. First launcher
has more padding at its start to look nice.

Moves the clock to the right edge with same padding. Keeps one of the
two values for text extents that the code was already retrieving but
never read. Horizontal panel position centers the clock.

Sets text in the panel, meaning tooltips and the clock, to consistent 14
units of the default system font at 85% of the max brightness, so it's
less tiring on eyes.
2019-06-26 21:00:43 +00:00
Marius Vlad 48392643ec clients: Fix/resolved doxygen warnings
Missing/wrong parameters and '[out]' issues.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-06-25 14:05:54 +00:00
Antonio Borneo 3957863667 log: remove "%m" from format strings by using strerror(errno)
The printf() format specifier "%m" is a glibc extension to print
the string returned by strerror(errno). While supported by other
libraries (e.g. uClibc and musl), it is not widely portable.

In Weston code the format string is often passed to a logging
function that calls other syscalls before the conversion of "%m"
takes place. If one of such syscall modifies the value in errno,
the conversion of "%m" will incorrectly report the error string
corresponding to the new value of errno.

Remove all the occurrences of the specifier "%m" in Weston code
by using directly the string returned by strerror(errno).
While there, fix some minor indentation issue.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2019-05-02 22:10:30 +02:00
Antonio Borneo 4071225cdc clients: close unused keymap fd
In the simple examples in which keymap is not handled, the open
descriptor has to be properly closed.

After each suspend/resume sequence the keymap is send again to
every client. On client weston-simple-egl the leak causes a
segfault when no more file descriptors can be opened.

Close the file descriptor and lazily copy/paste the comment
already available in simple-dmabuf-v4l.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2019-04-29 18:11:45 +02:00
Sebastian Wick 1bdf363295 weston-terminal: Fix weston-terminal crash on mutter
Set up handlers for wl_data_source v3 events

Signed-off-by: Sebastian Wick <sebastian@sebastianwick.net>
2019-04-20 10:57:06 +00:00
Harish Krupo 43152a3a8f Fix: clients/window: Premature finish request when copy-pasting
As per the wl_data_offer::finish documentation, the request is only
valid for drag n drop operations and signifies that a dnd is completed.
Send finish request only when we have a dnd operation active.

Signed-off-by: Harish Krupo <harishkrupo@gmail.com>
2019-04-19 22:06:44 +05:30
Harish Krupo ee4c7a24dd window.c: Don't assume registry advertisement order
The toytoolkit assumes that wl_seats are advertised after
wl_data_device_manager and creates a data_device during wl_seat
registry binding. This patch removes this assumption by creating
data_devices for all the wl_seats created up until then.

Fixes: https://gitlab.freedesktop.org/wayland/weston/issues/201

Signed-off-by: Harish Krupo <harishkrupo@gmail.com>
2019-04-19 16:24:26 +00:00
Pekka Paalanen 4e952328ca build: turn vertex-clipping.c into a dependency
Making this into a dependency object not only carries the .c files with it, but
it also brings the include directories as well, which means the users can
simply use the object without guessing the paths.

This should help with moving GL-renderer into a new subdirectory.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-04-18 12:50:55 +03:00
Pekka Paalanen ecbdcfd373 Rename zalloc.h to libweston/zalloc.h
It is a public installed header used by libweston.h.

See "Rename compositor.h to libweston/libweston.h" for rationale.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-04-18 12:31:46 +03:00
Pekka Paalanen 91b1010de9 Rename config-parser.h to libweston/config-parser.h
It is a public installed header used by libweston.h.

See "Rename compositor.h to libweston/libweston.h" for rationale.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-04-18 12:31:46 +03:00
Pekka Paalanen 96dc449259 Rename matrix.h to libweston/matrix.h
matrix.h is a public installed header and even used by libweston.h.

See "Rename compositor.h to libweston/libweston.h" for rationale.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-04-18 12:31:46 +03:00
Luca Weiss 923a1e9688 Fix incorrect include
In file included from ../clients/multi-resource.c:38:                                                                                       
/usr/include/sys/poll.h:1:2: warning: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> [-Wcpp]                               
 #warning redirecting incorrect #include <sys/poll.h> to <poll.h>                                                                            
  ^~~~~~~
2019-04-14 10:38:25 +00:00
Kamal Pandey 53d7c243ba FIX: weston: clients: typo in simple-dmabuf-egl.c
Fix variable EGL_NO_IMAGE to EGL_NO_IMAGE_KHR in
clients/simple-dmabuf-egl.c

Signed-off-by: Kamal Pandey <pandeykamal13526@gmail.com>
2019-04-04 19:45:45 +05:30
Alexandros Frantzis ff98a9080f clients/simple-dmabuf-egl: Properly check for error in gbm_bo_get_handle_for_plane
gbm_bo_get_handle_for_plane returns handle.s32 == -1 on error, at least
for the Mesa dri implementation.

Reported-by: Marius Vlad <marius.vlad@collabora.com>
Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
2019-03-28 09:51:28 +00:00
Pekka Paalanen cbffca980b meson: link editor with gobject-2.0
editor.c calls g_clear_object(), so it should link to gobject directly instead
of relying on pangocairo pulling it in in its pkg-config.

Fixes: https://gitlab.freedesktop.org/wayland/weston/issues/211

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-03-28 09:43:23 +00:00
Alexandros Frantzis 10a7339611 clients/simple-dmabuf-egl: Create the EGL display using the GBM platform
Since we are managing and rendering to buffers on our own with GBM,
create the EGL display using the GBM platform with the DRM render node,
instead of using the Wayland EGL platform.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
2019-03-05 13:04:39 +02:00
Emmanuel Gil Peyrot 426c24673f Fix typos all around (thanks codespell!) 2019-02-20 16:47:35 +01:00
ant8me f99fac22ab clients: use xdg_shell stable instead of v6
Now that Weston supports the stable revision, use it. Better to excercise the
current rather than outdated protocol.

Pekka:
- split the patch, rewrote commit message
- rename xdg_shell_ping to xdg_wm_base_ping
- rename xdg_shell_listener to wm_base_listener
- rename shell to wm_base
- fix continued line alignment
- drop unrelated change of adding parentheses around bit-wise and

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-02-15 11:18:38 +00:00
Michael Teyfel d6371b5a6a window client: remove ivi-application support
Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
2019-02-06 17:45:09 +00:00
Michael Teyfel a232b7e22c simple-shm: remove ivi-application support
Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
2019-02-06 17:45:09 +00:00
Michael Teyfel 111d3d8fb4 simple-egl: remove ivi-application support
Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
2019-02-06 17:45:09 +00:00
Alexandros Frantzis 7261edfe36 clients: Add a mandelbrot set shader to simple-dmabuf-egl
Support drawing a mandelbrot set in the fragment shader, rendering it
with separate draw calls, one for each cell in a virtual 4x4 grid. This
more complex and heavy drawing will potentially help us to visually
discover any present or future explicit synchronization issues.

The mandelbrot set rendering is enabled with the -m/--mandelbrot
command-line switch.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
2019-02-06 12:21:56 +00:00
Alexandros Frantzis a95bb6f7e5 clients: Support explicit synchronization in simple-dmabuf-egl
Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>

Changes in v7:
  - Merge acquire fence and release fence code blocks in redraw().
  - Use 1 << n to define option bitflags.
  - Remove redundant statement involving OPT_IMPLICIT_SYNC.

Changes in v6:
  - Add option for window size.
  - Add option for enabling/disabling explicit sync.

Changes in v5:
  - Meson support.
2019-02-06 12:21:56 +00:00
emersion ac71ee5d6a clients: sanitize XCURSOR_SIZE
Fixes https://gitlab.freedesktop.org/wayland/weston/issues/164
2019-01-31 09:04:22 +00:00
Dima Ryazanov 13bdf25270 clients: A better fix for a crash when unlocking or unconfining a pointer
This is a rewrite of the fix in:
https://lists.freedesktop.org/archives/wayland-devel/2018-May/038140.html

It addresses Pekka's concerns about window getting destroyed before the
unlock/unconfine event is triggered.

Signed-off-by: Dima Ryazanov <dima@gmail.com>
2019-01-31 00:20:36 +00:00
Dima Ryazanov 44dd7f2738 clients: Delete an unused variable
Signed-off-by: Dima Ryazanov <dima@gmail.com>
2019-01-31 00:20:36 +00:00
Dima Ryazanov 336ce67da7 Revert "Fix a crash when unlocking or unconfining a pointer"
This reverts commit e0dc5d47cb.

Signed-off-by: Dima Ryazanov <dima@gmail.com>
2019-01-31 00:20:36 +00:00
Pekka Paalanen fb61e45de2 meson: friendly error for simple-dmabuf-drm
This is probably the most annoying ones. Some distributions do not even package
a libdrm_${driver} if the driver's hardware does not occur on the CPU
architecture, e.g. Debian x86_64 does not have libdrm_etnaviv.

Helps people to disable those.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-01-17 14:39:27 +00:00
Alexandros Frantzis 9985c534b8 clients/simple-dmabuf-egl: Render a moving square
Render a moving square instead of just clearing the buffer, to help
uncover rendering issues (e.g. modifier-related issues) which may not be
visible with a simple glClear.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
2019-01-17 14:04:05 +02:00
Alexandros Frantzis e9700f62af clients/simple-dmabuf-egl: Support dmabuf format modifiers
Take into account format modifiers advertised by the compositor and the
EGL implementation and supported by the buffer creation mechanism, to
select the optimal buffer modifier.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
2019-01-17 14:04:05 +02:00
Pekka Paalanen 4b29ffddaa meson: contain and check simple-dmabuf-egl deps
Check the egl, glesv2 and gbm dependencies locally instead of relying on
the dep_* variables from the top level meson.build or
libweston/meson.build (dep_gbm).

This should make these dependencies now explicitly checked when the app
is built, rather than relying on other components doing the checks. If
the drm-backend was disabled, this would have probably hit an error
using the undeclared variable dep_gbm.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
2018-12-31 15:16:53 +02:00
Pekka Paalanen 182d3771dd meson: fix pangocairo being optional
Cannot use dependency() directly in the structure, because it will
execute regardless of the option. Instead, let's store the dependency
name in the structure and use the same logic as with simple_clients to
conditionally look for the dependencies.

As a bonus, this brings friendly error messages to demo-clients
dependencies.

subsurfaces' dependencies are also converted to maintain consistency
with simple_clients.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
2018-12-31 11:16:16 +02:00
Alexandros Frantzis b100668426 clients: Add simple-dmabuf-egl
Add a client that uses EGL/GLESv2 to draw to dmabuf buffers, utilizing
EGLImages and FBOs. The client uses GBM to create the dmabufs buffers.

The simple-dmabuf-egl client is partly based on patch [1] that changes
dmabuf clients to use GBM instead of libdrm code, but has been greatly
simplified since in this case we don't require direct pixel access or
non-RGBA formats.

[1] https://patchwork.freedesktop.org/patch/239796/

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
2018-12-18 17:25:09 +02:00
Marius Vlad d85fe29c1f compositor: Install weston-screenshooter in BINDIR
Previously weston-screenshooter was installed in LIBEXECDIR, but given
that now it can be invoked by the user whenever debug protocol is
enabled, let's intall it into BINDIR. This way, it can be invoked
without the need to modify PATH.

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
2018-12-18 15:37:34 +02:00
Marius Vlad f7843a50ab clients/screenshot: Allow weston-screenshooter to be called directly
As is stands now, libexec/weston-screenshooter can only be called from
within weston server. This will allow weston-screenshooter to be called
on the command line. The final scope here is to allow taking screenshots
without the need of a keyboard.

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
2018-12-18 15:37:34 +02:00
Marius Vlad 3c7cfbbf62 clients/screenshot: Avoid using global variables to pass down data between functions
This is just cosmetic and doesn't fixes anything.

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
2018-12-18 15:37:34 +02:00
Marius Vlad 0161802aa0 Fix compiler warning: unused variable when building with DEBUG
clients/keyboard.c: In function 'dbg':
clients/keyboard.c:276:6: warning: variable 'l' set but not used [-Wunused-but-set-variable]
  int l;

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
2018-12-15 18:37:57 +02:00