Add the centered option as background-type. This draws the image
once in the center of the screen. If the image is larger, it will
be cropped like scale-crop.
Signed-off-by: Stefan Agner <stefan@agner.ch>
Only draw the background once, using the the current default
background color or the user specified background color.
This allows for non-filling background image implemenation
while still using the specified background color.
Signed-off-by: Stefan Agner <stefan@agner.ch>
A tool for accessing the zcompositor_debug_v1 interface features.
Installed along weston-info, because it should be potentially useful for
people running libweston-based compositors.
Signed-off-by: Pekka Paalanen <pq@iki.fi>
Added a man page for weston-debug client
Signed-off-by: Maniraj Devadoss <Maniraj.Devadoss@in.bosch.com>
[Pekka: fixed 'missing braces aroudn initializer' warning]
Add --list and --all arguments, using interface advertisement.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Emre Ucan <eucan@de.adit-jv.com>
Just rely on getting the supported formats through the dmabuf
extension.
Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
We effectively require it as we don't react to dmabuf_format,
only to dmabuf_modifiers, so there's a chance we may not get
the supported formats information at all.
Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
When the compositor has multiple outputs (not clones) and one of them is
removed, the ones remaining to the right will be moved to close the gap.
Because reflowing the remaining outputs happens before removing the
wl_output global, we get the new output x,y before the removal. This
causes us to consider the remaining output immediately to the right of
the removed output to be a clone of the removed output whose x,y don't
get updated. That will then hit the two assertions this patch removes.
The reason the assertions were not actually hit is because of a
compositor bug which moved the remaining outputs in the wrong direction.
The next patch will fix the reflow, so we need this patch first to avoid
the asserts.
Remove the assertions and hand over the background and panel if the
"clone" does not already have them. If the clone already has them, we
destroy the unnecessary background and panel.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Marius Vlad <marius-cristian.vlad@nxp.com>
eglTerminate should be called before the display was disconnected.
Signed-off-by: Yong Gan <yong.gan@nxp.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
The new calibrator uses weston_touch_calibration protocol extension and
provides the following features:
- chooses the physical touch device to be calibrated by DEVPATH or by
the output/head name; device enumeration provided
- the compositor ensures the calibrator window is shown in the correct
position and size
- no matter how wrong the old calibration is, the touch events will
always arrive in the application
- the calibration is complete, not incremental; the received touch
events are guaranteed to be unmodified
- computes a libinput style calibration matrix directly, not the
WL_CALIBRATION format
- supports multiple touch devices: calibrate one device at a time, and
show user feedback on touching a wrong device instead of recording bad
data
- uses four touch point samples: three to compute the calibration, and
one to verify the calibration is roughly correct
- consistent exit codes
- upload the new calibration into the server after successful
and verified calibration
Due to using special touchscreen calibration protocol extension, this
application cannot be tested without touch input from the compositor.
Practically all of the above mentioned are unlike how the old
calibrator client worked.
Co-developed by Louis-Francis and Pekka.
v2:
- improve help() text
- rename wrong_touch_handler() to invalid_touch_handler()
- improve debug prints by adding sample number
- reorganize code into sample funcs vs. touch funcs
- add a state machine to properly process touch and related events
Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
v1 Tested-by: Matt Hoosier <matt.hoosier@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Fixes a memory leak by calling wl_keyboard_destroy on any keyboard
that was used to listen for events.
Signed-off-by: Markus Ongyerth <wl@ongy.net>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
This now prints each tablet seat with at least one tablet/pad/tool
attached.
For each tablet seat, each tablet, pad and tool is printed with as much
detail about the device as the protocol provides.
Seat info is stored to be referenced, because the protocol requires to
request a tablet_seat for each wl_seat and it's not guaranteed that the
tablet_v2_manager is available when seats are advertised.
Signed-off-by: Markus Ongyerth <wl@ongy.net>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
In GNOME (but not in Weston), if a window loses focus, the client first receives
the focus event, then the unlock/unconfine event. This causes toytoolkit to
dereference a NULL window when unlocking or unconfining the pointer.
To repro:
- Run weston-confine
- Click the window
- Alt-Tab away from it
Result:
[1606837.869] wl_keyboard@19.modifiers(63944, 524352, 0, 0, 0)
[1606837.926] wl_keyboard@19.leave(63945, wl_surface@15)
[1606837.945] wl_pointer@18.leave(63946, wl_surface@15)
[1606837.956] wl_pointer@18.frame()
[1606837.961] zwp_confined_pointer_v1@26.unconfined()
Segmentation fault (core dumped)
To fix this, get the input from the window instead of the other way around.
Signed-off-by: Dima Ryazanov <dima@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This makes --import-format=NV12 testable on e.g. intel
We only set nv12_format_found to true if we found that format and at
least one understood modifier. Store modifier verbatim instead of using
a boolean flag. Last advertised and supported modifier currently wins.
The NV12 DRM_FORMAT_LINEAR image should be green in the upper left
corner and white in the lower right.
Signed-off-by: Guido Günther <agx@sigxcpu.org>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Only exit from main so control flow is in one place.
Signed-off-by: Guido Günther <agx@sigxcpu.org>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
ef57a9b788 added support for window operations such as reporting the
title in escape mode. It implemented this by which-window-op case,
inside the existing which-escape-code case. Whilst it would break out of
the former window-op case, it never broke out of the latter escape-code
case. This would lead to window ops (such as reporting title) falling
through to restoring the saved cursor position.
This doesn't seem at all right, and also fixes a warning with GCC 8.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Use stride instead of width for buffer calculation.
[Derek Foreman edited the commit log and removed the leftover
initialization of 'size']
Signed-off-by: Guido Günther <agx@sigxcpu.org>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
This allows to check if ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_Y_INVERT is
interpreted correctly by the compositor.
We introduce an OPT_* bitmask to hold this flag and possible future
command line flags.
Signed-off-by: Guido Günther <agx@sigxcpu.org>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This allows to enable freedreno and intel backends at the same time
building the prerequisites for adding further ones.
[Pekka: fix configure.ac if statements]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Continue moving bits to use toytimer instead of carelessly open-coded
equivalent. Many of the copies were flawed against the race mentioned
in toytimer_fire().
This patch handles window.c's key repeat, confine demo, and
desktop-shell panel clock.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Acked-by: Daniel Stone <daniels@collabora.com>
There are multiple copies for the timerfd handling code, and I need a
timer in one more app. Consolidate all the timerfd code into window.c to
reduce the duplication. Many of the copies were also flawed against the
race mentioned in toytimer_fire().
This patch handles clickdot and window.c's tooltip timer and cursor
timer.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Acked-by: Daniel Stone <daniels@collabora.com>
In shared-CRTC clone mode there are several wl_output globals for one
weston_output. Only one panel and background is needed per
weston_output, so the extra wl_outputs do not get their own panel and
background.
When a head is unplugged, the corresponding wl_output is removed. If
that was the wl_output associated with the background and panel
surfaces, we must transfer the ownership to a remaining wl_output that
was a clone to avoid losing the background and panel completely.
The transfer relies on desktop-shell.so implementation to register
background and panel surfaces with the weston_output, not the
weston_head, so it does not actually matter the wl_output used to bind
the surfaces is going away.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
If for some reason the desktop-shell plugin would configure a panel with
an invalid size, just destroy the whole panel and forget about it for
this wl_output.
A following patch will cause desktop-shell to configure 0x0 panel when
it deems the panel redundant.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
If for some reason the desktop-shell plugin would configure a background
with an invalid size, just destroy the whole background and forget
about it for this wl_output.
A following patch will cause desktop-shell to configure 0x0 background
when it deems the background redundant.
Fortify weston-desktop-shell against not every output having a
background.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
If XDG_PICTURES_DIR not given, it will use the current directory, as
it was before.
Signed-off-by: Aleksander Morgado <aleksander@aleksander.es>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Instead of overwriting the 'wayland-screenshot.png' file over and
over, store each requested screenshot in a filename based on timestamp
and sequence number.
Signed-off-by: Aleksander Morgado <aleksander@aleksander.es>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Replace every use of DATADIR to create a filename with a call to the new
function that allows overriding DATADIR with an env var at runtime.
No attention is paid to asprintf failure.
This restores make distcheck to a passing state after commit 6b58ea
began checking cairo surfaces for validity and exchanged undefined
behaviour we shouldn't have been dependent on for consistent test failure.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
[Pekka: split if-branches into two lines]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This fetches the _NET_WM_ICON property of the X11 window, and use the
first image found as the frame icon.
This has been tested with various X11 programs, and improves usability
and user-friendliness a bit.
Changes since v1:
- Changed frame_button_create() to use
frame_button_create_from_surface() internally.
- Removed a check that should never have been commited.
Changes since v2:
- Request UINT32_MAX items instead of 2048, to avoid cutting valid
icons.
- Strengthen checks against malformed input.
- Handle XCB_PROPERTY_DELETE to remove the icon.
- Schedule a repaint if the icon changed.
Changes since v3:
- Keep the previous Cairo surface until the new one has been
successfully loaded.
- Use uint32_t for cardinals. Unsigned is the same type except on
16-bit machines, but uint32_t is clearer.
- Declare length as uint32_t too, like in xcb_get_property_reply_t.
Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Add helper function to convert tv_sec_hi, tv_sec_lo, tv_nsec triplets,
used for sending high-resolution timestamp data over the wayland
protocol, to struct timespec values. Replace existing conversion code
with the helper function.
Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
The window position was correct but the window size was wrong
when simple-egl returns from maximized window to un-maximized.
Its size should be restored to original size.
Signed-off-by: Tomohiro Komagata <tomohiro.komagata.aj@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
The frame callback added on button click re-adds itself when done,
so adding a new one every click resulted in an ever increasing
number of callbacks.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Acked-by: Daniel Stone <daniels@collabora.com>
This test isn't particularly useful when the compositor doesn't support
drag and drop - so bail if we fail to create a data source.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
display_create_data_source() can return NULL when there's no data device
manager present. Instead of carrying on blindly, test its return value.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
This now prints each (format, modifier) tuple, to show which ones the
compositor sends to its clients. It is only implemented for version 3+,
since I didn’t have any compositor implementing previous versions, and
the old `format` event is deprecated anyway.
Signed-off-by: Emmanuel Gil Peyrot <emmanuel.peyrot@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
If the --click-to-show option is specified, clicking an input field will toggle
the input panel visiblity
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Tested-by: Silvan Jegen <s.jegen@gmail.com>
Reviewed-by: Jan Arne Petersen <janarne@gmail.com>
This change replaces a queued emission of buffer-release events (which
is prone to starvation) with a regular event emission. This means that
client programs no longer need to secretly install surface frame
listeners just to guarantee that they get correctly notified of buffer
lifecycle events.
v2:
More information about the historical reasons why this change hadn't
happened yet, and the consensus to finally move ahead with it can be
found at the discussion terminating in this message:
https://lists.freedesktop.org/archives/wayland-devel/2017-September/035147.html
Signed-off-by: Matt Hoosier <matt.hoosier@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
When calibrating touchscreen with weston-calibrator, you can use the mouse to
click on the cross which is recorded as a touch event. This event is used to
compute the final calibration of the touchscreen which results in invalid
touchscreen calibration and broken touchscreen behaviour.
In order to avoid to use the mouse in weston-calibrator, we disable mouse
operation by default and add a parameter "--enable-mouse" to enable it.
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.co.uk>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
weston_check_egl_extension() returns a bool, not a pointer.
Fixes: ce5b614c80 "clients/nested: use weston_check_egl_extension
over strstr"
Cc: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
mesa's freedreno driver supports importing dmabufs with format
DRM_FORMAT_NV12 and DRM_FORMAT_MOD_SAMSUNG_64_32_TILE modifier.
demonstrate weston modifier advertising and import path using this
combination when run with --import-format=NV12.
v2:
- hard code format if platform doesn't implement
EGL_EXT_image_dma_buf_import_modifiers and cannot advertise
format/modifier support.
- squash using valid frame data to fill dmabuf planes
Signed-off-by: Varad Gautam <varad.gautam@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
abstract drm specific bits to struct drm_device and support running on
freedreno. introduce 'modifier' event.
v2: rebase to master, deprecate 'format' event.
Signed-off-by: Varad Gautam <varad.gautam@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>