When a toplevel xdg surface is changing from non-fullscreen to fullscreen upon a
client request, activate its corresponding shell surface.
This will let us use the activation mechanism to enforce the enabling of
pointer confinement.
Signed-off-by: Sergio Gómez <sergio.g.delreal@gmail.com>
When the position or size of a fullscreen surface changes (e.g., due to change
in the output), the surface commit logic in desktop_surface_committed() resets
the fullscreen by first calling unset_fullscreen() and later on calling
shell_configure_fullscreen(). One part of this reset is the recreation of the
black view curtain (destroyed in unset_fullscreen() and created again in
shell_configure_fullscreen()).
In the upcoming commit we will replace the call to shell_configure_fullscreen()
with a call to activate() (since we want to activate this shell surface, and
activate() already has a call to shell_configure_fullscreen() in it).
The code in activate() by default lowers the fullscreen layer of the shell
surface through lower_fullscreen_layer(), which is called before
shell_configure_fullscreen(). This lowering function assumes that the fullscreen
shell surface has a valid black view curtain, which as said before was removed
in the call to unset_fullscreen(). Add the check to guard against this case.
Signed-off-by: Sergio Gómez <sergio.g.delreal@gmail.com>
This will be used to let know the constraints code that the reason for
activation is that the client has requested to set the surface to fullscreen.
Signed-off-by: Sergio Gómez <sergio.g.delreal@gmail.com>
Since we want to pass the view to the surface activation listener inside the
constraints code, and the surface is reachable from the view anyway.
The flags field will let us pass the reason for activation to the constraints
code, which will then handle especially the fullscreen case.
Signed-off-by: Sergio Gómez <sergio.g.delreal@gmail.com>
Currently, and for legacy reasons, weston_seat_set_keyboard_focus() contains
logic related to surface activation. Since this function is always called from
weston_view_activate_input(), move that code there where it seems more
appropriate.
This will help us in subsequent commits by avoiding to have to change the
signature of weston_seat_set_keyboard_focus(), which would make that function
even more awkward than it currently is.
Signed-off-by: Sergio Gómez <sergio.g.delreal@gmail.com>
This is because e619a65b09, 'libweston: move gl-borders code into
helper lib' and 6293ab1f90, 'libweston, shared: Move out
weston_shell_get_binding_modifier' moved things out of libweston, and
libweston implicitly depends on xkbcommon.
Rather than just depending on dep_xkbcommon use the deps_for_libweston_users
which includes some other dependencies as well. Had to move it out
of libweston/meson.build and include it in the main meson.build as
libweston/meson.build would have a circular dependency on
libweston/meson.build file.
This fixes the following build issue:
[ 5s] FAILED: libweston/libgl-borders.a.p/gl-borders.c.o
[ 5s] cc -Ilibweston/libgl-borders.a.p -Ilibweston -I../libweston -I. -I.. -Iinclude -I../include -I/usr/include/wayland -I/usr/include/pixman-1 -I/usr/include/cairo
-I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/webp -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -std=gnu99 -Wmissing-prototypes
-Wno-unused-parameter -Wno-shift-negative-value -Wno-missing-field-initializers -Wno-pedantic -Wundef -fvisibility=hidden -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3
-fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -fPIC -MD -MQ libweston/libgl-borders.a.p/gl-borders.c.o -MF
libweston/libgl-borders.a.p/gl-borders.c.o.d -o libweston/libgl-borders.a.p/gl-borders.c.o -c ../libweston/gl-borders.c
[ 5s] In file included from ../libweston/renderer-gl/gl-renderer.h:32,
[ 5s] from ../libweston/gl-borders.h:28,
[ 5s] from ../libweston/gl-borders.c:31:
[ 5s] ../include/libweston/libweston.h:39:10: fatal error: xkbcommon/xkbcommon.h: No such file or directory
[ 4s] FAILED: shared/libshared.a.p/config-parser.c.o
[ 4s] cc -Ishared/libshared.a.p -Ishared -I../shared -I. -I.. -Iinclude -I../include -I/usr/include/wayland -I/usr/include/pixman-1 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall
-Winvalid-pch -Wextra -Wpedantic -std=gnu99 -Wmissing-prototypes -Wno-unused-parameter -Wno-shift-negative-value -Wno-missing-field-initializers -Wno-pedantic -Wundef -fvisibility=hidden -O2
-Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -fPIC -MD -MQ
shared/libshared.a.p/config-parser.c.o -MF shared/libshared.a.p/config-parser.c.o.d -o shared/libshared.a.p/config-parser.c.o -c ../shared/config-parser.c
[ 4s] In file included from ../shared/config-parser.c:44:
[ 4s] ../include/libweston/libweston.h:39:10: fatal error: xkbcommon/xkbcommon.h: No such file or directory
Reported-by: Jan Engelhardt <jengelh@inai.de>
Signed-off-by: Jan Engelhardt <jengelh@inai.de>
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Consolidates the 'Using GL/Pixman renderer' message emitted by the
PipeWire, RDP, VNC, and X11 backends by moving the weston_log() into
weston_compositor_init_renderer(). Only print the message after
initializing the renderer has succeeded.
This effectively adds the message to the DRM, headless, and Wayland
backends.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
I just got bitten by this: I thought my compositor was dropping
the viewport somehow, but it just didn't expose the viewporter
global.
Signed-off-by: Simon Ser <contact@emersion.fr>
Hardcode the ad hoc EDID parser to always claim that only SDR is
supported. Even though libdisplay-info is not yet asked for HDR
capabilities, it shall be the only way to see them.
To be nicer to experimenters, main.c adds a note that you really need
libdisplay-info if you want to play with HDR.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Add libdisplay-info as a better alternative for parsing EDID. This way
we do not need to extend Weston's ad hoc parser for new things that
especially HDR support requires.
Eventually the ad hoc parser will be deleted and libdisplay-info becomes
a hard dependency for the drm-backend, reducing our maintenance burden.
Unlike the ad hoc code, libdisplay-info has automated CI testing.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
We want to install all dependencies ourselves to know exactly what we
get.
I accidentally got some wraps built when I did not expect so.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Move the ad hoc filling code into a separate function. Then we can
easily add an alternative implementation of the new function using
libdisplay-info without messing up the code any more than necessary.
Pure refactoring.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Now that this is used only internally in modes.c, move it there. It will
not be used with libdisplay-info.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This will make adding libdisplay-info as another EDID parser easier,
because libdisplay-info always returns malloc'd strings.
To make things easier to extend as well, I introduce struct
drm_head_info. The libdisplay-info case will likely return more
information than this in the future.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Global arguments leak into Meson subprojects. Let's not do that.
Specifically, -fvisibility=hidden leaks into a future sub-project
libdisplay-info, where it results the DSO not exporting any symbols.
Libdisplay-info uses a linker script to define the exported symbols and
not visiblity.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
There are some ICC profiles that contain something named VCGT tag. These
are usually power curves (y = x ^ exp) that were loaded in the video
card when the ICC profile was created. So the compositor should mimic
that in order to use the profile.
Weston already has support for that, but our ICC profile tests were
missing this case. This adds such tests.
For testing purposes, we have added tests with different exponents per
color channel.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Without that we may crash when trying to create a PTYPE_CLUT ICC profile
with dimension zeroed. This would be wrong, so with this change we are
basically validating the test case arguments.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
For now we have some tests with the same name. Differentiate them based
on the ICC profile type that they build: CLUT vs matrix shaper.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
In Pipewire and Gstreamer terminology Weston is a "live" source (as we
do not explicitly set PW_KEY_STREAM_IS_LIVE to false).
Such sources, be it compositors, cameras or microphones, usually set
the current system time as timestamps on buffers in order to make life
easier for consumers. Thus let's do so as well.
This notably helps when recording using `gstpipewiresrc` with the
`keepalive-time` property set.
Signed-off-by: Robert Mader <robert.mader@collabora.com>
instead of the output mode. The mode doesn't say anything about the
actual output geometry which could lead to buffers extending the output
region on rotated monitors. This now also works with moving the window
to different monitors.
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
Due to the latest developments fdo no longer allows new users to fork
the Weston project so let's inform users about that.
This also swaps 'Finding something to work on' with 'Sending patches'
paragraph as the first thing users need to look into.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
As of PipeWire version 0.3.69, the gstpipewiresrc element uses the
existence of a modifier as a trigger to select dmabuf memory, failing
caps negotiation as we don't send DMA buffers yet.
Remove the linear modifier for now, to be added back when we add dmabuf
support to the PipeWire backend. This allows testing the PipeWire
backend with current GStreamer + PipeWire.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Pass the backend instead of the compositor to the PipeWire output API
create_head() method and increment the API version.
That way the backend will not have to find the backend pointer from the
compositor. This is trivial now, but in the multi-backend case would
entail iterating over all backends to find the correct one.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
The session_listener is embedded in the DRM backend structure.
Use this to obtain the DRM backend with container_of().
That way the DRM backend will not have to be found from the compositor.
This is trivial now, but in the multi-backend case would entail
iterating over all backends to find the correct one.
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Now that our process-launching internals are identical between the
(still-misnamed) weston_client_launch and the frontend's Xwayland
launcher, we can reuse the internals instead of open-coding it.
As a result, we now additionally prevent Xwayland from inheriting
Weston's signal mask, by clearing SIG_UNBLOCK on all signals. This
should have no observable effect as we do not depend on signal handling
within Xwayland, instead using the displayfd readiness mechanism since
c2f4201ed2.
Signed-off-by: Daniel Stone <daniels@collabora.com>
This gets us closer to the implementation of weston_client_launch, so we
can reuse that instead of open-coding it.
Signed-off-by: Daniel Stone <daniels@collabora.com>
weston_client_start() takes only a single path with no arguments,
forking a process to start that command line, and creating a client from
it.
weston_client_launch(), which was always misnamed and will be renamed in
the next patch, now only handles the child process and nothing else.
Signed-off-by: Daniel Stone <daniels@collabora.com>
When we launch a child, we need to clear CLOEXEC on any FDs we want to
survive the exec. Use an array for doing this, so it's more generic and
we can allow callers to pass in their own.
Signed-off-by: Daniel Stone <daniels@collabora.com>
See discussion in wayland/weston!951 for the reasoning why: the
screenshooter must only deal with wl_client.
Signed-off-by: Daniel Stone <daniels@collabora.com>
When we're asked to take a screenshot but are already taking one, just
exit out of the function early.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Use assert() to check for invalid NULL arguments. Something like that happens
during development and assert() makes it easier to find the error. And it avoids
unnecessary additional error handling.
The hmi-controller asserted anyways so this just moves the assert on level
deeper. Other controller probably do the same thing, or don't check the return
values at all.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
The return values for most of the API functions will be removed and replaced by
asserts. So remove the return value checks. The end result will be the same:
These functions only fail for incorrect API usage, so basically the asserts are
moved from the hmi-controller into the shell.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>