Otherwise shseat->focused_ivisurf can point to deleted memory.
This does not happen with the hmi-controller because it explicitly assigns a new
focused surface. But the ivi-shell should not relay on the controller here.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Latest musl has removed the declaration from string.h [1] as it only
implements POSIX version alone and string.h in glibc implements GNU
version of basename. This now results in compile errors on musl.
This might be a warning with older compilers but it is error with
Clang-17+ as it treats -Wimplicit-function-declaration as error
Switch the use in backlight_init function to use POSIX version
[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This was added in 4def21c196.
0c1ab2ad76 removed all uses of NULL
weston_compositor, making the workaround unnecessary.
Drop the workaround, it's dead code.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Fix a crash when right-clicking on a weston-terminal, where
weston_desktop_seat_popup_grab_add_surface() is called with
seat->popup_grab.keyboard.keyboard == NULL in case there is
no keyboard connected.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
eglSwapInterval() is intended to allow capping the frame rate to a divisor
of the display rate. This may not work if the GL library simple-egl is
using doesn't support it well.
It's still useful to test, so add a way to set it.
Signed-off-by: Derek Foreman <derekf.foreman@collabora.com>
Manually mark the surface as mapped exactly once - in the committed
handler where we have our content, and assert that it's correct when we
want to use the surface by instantiating a view.
The view handling can be made much more simple by simply using the new
view helpers.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Surfaces are mapped when they have content, and not when they don't. Try
to apply this rule consistently.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Use the helpers to map a weston_surface and weston_view, rather than
manually manipulating the internals.
Signed-off-by: Daniel Stone <daniels@collabora.com>
When working on tablet tools, use the weston_surface and weston_view
helpers to manipulate their cursors, instead of manually setting various
members.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Add missing documentation for the --address command-line argument
that lets the VNC backend listen only on a specified IP address.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Extract quad bounding box initialization from the GL renderer and move
it to a dedicated initialization function in the clipper. It's used by
both the renderer and the clipping test client, which further reduces
code duplication.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Simplify clip_transformed() by replacing its context parameter with a
clipping box parameter. The context struct is still used internally to
pass data around.
Since clip_transformed() doesn't take a context anymore, the clipping
boxes are now declared per test and stored along with the other vertex
data. That prepares the ground to add new tests using different boxes.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Carry on the common vertex representation front by making boxes use
the clip_vertex struct.
A new function clip_quad_box32() is added to clearly separate the main
function taking a clip_vertex struct from the utility function taking
a pixman_box32 struct.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Pass a clip_vertex struct and a size to clip_transformed() instead of
a polygon8 struct to simplify the clipper API by sticking to a common
vertex representation.
Simmplify vertex-clip test since clip_transformed() now works on a
copy of the polygon (commit edd5d1cc09).
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
clip_simple() isn't used anymore outside of the clipper. This commit
removes it to simplify the clipper API. Its implementation is moved
straight to the axis-aligned quad clipping path of clip_transformed().
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
The same output might be inited twice on init when the shell panel is disabled,
depending on the order the weston_desktop_shell and wl_output globals are
advertised. This triggers a protocol error as only one background can be created
per output.
Since initializing the output requires the weston_desktop_shell global (to
create the background and panel on this output), the output init call is done
conditionally in two places: in the global registry handler (to handle output
hotplug) and after the initial wl_display_roundtrip call to handle the case
where the weston_desktop_shell global was notified after the outputs.
We now check the output has already been initialized correctly by checking if
the background has been created, instead of the panel which is not always
created.
Signed-off-by: Arnaud Vrac <avrac@freebox.fr>
In this case the curtain width and height would be calculated using
uninitialized values, triggering warnings in pixman calls.
Signed-off-by: Arnaud Vrac <avrac@freebox.fr>
Clamping of the alpha value is not done properly since the introduction of the
weston_view_set_alpha() helper.
Signed-off-by: Arnaud Vrac <avrac@freebox.fr>
If we only create the input_panel_surface after we've already created
the window and tried to get some content for it, then we're never going
to enter the input_panel_surface committed handler, so we'll never get
the chance to properly map the surface.
Follow the other surface types by creating the input-panel surface
before we try to attach anything to it.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Fixes: bdf2019e ("desktop-shell: Map input panel surfaces before views")
When the input panel surface gets something committed to it, we have
content and thus the surface has become mapped. Do this from within the
input-panel surface committed handler.
When we want to show the input panel, this is when we map the view. Do
this exactly once as well, and make sure that we don't attempt to map
the view with an unmapped surface.
This regularises the logic to be the same as almost all the other
special surface users.
Signed-off-by: Daniel Stone <daniels@collabora.com>
When editing a text field in chromium deleting the surrounding text with
backspace fails with `The selection range for surrounding text is invalid`
It seems like `(start - keyboard->surrounding_text) - keyboard->surrounding_cursor` evaluates to -1.
As far as i can tell `start - keyboard->surrounding_text` evaluates to
the index in the surrounding_text char arrays that should be deleted.
Signed-off-by: Aske Bækdal Møller <aske@geanix.com>
We can't use the surface damage to determine when to upload new cursor
images because when heads overlap the first repainted head will accumulate
that damage as plane damage.
We can't easily use plane damage either because the plane isn't really
assigned until after an atomic test, which requires the cursor fb to be
current.
Untangle this mess a little by always testing with the first cursor fb,
which is identical to the second in all ways, then replace with the correct
fb in repaint.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Now that overlapping outputs are a thing, we have a problem with vnc
cursors.
The surface->damage used to update the vnc cursor might actually be
flushed by a previous output's repaint cycle, leading to a missing cursor
update to the vnc client.
Instead we should use the damage accumulated on the cursor plane to choose
when to update the cursor. This damage is in output coordinates, so let's
be lazy and just use the presence of damage as an indicator that the
cursor needs an update.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
VISIBILITY_DIRTY is used to apply damage to the plane, but that doesn't
make sense for non-primary planes.
For example, we don't want moving the cursor to result in damage being
registered on the cursor plane.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
When an output repaints, it calculates visibility for its paint nodes,
accumulates damage for all paint nodes across all outputs, and then
paints.
This means that when it's accumulating damage for all paint nodes in
paint_node_add_damage(), it may be accumulating damage to nodes on other
outputs that haven't had their visible regions updates yet.
This leads to clipping with a stale visibility region, and losing damage.
Let's just drop the clip here for now - there are already other places
where paint nodes have to carry damage outside their visible regions.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This is a revert of 72e2da24
The VNC backend will place a single fullscreen surface on a virtual
scanout plane, and send the entire contents of this plane every repaint.
This saves a renderer pass, but moving the mouse over the fullscreen
client results in full screen damage for every mouse motion, similarly
client surfact damage is ignored and every repaint pushes the entire
window content down into Neat VNC.
Due to the way this is implemented, by pushing the scanout plane content
from assign_planes(), the primary plane could post damage and corrupt
the display.
Ideally we could fix this optimization to respect plane damage and do the
scanout plane push from the repaint callback, but since a release is
coming soon let's just strip it out for now.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Stop assuming that NULL represents the stock sRGB color profile. From
now on, query the stock sRGB color profile from the color manager.
This should be internal to libweston (core and the color plugins), and
users of the libweston public API should not be affected by this. They
are still allowed to set an output color profile to the stock sRGB using
NULL.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
In the following commits, we'll create the stock sRGB color profile for
outputs in weston_output_init(), and destroy it in
weston_output_release().
We already have a mock color manager in the tests, but we still need
to add the functions to create/destroy a mock stock sRGB color profile.
This should avoid crashes in the following commits.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
cmlcms_get_hdr_meta() returns early if the output has a color profile
set. That makes sense, because we should be able to get the color
characteristics from the color profiles.
But in the next commits, every output will have a color profile set. To
allow the color-metadata-parsing test, do not return early when
output->color_profile != NULL in cmlcms_get_hdr_meta() anymore.
In the future we'll adjust this function in order to always extract the
color characteristics from color profiles, as output->color_profile
should always be set.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
In the next commit we'll stop using NULL as the stock sRGB color
profile, so add a function to the color manager to allow libweston core
to have access to the stock sRGB profile.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
In the next commit we introduce a function to get the stock sRGB color
profile from the color-manager, so mock a stock color profile in the
color-noop.
It has no valid content, but should make callers happy. This is safe to
do because the color profile is opaque, and only color-noop itself
should have access to its content.
color-lcms already has a stock sRGB color profile, so we don't have
to do anything there.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>