this will allow adding other drm backends later.
Signed-off-by: Varad Gautam <varad.gautam@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
request immediate dmabuf import when run with "immed" arg.
Signed-off-by: Varad Gautam <varad.gautam@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
wl_surface_damage_buffer landed ages ago, but in order for GL to
use it the client must bind a wl_compositor version >= 4 (the
version where damage_buffer was introduced).
This patch updates the bind version and allows
eglSwapBuffersWithDamage to actually use the provided damage
rectangles instead of performing full surface damage.
This log is much longer than the patch.
Reviewed-by: Daniel Stone <daniels@collabora.com>
If anything is printed for the terminal window to display before the
window has been initially sized we end up with a segfault.
This defers the exec() of the shell child process until after the
window is sized so this can't happen anymore.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Client applications shouldn't be in the same process group as
the display server.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
This is useful for testing compositor response to a client that
requests a maximized initial surface.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
According to v4l2 documentation, DQBUF always clears FLAG_DONE, so
this assert can be expected to fire 100% of the time.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This emulates extra drawing work by usleep().
This is an enhancement to reproduce the problem in the bug report.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98833
[Pekka: reordered the help text]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Don't just dump the raw 32-bit values, try to interpret it as a DRM
fourcc too.
This prints properly the formats YUYV, NV12 and YU12 supported by
Weston.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
If we're building with EGL support generally, but without Cairo/GLESv2,
building the clients fail, because window.c defines the EGL native
types, however platform.h also brings these in.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Cc: Emil Velikov <emil.velikov@collabora.com>
Cc: Bryce Harrington <brycef@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Bryce Harrington <bryce@osg.samsung.com>
A handful of source files were not using the MIT Expat text in
COPYING. Update these files to bring them inline with the rest,
standardizing on the MIT Expat text.
Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This reverts commit 0fee977c46.
This commit introduces a requirement on v4l2_query_ext_ctrl and
VIDIOC_QUERY_EXT_CTRL, which were introduced in kernel 3.17. Some Ubuntu
LTS releases ship with much older kernels (and, significantly, UAPI),
which don't have these.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
The v4l2 API can be queried to detect if the input video image is
horizontally or vertically flipped. If the image is y-flipped, we can
set the ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_Y_INVERT flag to notify the
compositor. If the image is h-flipped, we can only print a warning
since linux_buffer_params_v1 does not support horizontal flipping.
Signed-off-by: Micah Fedke <micah.fedke@collabora.co.uk>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
clients/editor.c: In function ‘read_file’:
clients/editor.c:1578:16: warning: logical ‘or’ applied to non-boolean
constant [-Wlogical-op]
errno = errsv || EINVAL;
This works in the shell, but not in C. Introduced in 411ffabbb5
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Emilio Pozuelo Monfort <pochu@debian.org>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
This can happen if you right-click in weston-terminal a few times very quickly.
The pointer_handle_enter callback already checks for NULL, so let's do that in
keyboard_handle_enter, too.
Signed-off-by: Dima Ryazanov <dima@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
HAVE_PANGO is not in any AC_DEFINE(), so the check is just wrong.
g_type_init() was never called, which is fine since GLib 2.36 anyway.
It is better not to have a wrong usage of HAVE_PANGO here.
Just check for GLib 2.36 in configure.ac instead.
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
The manpage claims that none is valid, so let's make it so.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
This makes the background image look much nicer, at the expense of
slightly more memory bandwidth used.
Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
No need to add protocol/, as it's already handled by an explicit
compiler include path.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Dima Ryazanov <dima@gmail.com>
Add support for basic text file loading, to facilitate more expansive
testing of its UTF-8 text editing support.
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Since 894b3rcc634 weston-terminal will crash on first keystroke if you
fail to create an xkb compose state. This can happen if you don't have
a Compose file.
Instead, now we just return uncomposed symbols.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
These variables will be much more useful in the following commit.
The indentation is off to avoid future diff noise.
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Do a minimalistic teardown at program exist.
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
... over a direct eglDestroySurface call. Provides symmetry in the
create/destroy paths.
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
... over a direct eglDestroySurface call. Provides symmetry in the
create/destroy paths.
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Functionally identical to the EXT version of the extension.
v2: s/foo/swap_damage_ext_to_entrypoint/ (Eric, Daniel)
v3: do the above sed for real (Frank)
[daniels: Fixed signed vs. unsigned warning.]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> (v1)
Reviewed-by: Daniel Stone <daniels@collabora.com>
In Fedora, bash is configured to display a desktop notification when a command
finishes (and the terminal is not focused). weston-terminal complains about it;
let's silence it.
Signed-off-by: Dima Ryazanov <dima@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
It's currently unused, and there's actually no way to use it correctly.
The caller cannot free the menu that was created:
- the function only returns the window, not the menu
- there's no public API to destroy a menu object
Signed-off-by: Dima Ryazanov <dima@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
clients/terminal.c: In function 'redraw_handler':
clients/terminal.c:213:28: warning: 'machine.unicode' may be used
uninitialized in this function [-Wmaybe-uninitialized]
struct utf8_state_machine machine;
^~~~~~~
clients/terminal.c: In function 'handle_char':
clients/terminal.c:213:28: warning: 'machine.unicode' may be used
uninitialized in this function [-Wmaybe-uninitialized]
Warning produced by GCC 5.3 and 6.1, with -O3.
'I found it weird that the compiler wouldn’t see that, so I re-checked
the code.
I think with -O3, this specific "for" is compile-time unlooped, and
utf8_next_char inlined. And there is *one* path that can keep
machine.state to utf8state_start, thus triggering the warning.
Without -O3, the function is globally tagged as “changing unicode”, so
no warning is produced.
[...]
Side note: I picked 0 as the default value, but maybe in this case
0xfffd would be better?'
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
If only the source of a viewport is set, the width and height must
be integer or the protocol mandates that the compositor generate an
error. This is because using only the source is a crop, and the
width and height become the surface size - all surface sizes must
be integer.
Weston was fixed to generate this error in bb32ccc0, however the
test app continued to use fractional co-ordinates when run as
weston-scaler -s (which only sets the viewport source)
This leaves fractional width/height for the other cases, but uses
integer for the crop-only mode. The descriptions in the help text
are still accurate with this change, but weston-scaler -s no longer
exits with an error.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
According to the xdg-shell v6 protocol a positioner object is only
complete if both the size and its anchor rectangle are set. Ensure the
weston clients do this and let weston be more strict on checking if a
client has done so.
This also fixes weston-terminal popups not showing up on gnome-shell
3.22.
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Debian Jessie's version of libxkbcommon is too old for compose support,
so rather than force people to upgrade, let's make it conditional.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Daniel Díaz <daniel.diaz@linaro.org>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Except for weston-info, client source files are not prefixed "weston-".
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Jan Arne Petersen <janarne@gmail.com>
XKB_KEYMAP_COMPILE_NO_FLAGS and XKB_CONTEXT_NO_FLAGS are both defined as
0 so no functional change here, just improved code clarity.
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Jan Arne Petersen <janarne@gmail.com>
This adds single-symbol compose support using libxkbcommon's compose
functionality. E.g., assuming you have the right alt key defined as
your compose key, typing <RAlt>+i+' will produce í, and <RAlt>+y+= will
produce ¥. This makes compose key work for weston-editor,
weston-terminal, weston-eventdemo, and any other clients that use
Weston's window.* routines for accepting and managing keyboard input.
Compose sequences are loaded from the system's standard tables. As
well, libxkbcommon will transparently load custom sequences from the
user's ~/.XCompose file.
Note that due to limitations in toytoolkit's key handler interface, only
compose sequences resulting in single symbols are supported. While
libxkbcommon supports multi-symbol compose strings, support for passing
text buffers to Weston clients is left as future work.
This largely obviates the need for the weston-simple-im input method
client, which had provided a very limited compose functionality that was
only available in clients implementing the zwp_input_method protocol,
and with no mechanism to load system or user-specified compose keys.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=53648
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
This patch fixes a compiler warning when building with
clang, since it doesn't support gnu_printf attribute.
v2:
- Switch to WL_PRINTF per suggestion from Eric Engestrom.
v3:
- Explicitly include wayland-util.h
Signed-off-by: Armin Krezović <krezovic.armin@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>