If for some reason the helper client weston-desktop-shell would create
more than one panel surface for the same weston_output, this code would
corrupt the surface destroy listener list by adding a link already in
one list into another list.
Instead, do not store the new, redundant panel surface and do not
subscribe to its destruction. Also, tell the helper that the surface is
redundant by configuring it with a 0x0 size, so that we don't waste
memory on a panel that is never used.
(Clone mode is a valid reason why weston-desktop-shell could do that.)
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
If for some reason the helper client weston-desktop-shell would create
more than one background surface for the same weston_output, this code
would corrupt the surface destroy listener list by adding a link already
in one list into another list.
Instead, do not store the new, redundant background surface and do not
subscribe to its destruction. Also, tell the helper that the surface is
redundant by configuring it with a 0x0 size, so that we don't waste
memory on a background that is never used.
(Clone mode is a valid reason why weston-desktop-shell could do that.)
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Our case is when the view is the same as output being disabled/disconnected.
There's not need to check the views' output with the output being disabled
because weston_view_assign_output() already changes the output of the view when
the output has been disabled/disconnected hence the check is not needed at all.
The views' output will always be different than the output being disabled.
By the time shell_output_destroy_move_layer() gets called the views' output has
already changed to a "free" output. Tested this by unplugging/disabling the
output on purpose.
Signed-off-by: Marius Vlad <marius-cristian.vlad@nxp.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
There may be race condition between destroying surface and destroying
output. If handle_output_destroy() is called after surface is destroyed,
illegal memory access occurs when surface destroy signals is
unregistered from the panel/background. This patch fixes this issue and
removes unnecessary initialization for panel surface listener.
Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
When a client transitions from maximized to fullscreen to maximized (run
weston-terminal, maximize it, hit f11 twice) we're sending size 0,0 for
the unfullscreen configure, which still has maximized set.
This results in clients correctly picking any size they like, and weston
disconnecting them for it.
Instead, pass the correct maximized size.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
We need to calculate maximized size to resolve a bug with unsetting
fullscreen, might as well share the code.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Change weston_compositor_get_time to return the current compositor time
as a struct timespec. Also, use clock_gettime (with CLOCK_REALTIME) to
get the time, since it's equivalent to the currently used gettimeofday
call, but returns the data directly in a struct timespec.
This commit is part of a larger effort to transition the Weston codebase
to struct timespec.
Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Change code related to touch motion events to use struct timespec to
represent time.
This commit is part of a larger effort to transition the Weston codebase
to struct timespec.
Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Change code related to touch up events to use struct timespec to represent
time.
This commit is part of a larger effort to transition the Weston codebase
to struct timespec.
Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Change code related to touch down events to use struct timespec to
represent time.
This commit is part of a larger effort to transition the Weston codebase
to struct timespec.
Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Change code related to key events to use struct timespec to represent
time.
This commit is part of a larger effort to transition the Weston codebase
to struct timespec.
Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Change code related to axis events to use struct timespec to represent
time.
This commit is part of a larger effort to transition the Weston codebase
to struct timespec.
Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Change code related to button events to use struct timespec to represent
time.
This commit is part of a larger effort to transition the Weston codebase
to struct timespec.
Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Change code related to motion events to use struct timespec to represent
time.
This commit is part of a larger effort to transition the Weston codebase
to struct timespec.
Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Change code related to animations to use struct timespec to represent
time.
This commit is part of a larger effort to transition the Weston codebase
to struct timespec.
Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This bumps the libweston major version due to breakage in the animation
ABI. The commits following this one break more ABI in other parts.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This patch disables the opacity binding when the modifier is configured
to `none' in weston.ini, and thus supports use cases where one does not
want to have this binding.
Signed-off-by: Ian Ray <ian.ray@ge.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This patch changes the zoom binding to use the modifier configured in
weston.ini instead of hardcoding MODIFIER_SUPER.
Signed-off-by: Ian Ray <ian.ray@ge.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
xdg_shell requires this information to be shared with the client in
order to conform with the specification.
The code to forward this to the client by way of a configure() event
is already in place and works fine, it was just never being used until
now.
Signed-off-by: Philipp Kerling <pkerling@casix.org>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
The focused surface is used for determining whether shell surfaces
are activated. They should also be considered activated when a
subsurface has focus. Inserting a call to
weston_surface_get_main_surface fixes this.
seat->focused_surface is only used for shell_surface keyboard focus
tracking.
Signed-off-by: Philipp Kerling <pkerling@casix.org>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
This is a simple wrapper for casting the user data of a wl_resource into
a struct weston_output pointer. Using the wrapper clearly marks all the
places where a wl_output protocol object is used.
Replace ALL wl_output related calls to wl_resource_get_user_data() with
a call to weston_output_from_resource().
v2: add type assert in weston_output_from_resource().
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Armin Krezović <krezovic.armin@gmail.com>
Instead of creating a single global fade surface across all outputs,
create a separate surface for each output. This will permit
e.g. individual fades for each output (or blocking the fade-outs if
inhibiting idling as will come in a later patch.)
This also fixes a potential issue if on multihead layout spanning a
desktop wider than 8096 (or higher than 8096), the fade animation may
not completely cover all surfaces.
This assumes the output geometry doesn't change to become larger during
the course of the fade animation.
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
During a maximize event, a surface was previously always put back to
the primary output after one frame on the correct output, while keeping
its size. This was caused by the shell surface’s last_{width,height}
not being reset when it was either fullscreen or maximized, leading to
the unmaximize/maximize dance being done at each commit.
This was introduced in 8f9d90a84b.
Changes since v1:
- Fix the actual issue instead of a symptom.
Signed-off-by: Emmanuel Gil Peyrot <emmanuel.peyrot@collabora.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
GCC 7 now warns on case statements falling through without an explicit
comment that falling through is OK. Insert some to make it happy.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
Store the initial xwayland position explicitly in struct shell_surface.
New variables are needed, because e.g. saved_x, saved_y are the view
position, and to compute that we need the window geometry, which is not
available before the first commit, so it's not available at
set_xwayland_position() time.
Regression: kcachegrind (Qt 4, X11), the first menu invocation will
slightly misplace the menu if the window has not been manually moved.
Problem: geometry is not taken into account due to a race between XWM
drawing decorations and Xwayland committing the first buffer.
Use the same debugging guard as XWM.
v3: merged with "desktop-shell: debug set_position_from_xwayland"
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
This avoids loading a shell as a module, so we are sure to have only one
shell loaded at a time.
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Currently, layers’ order depends on the module loading order and it does
not survive runtime modifications (like shell locking/unlocking).
With this patch, modules can safely add their own layer at the expected
position in the stack, with runtime persistence.
v4 Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Acked-by: Daniel Stone <daniels@collabora.com>
[Pekka: fix three whitespace issues]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
The desktop-shell output destroy code assumes that we always set up a
panel listener. Initialise its list explicitly, so if we don't have a
panel, then we can still unconditionally destroy the listener on output
destroy.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Now weston actually supports putting the panel at the bottom of the
screen.
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
This only stores the current state, as libweston-desktop is still in
charge of double-buffering it.
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
When a client has registered idle inhibition on a surface, don't trigger
the fade-out animation on the output(s) the surface is displayed on.
But when the surface is destroyed or the inhibitor itself is destroyed
by client request, re-queue the fade out animation.
Instead of creating a single global fade surface across all outputs,
create a separate surface for each output. This will permit
e.g. individual fades for each output (or blocking the fade-outs if
inhibiting idling as will come in a latter patch.)
This also fixes a potential issue if on multihead layout spanning a
desktop wider than 8096 (or higher than 8096), the fade animation may
not completely cover all surfaces.
This assumes the output geometry doesn't change larger during the course
of the fade animation.
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
v5:
+ Use the new libweston-desktop API for dropping idle inhibitor to
ensure fade_out gets triggered if the client destroys the inhibitor
early.
+ Fix a crash when running multi-head due to double free of animations
+ Split idle inhibition implementation to a subsequent patch
Its usage is now limited to some dock-related helper, and the plugin
registry is a better fit for that kind of helper.
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Now we properly unregister from the panel/background surface destroy
signals if the output is destroyed first.
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Armin Krezović <krezovic.armin@gmail.com>
It doesn't destroy the view per se (except for internal surfaces) and
require the caller to also destroy the view itself at the appropriate
time.
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
All the shell protocol details, Xwayland glue and popups (and their
grab) are now handled in libweston-desktop.
Fullscreen methods (for wl_shell) are removed for now.
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Acked-by: Giulio Camuffo <giulio.camuffo@kdab.com>
Differential Revision: https://phabricator.freedesktop.org/D1209
Adds a weston_view_activate() that can be passed an additional active
flag WESTON_ACTIVATE_CLICKED, that the shell passes when a view was
activated by clicking.
This allows shell-independent components implement heuristics depending
on how a view was activated.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Although it currently only has one available flag, but that'll change.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
In preparation for further refactoring.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Signed-off-by: Arnaud Vrac <avrac@freebox.fr>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Activate a view even though it effectively may already be active.
Without this, in later patches, it won't be possibe to track what view
was activated by clicking last, as a view which surface already had
keyboard focus, won't be activated.
To keep avoiding sending xdg_surface.configure events, only change the
keyboard focus if the focus actually changed.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>