The seat_cap listener was to register a signal for keyboard_focus, which
we no longer use. Remove it entirely to avoid dead code.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Suggested-by: Derek Foreman <derek.foreman@collabora.com>
As kiosk-shell can't cope with multiple seat add a warning and avoid
creating any new seats. With it, this guards against potentially
receiving an invalid seat.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
With the seperation of surface activation and keyboard input, a special
corner case arose for child top-level windows when surfaces are being
destroyed. To make sure we never pick the wrong window to activate upon
destruction, we verify if the current focused surface is different than
the one being destroyed.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Just like desktop-shell, we shouldn't be dependent on having a keyboard
be present in order to activate a window/surface.
This adds a libweston helper to retrieve the first available seat, and
to use it in order to avoid going over the seat list.
We also encapsulate the activation of the surface in one place, and use
it on surface removal, when the surface has been committed, or for
touch/pointer events. With it we also deal with the keyboard focus and
shell activation in one place.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
These formats will be eventually be useful for color managed clients
using wl_shm that wish to submit buffers encoding high dynamic range
images.
While the minimum requirement for linearly filterable half float
textures is GL ES 2.0 + GL_OES_texture_half_float_linear, to keep
the code simple, this commit only enables the new formats when
the requirements for color management (notably including GL ES 3.0
and GL_EXT_color_buffer_half_float) are available.
Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
This fixes the tear-down and the destroying part in case RDP back-end
couldn't be initialized. The first issue is the rdp_output which will
not be created in some circumstances (can't open the socket for
instance) and requires a guard check, and secondly, the
rdp_head being created above of that, wasn't removed and tripped an
assert when destroying the compositor instance.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Attempting to perform a switch on a surface (already) closed will trip
the assert in activate(), so check if we have a weston_desktop_surface
before trying to activate it.
Fixes#543
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
We no longer make use of the keyboard_focus_listener so remove it
entirely.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Suggested-by: Derek Foreman <derek.foreman@collabora.com>
We shouldn't be constrained by having a keyboard plugged-in, so avoid
activating/de-activating the window/surface in the keyboard focus
handler and embed it straight into the window activation part.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
The shsurf is calloc'ed so the surface count is always 0. Not only
that but the surface is not set as active by default, so there's no
need to de-activate it.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Fix a trivial typo, where the green channel was swapped with the blue
channel, resulting in rbg instead of rgb.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
According to repology.org, all relevant distributions now ship
pipewire 0.3, so we can drop the pretty ugly #if/#else code that was
added to support both at compile-time.
Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
Adding these formats makes it possible for clients using wl_shm to
submit buffers with 10 bits per pixel, and thus (if Weston is
configured with an xrgb2101010 frame buffer) display more precise
colors on some computer monitors.
Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
Currently the screen sharing has to be manually started after weston has
started by pressing Ctrl+Alt+S on a keyboard. Add new bool config option
to the screen-share section which permits starting the screen sharing of
all outputs on weston start up. This is useful e.g. for doing screen
mirroring between two devices over network.
Signed-off-by: Marek Vasut <marex@denx.de>
This leg of the if/else ladder is a duplicate of the previous conditional.
It appears to have been intended to log enter events, but we already
handle those earlier. The drop event is already logged as well,
so let's just discard this branch entirely.
Fixes#552
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
The struct wayland_input objects tracking the outer compositor's
wl_seats are now properly destroyed when the wayland backend is.
Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
The wl_display_roundtrip call was originally introduced to let the
display_add_seat function wait until a wl_seat.name event was received.
This change replaces the wl_display_roundtrip call with an
asynchronous, nonrecursive equivalent. Now a wl_display.sync callback
is used to delay the final steps of adding a seat until one protocol
roundtrip has occured/the name has been received.
Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
Ensures that users tick allow collabration to make rebasing possible
from maintainers, and fast forward merge requests.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This makes it possible to close this client without using a terminal,
especially useful on a phone.
Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
input-method-v1 protocol provides two surface type for the input
panel, `toplevel` and `overlay`. But there is no example for the later
one. This change enables to set weston-keyboard as overlay panel by the
environment variable `WESTON_KEYBOARD_SURFACE_TYPE=overlay` to
demonstrate this feature. In Addition, add weston.ini option
`overlay-keyboard` to set it.
Signed-off-by: Takuro Ashie <ashie@clear-code.com>
When the surface type of input panel is set as an overlay panel, it's
expected to be shown at near the input cursor. But the current
implementation shows it at center-bottom on the desktop at first then
move it to the correct position while typing.
Signed-off-by: Takuro Ashie <ashie@clear-code.com>
wl_shell is officially deprecated so remove support for it and
instead add support for xdg-shell. With it, we've further:
- moved out the buffer handling into its own a distinct structure in
case we might want to do multi-buffer rendering
- perform a redraw after we have receiving the initial configure event,
as to draw to working area where to user can use it for receving touch
events
Additionally we are setting an appid in case one might want to use it in
tandem with kiosk-shell as to be able to place it on a
distinct/different output.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
The keyboard focus listener, caps changed and pointer focus listener
were missing when destroying the seat. These are necessary to avoid
using weston_desktop object even if it was destroyed, which happens due
to a focus out event and ultimately handled by the keyboard focus notify
callback.
Once the seats are destroyed (and implictly the focus handlers) we're
safe to destroy weston_desktop object as well.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This properly tracks the seats and with it, destroys them before
destroying weston_desktop object.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Add a command line option to disable the default flight recorders
so we can save a little bit of CPU and memory on systems where
this isn't necessary.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Fixes an issue where subsurface extending outside of the main surface
wasn't damaged when minimized resulting in left-over content.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
My reading of the GL spec is that a dmabuf becomes a sibling to the
EGLImage created from it, and that all updates to the dmabuf will be
propagated to the EGLImage.
A rebind is still required every time the dmabuf content changes,
but this should be satisfied by gl_renderer_attach(), which does
a rebind when the buffer is commit.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
So, turns out the GL implementation is allowed to destroy EGLImage
sources if this isn't set. Apparently none we've ever been tested on do
this, but it looks like we should be setting this anyway.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
If we're not in a session we can fall back to sd_uid_get_display() to
find the user's primary session.
This allows launching weston from an ssh session or as a systemd
user service if a viable session is available.
It also more closely follows how libseat finds the session. The libseat
launcher can already do these things, so this change makes these
features common to both launchers.
Based on a patch by Sjoerd Simons <sjoerd.simons@collabora.com>
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Reported in !179 adding weston_output_repaint_failed resets the output
Co-authored-by: Daniel Stone
Co-authored-by: Julius Krah
Signed-off-by: n3rdopolis <bluescreen_avenger@verizon.net>
If two or more clients were running and the one that was focused when
weston itself lost keyboard focus was killed, weston would crash.
This is because commit 85d55540cb changed the way we handle saved keyboard
focus when we lose focus, and did so in such a way that the saved keyboard
focus listener could be removed from the surface destroy signal list
during the emit of the surface destroy signal. This corrupted the list
and led to a NULL pointer dereference.
Fix this by using a boolean flag to determine whether we should obey the
saved keyboard focus. We can set this safely in cases where
removing the listener would cause a crash.
Fixes#138
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This is prompted by the spurious CI failure
https://gitlab.freedesktop.org/wayland/weston/-/jobs/13891809
saying:
31/36 output-damage TIMEOUT 122.52s 8 subtests passed
32/36 output-transforms TIMEOUT 122.52s 16 subtests passed
33/36 subsurface TIMEOUT 122.52s
34/36 xwayland TIMEOUT 122.51s
35/36 ivi-shell-app TIMEOUT 122.51s
ERROR: Job failed: execution took longer than 5m0s seconds
That is hitting both kinds of timeouts at the same time: the per-test
timeouts, and the CI job total timeout.
That run seems to have had a particularly ill fortune, as a simple retry
finished the same job in 2 minutes, and the longest running test took
only 24 seconds.
Nevertheless, by Daniel Stone's suggestion let's bump both timeouts:
- the per-test timeout to 120 seconds, which with the multiplier in CI
goes up to 8 minutes
- the job timeout for all build related jobs to 15 minutes
The timeout for tests_standalone is not bumped as we are not adding
significant amounts of new tests there.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Adds a Pixman format field to the pixel format table, and
adjusts the shm format handling code in the Pixman renderer
to use this table.
Pixman formats have been registered only for specific 565, 8888,
and 2101010 layouts, as these have corresponding DRM format codes
and are commonly used.
Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
Instead of manually waiting for the seatd socket to come up, use
seatd-launch.
Add /usr/local/bin to PATH to avoid having to specify the whole
path to seatd-launch.
Signed-off-by: Simon Ser <contact@emersion.fr>
This upgrades seatd to the latest version.
Examples are disabled by default. Man pages are already disabled
by auto_features=disabled. Other build options have been renamed.
Signed-off-by: Simon Ser <contact@emersion.fr>
EGL_KHR_partial_update can be implemented independently of
EGL_EXT_buffer_age so we handle each case seperately.
Signed-off-by: Ben Davis <ben.davis@arm.com>
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
weston_output_enable() initializes the list, but weston_output_release()
maybe be called even if the output was never enabled, triggering the
assert due to uninitialized (actually NULL) list head.
This can be triggered with a bad weston.ini, for example using an
invalid output transform value.
Check in weston_output_disable() instead, but because it too may be
called for non-enabled output, only if it was actually enabled.
Fixes: 1a4f87dec5
"libweston: introduce weston_paint_node"
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Since commit "drm-formats: save result of intersection in the first
array", every block of code where weston_drm_format_array_create() and
destroy() are being called could use init() and fini() instead.
Remove these two functions from the API to make it leaner. This patch
also modifies the code that depends on these functions to use init() and
fini().
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
In the current API, we have some set operations: join, intersect and
subtract. Both join and subtract receives two DRM format arrays and save
the result in the first one.
For the intersection we have a slightly different approach, what makes
the API weird. We don't save the result in the arguments, instead we
return a new array with the result.
Modify weston_drm_format_array_intersect() in order to make it similar
to the other two set operations.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>