This reverts commit 0ff5ac0f7b.
Now that we have a way to prevent repaints of empty scene graphs from
the shells, remove the curtains and just have our first paint be
proper content.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
We've added a curtain to the shells so at startup we have something to
render, but this causes a flicker if someone is trying to have a seamless
transition from boot to weston.
Add a ready flag that allows the shell to indicate repaints are safe, so
we can remove the curtains and have no wasted frames at startup.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
In a multi-screen setup, removing the first screen triggers `handle_output_move`.
If `weston_view_set_position` is called on an output that has an active popup,
it causes a weston crash due to the view has a parent.
Signed-off-by: liang zhou <liang.zhou@gehealthcare.com>
The shell_set_view_fullscreen function was dereferencing
shsurf->fullscreen_output without checking if it was NULL first. This
could lead to a crash when a fullscreen surface had no associated
output during display hotplug.
Fix issue: https://gitlab.freedesktop.org/wayland/weston/-/issues/1028
Signed-off-by: liang zhou <liang.zhou@gehealthcare.com>
This already calls either weston_view_add_transform() or
weston_view_remove_transform() followed by
weston_view_update_transform(), the combination of which will already
force a repaint for those views.
Signed-off-by: Daniel Stone <daniels@collabora.com>
If the view has become unmapped, the weston_desktop_surface should still
be unreferenced, otherwise it'll be leaked until the client disconnects.
Signed-off-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
Similar to what's just been done to kiosk-shell, use our internal
shell_output instead of directly using weston_output in our internal
structures.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This is problematic as we don't have namespacing for these and some of
the macros can interfere with other defines.
This reverts commit 8634c7e349.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
With this, when unplugging an extended display, the view displayed on
the extended display won't be re-positioned to other displays.
On some embedded devices, the views are often fullscreen displayed, even
on the extended displays. When disconnecting the extended displays, the
views are not desired to be moved onto the existing displays. Without
this change, we can see the view flash across the existing displays
even though the UI program hides the view as soon as it can, which is
unexpected.
Signed-off-by: Paul Pu <hui.pu@gehealthcare.com>
Desktop-shell currently waits for the desktop-shell client to set up a
background image. But the outputs are enabled before this happens, which
forces a repaint.
If the fade animation is enabled, there's a fade curtain in place, but if
it's disabled the scene graph is empty at the repaint.
This repaint with an empty scene graph can have very nasty consequences,
especially if frame buffer compression is in use, as the buffer isn't
rendered into and can be in an undefined state that confuses whatever
video hardware is trying to decode the buffer.
Add a temporary black curtain placeholder that ensures the scene graph has
something in it before the client gets a chance to commit the real
background.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
As weston_windowed_output_get_api needs ARRAY_LENGTH() move helpers to a
libweston/ so other users can re-use that instead of re-defining these
all over. Easier for other front-ends to make use of them.
With this change windowed-output-api.h also includes the helpers header.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
If the output is destroyed between setting the panel and committing the
panel, or between setting the background and committing the background,
we have a use after free crash.
Handle this by clearing the surface private pointers on output destroy
so we can skip the useless commits.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This change fixes a side-effect of weston_view_move_to_layer helper
which would basically unmap the view because the layer entry list is no
longer visible. Only add the view to panel layer the first time.
Fixes: #956
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
These should be repositioned relative to their parents, attempting to
move them independently not only doesn't make sense, but violates
weston_coord sanity checks.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
A "mapped" surface need not have a primary output assigned, or
be in a state such that it needs a fade out animation. The view
being mapped is what we should be testing here.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Use gcc and clang's 'fallthrough' attribute instead of a comment to
fall through switch statements. This allows to request fall through
inside a block and prevents issues with preprocessed files.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Mistakenly used weston_seat as opposed to shell_seat when iterating over
the shell seats. This unfortunately takes down the compositor upon switching
back.
Fixes: 4c100ca1d7 ('desktop-shell: Add session listener')
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
And use it to perform keyboard activation on the currently focused
window. Similar to what kiosk-shell does, with the note that we go
over all seats in the system rather than picking the first one
available.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Shell fades out and in depending on user interactions. When screen
is faded out, first interaction wakes up the shell from idle and screen
fades back in. However, this first interaction is applied to whatever
is "behind" faded screen and it may trigger unwanted actions (first
touch or mouse click on active GUI elements). Behavior is the same for
both idle and lock screen (because unlock dialog is created after the
first interaction).
Update fade animation curtain creation function to capture inputs in
order to prevent unwanted interactions within faded or locked shell.
Fixes issues #147 and #569.
Signed-off-by: Witold Lipieta <witold.lipieta@thaumatec.com>
Set the fullscreen_output to NULL when output gets destroyed. Otherwise,
a use-after-free case can happen, which result in a SEGFAULT crash.
Fixes#766
Signed-off-by: Paul Pu <hui.pu@gehealthcare.com>
The fullscreen should take precedence if the client requests both
window states at the same time.
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
And with it, bump libweston to next major version, 14. We seems like
we never used that argument so better just removed it.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
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>
Rather than checking if the surface has width 0, use our helper to see
if the surface has an attached buffer.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Don't look it up from the view every time, but instead just work
completely from global co-ordinates.
Signed-off-by: Daniel Stone <daniels@collabora.com>
We need to know which output we're on, and the surface type plus output
uniquely identifies us, so just pass that in.
Signed-off-by: Daniel Stone <daniels@collabora.com>
We only have one of those per output, and we need to dig them out later,
so just store a direct pointer to them.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Make background and panel surfaces do the right thing: map the surface
when it first gets content applied to it, and only move the view around
when required.
Signed-off-by: Daniel Stone <daniels@collabora.com>
We only want one background and/or panel per output. If another one
comes up, tell the client it's done something very bad, rather than
trying to gently negotiate our way out of the situation.
Signed-off-by: Daniel Stone <daniels@collabora.com>
If our background and/or panel surface already has a view, something
extraordinarily weird has gone on. Don't try to deal with it.
Signed-off-by: Daniel Stone <daniels@collabora.com>
And move it back to its place, as we can't differentiante between two
different states: coming back from unmaxized (which makes it so we send
out a widthXheight size matching that of maximized whereas we should send
out 0, 0) and that we're no longer fullscreen. We land basically in the
same spot in both cases, and trying one issue, creates a new one.
Moving the corner case in set_fullscreen makes it so we don't reach both
cases in the same time and avoid introducing other issues.
Fixes: #801
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Most of these don't use the parameter that changes at all, but some get
a nice simplification.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
There are many times when we want to set a global position with a surface
offset added.
It's a fairly nasty operation, and most places in the code currently do
it naively, ignoring the painful existence of freeform window rotations
and other complex transforms that could be in play (but probably aren't)
Add a helper for this and convert existing usage.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This is a trap - it's not harmful to let the animation complete - it is
harmful to call weston_shell_utils_curtain_destroy() in mid animation. It
results in immediately completing the animation, which attempts to destroy
the curtain a second time.
Fixes a crash when (on a multi-output system) the display is disconnected
during the fade out, then reconnected before the fade-in starts.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Instead of trying to cover the desktop with an arbitrarily larger
rectangle, actually calculate the appropriate size.
Fixes the old (but recently reintroduced) bug where the curtain isn't
always large enough.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>