Commit Graph

334 Commits

Author SHA1 Message Date
Sergey Bugaev
14ef201295 desktop-shell: don't crash if a surface disappears while grabbed
A surface can get destroyed while a shell grab is active, which can
for example happen if the command running in weston-terminal exits.

When a surface gets destroyed, grab->shsurf is reset to NULL by
destroy_shell_grab_shsurf(), but otherwise the grab remains active and
its callbacks continue to be called. Thus, dereferencing grab->shsurf
in a callback without checking it for NULL first can lead to undefined
behavior, including crashes.

Several functions were already properly checking grab->shsurf for NULL,
move_grab_motion() being one example. Others, however, were not, which
is what this commit fixes.

Related to https://gitlab.freedesktop.org/wayland/weston/issues/192

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2019-02-16 09:45:52 +00:00
Greg V
15d3d3004b desktop-shell: remove surface destroy listener when focus state is destroyed
Changing the focused surface did remove the surface_destroy_listener from the wl_signal list,
but destroying the focus state did not. As a result, sometimes the same listener would be added
to two surfaces, which would join their wl_signal lists together, which would cause infinite
loops and use-after-frees when closing desktop surfaces.
2019-02-16 09:45:52 +00:00
Greg V
ec3f779aa7 desktop-shell: fix resize grab related crash
This crash was happening when *releasing* a pointer button on a window
that was being resized and got destroyed during the grab.

[@daniels: Cosmetic fixes; apply same fix to grab cancel.]
2019-02-16 09:45:36 +00:00
Pekka Paalanen
052032d730 desktop-shell: use weston_compositor_exit
Use the proper weston_compositor_exit API instead of wl_display_terminate() to
allow the compositor main to prepare for exit, and most importantly to set the
exit error code as appropriate.

I have some brokenness in my test suite running, and weston-desktop-shell was
crashing at start, yet the tests did not notice. With this patch, the tests
where the helper crashes are properly marked as failed.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-02-06 10:58:22 +00:00
Greg V
f57774e112 desktop-shell: extract view_get_transform, make it reliable
Avoid crashes related to get_shell_surface returning NULL.

Surfaces are already allowed to be neither focus nor shell in
e.g. focus_state_surface_destroy.
2019-01-31 01:47:27 +00:00
Marius Vlad
64fbd0f41f compositor: Add some handy wrappers for wet_get_binary_path()
This allows to possibility to specify where to look for the executable
but also simplifies the need of having to pass either BINDIR/LIBEXECDIR
for retrieving full-path of the executable.

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
2018-12-18 15:37:34 +02:00
Daniel Stone
8011b0fa03 Add Meson build system
Meson is a build system, currently implemented in Python, with multiple
output backends, including Ninja and Make. The build file syntax is
clean and easy to read unlike autotools. In practise, configuring and
building with Meson and Ninja has been observed to be much faster than
with autotools. Also cross-building support is excellent.

More information at http://mesonbuild.com

Since moving to Meson requires some changes from users in any case, we
took this opportunity to revamp build options. Most of the build options
still exist, some have changed names or more, and a few have been
dropped. The option to choose the Cairo flavour is not implemented since
for the longest time the Cairo image backend has been the only
recommended one.

This Meson build should be fully functional and it installs everything
an all-enabled autotools build does. Installed pkg-config files have
some minor differences that should be insignificant. Building of some
developer documentation that was never installed with autotools is
missing.

It is expected that the autotools build system will be removed soon
after the next Weston release.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Co-authored-by: Pekka Paalanen <pq@iki.fi>
Signed-off-by: Pekka Paalanen <pq@iki.fi>
2018-12-09 14:50:54 +02:00
Harsha M M
b8b2c72709 libweston: Remove signals from the list during de-init
During de-init ensure removal of added signals from list. Otherwise
a dongling pointer is left behind which will affect other plugins.

Signed-off-by: Harsha M M <harsha.manjulamallikarjun@in.bosch.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2018-08-08 12:22:24 +03:00
Daniel Stone
11f91bbd36 helpers: Move static_assert definition to shared
Collect the fallback definitions of static_assert() from desktop-shell
and the test shell, and move them to helpers.h. This allows code
throughout the tree to use static_assert() for build-time assertions,
where it is supported by the compiler.

As GCC goes out of its way to only add static_assert() when C11 has been
explicitly requested - which we don't do - make sure to use the more
widely available _Static_assert() if that is provided.

This will be used in future patches to ensure two array lengths don't go
out of sync.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2018-07-09 15:39:20 +01:00
Daniel Stone
e03c111e4e tests: Don't rely on build directory layout
Rather than having a hardcoded dependency on the build-directory layout,
use an explicit module-map environment variable, which rewrites requests
for modules and helper/libexec binaries to specific paths.

Pekka: This will help with migration to Meson where setting up the paths
according to autotools would be painful and unnecessary.

Emre: This should also help setting up the test suite after a
cross-compile.

Pekka: A caveat here is that this patch makes it slightly easier to load
external backends by abusing the module map. External backends are
specifically not supported in libweston.

Signed-off-by: Daniel Stone <daniels@collabora.com>

v2:

Fixed ivi_layout-test-plugin.c:wet_module_init().
Do not change the lookup name of ivi-layout.ivi.

Improved documentation of weston_module_path_from_env() and made it cope
with map strings that a) do not end with a semicolon, and b) have
multiple consecutive semicolons.

Let WESTON_MODULE_MAP be printed into the test log so that it is easier
to run tests manually.

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Emre Ucan <eucan@de.adit-jv.com>

Suggested by Emil: Use a variable for strlen(name).

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2018-06-20 14:36:52 +03:00
Pekka Paalanen
c63acc4cb8 desktop-shell: survive NULL output in shell_configure_fullscreen()
Running 'weston-simple-egl -f -b' (fullscreen, unthrottled) caused a
crash in shell_ensure_fullscreen_black_view() due to
shsurf->fullscreen_output being NULL. Also shell_configure_fullscreen()
could crash on that condition.

Fix shell_configure_fullscreen() to bail out with minimal work if there
is no fullscreen_output.

It is unclear if anything will cause a reconfiguration when an output is
plugged in.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
Reviewed-by: Ian Ray <ian.ray@ge.com>
2018-05-24 17:20:04 +03:00
Pekka Paalanen
87860c20ee desktop-shell: do not lower_fullscreen_layer(s, NULL)
In activate, do not call lower_fullscreen_layer() at all if the output
is NULL. It should not do anything in that case, per the existing
comment.

This is a tentative crash fix for a case where there are no enabled
weston_outputs at all.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
Reviewed-by: Ian Ray <ian.ray@ge.com>
2018-05-24 17:20:04 +03:00
Pekka Paalanen
30aa59759a desktop-shell: handle NULL output in center_on_output()
This is a tentative crash fix for a case where there are no enabled
weston_outputs at all.

If no output is given, just put the surface at 0,0. At least it should
become mostly visible if an output is plugged in, if not centered.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
Reviewed-by: Ian Ray <ian.ray@ge.com>
2018-05-24 17:20:04 +03:00
Pekka Paalanen
99372bab4c desktop-shell: handle NULL output in get_output_work_area()
This is a tentative crash fix for a case where there are no
enabled weston_outputs at all.

Let get_output_work_area() return a zero area if the given output is
NULL. If there is no output, there is no area. Unfortunately we cannot
return "no position" but have to use 0,0 instead.

In send_configure_for_surface(), this causes a maximized surface to
receive width=0 and height=0 in the configure event, which means the
client is free to choose the size. There is no correct size to send for
maximizing for no output.

In constrain_position(), this has no effect. The interactive move of a
surface is restricted to not go below the panel, so even if a user
managed to move a surface without an output, it just prevents the
surface moving beyond y=0.

In weston_view_set_initial_position(), get_output_work_area() will not
be called with NULL output anyway.

In set_maximized_position(), this makes it behave as if the output was
at 0,0 which is the default position of the first output.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
Reviewed-by: Ian Ray <ian.ray@ge.com>
2018-05-24 17:20:04 +03:00
Pekka Paalanen
99628000cb desktop-shell: fix output destroy signal list corruption
This issue was introduced by "desktop-shell: detect stale shell surface
outputs" which forgot to remove the output destroy listener when
shell_surface is destroyed, leading to memory corruption.

This was fairly easy to trigger by opening and closing an application
window a few times.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Ian Ray <ian.ray@ge.com>
2018-05-22 12:48:35 +03:00
Semi Malinen
99f8c08559 desktop-shell: detect stale shell surface outputs
When displays are hot (un)plugged, it may happen that
a shell surface is left with a stale pointer to an output
that has already been freed. Add an output destroy listener
to catch such situations and set the output pointer to NULL.

Signed-off-by: Semi Malinen <semi.malinen@ge.com>
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2018-05-21 16:51:05 +03:00
Semi Malinen
e7a52fbb7d libweston: add weston_view_set_output()
Instead of desktop shell assigning view outputs directly,
use a new method, weston_view_set_output(). The method can
set up an output destroy listener to make sure that views
do not have stale output pointers.

Without this patch it is possible to end up in a scenario
where, e.g. configure_static_view() accesses memory that
has already been freed. The scenario can be provoked by
repeatedly plugging and unplugging a display. The faulty
memory accesses are reported by valgrind.

Signed-off-by: Semi Malinen <semi.malinen@ge.com>
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2018-05-18 13:50:21 +03:00
Pekka Paalanen
055c1137ae libweston: make wl_output point to weston_head
The user data of a wl_resource representing a wl_output protocol object
used to be a pointer to weston_output. Now that weston_output is being
split, wl_output more accurately refers to weston_head which is a single
monitor.

Change the wl_output user data to point to weston_head.
weston_output_from_resource() is replaced with
weston_head_from_resource().

This change is not strictly necessary, but architecturally it is the
right thing to do. In the future there might appear the need to refer to
a specific head of a cloned pair, for instance.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
v5 Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Ian Ray <ian.ray@ge.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
2018-04-10 14:33:59 +03:00
Pekka Paalanen
9350bfd916 desktop-shell: fix shell_output_destroy_move_layer unused variable
/home/pq/git/weston/desktop-shell/shell.c: In function ‘shell_output_destroy_move_layer’:
/home/pq/git/weston/desktop-shell/shell.c:4718:24: warning: unused variable ‘output’ [-Wunused-variable]
  struct weston_output *output = data;

Since the data pointer is not used for anything, decided to also set it
to NULL in the caller. This caused another variable to become unused.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Marius-Vlad <marius-cristian.vlad@nxp.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2018-02-14 10:03:36 +02:00
Pekka Paalanen
1a0239e40f desktop-shell: handle redundant panels
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>
2018-02-12 13:14:39 +02:00
Pekka Paalanen
ff5e88d276 desktop-shell: handle redundant backgrounds
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>
2018-02-12 13:14:39 +02:00
Marius Vlad
ea40d6dbfc desktop-shell: Correctly migrate views to other outputs when output is disabled/disconnected
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>
2018-02-09 15:45:46 +00:00
Tomohito Esaki
bf31f6cfb9 desktop-shell: remove surface listener when surface is destroyed
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>
2018-01-31 09:44:00 +02:00
Derek Foreman
e1af3d8d9d desktop-shell: Handle the fullscreen to maximized case safely
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>
2017-12-04 21:58:15 +00:00
Derek Foreman
927d9e23fa desktop-shell: refactor maximized size calculation into its own function
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>
2017-12-04 21:58:08 +00:00
Alexandros Frantzis
409b01fd6d libweston: Use struct timespec for compositor time
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>
2017-11-27 11:42:07 +02:00
Alexandros Frantzis
7d2abcf6c8 libweston: Use struct timespec for touch motion events
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>
2017-11-27 11:42:07 +02:00
Alexandros Frantzis
27a51b83e5 libweston: Use struct timespec for touch up events
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>
2017-11-27 11:42:07 +02:00
Alexandros Frantzis
9448deb073 libweston: Use struct timespec for touch down events
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>
2017-11-27 11:42:07 +02:00
Alexandros Frantzis
47e79c860b libweston: Use struct timespec for key events
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>
2017-11-27 11:42:07 +02:00
Alexandros Frantzis
80321942e7 libweston: Use struct timespec for axis events
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>
2017-11-27 11:42:07 +02:00
Alexandros Frantzis
215bedc88b libweston: Use struct timespec for button events
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>
2017-11-27 11:42:07 +02:00
Alexandros Frantzis
84b31f8956 libweston: Use struct timespec for motion events
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>
2017-11-27 11:42:07 +02:00
Alexandros Frantzis
8250a61de1 build,libweston: Use struct timespec for animations
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>
2017-11-27 11:41:17 +02:00
Ian Ray
13404c4016 desktop-shell: disable opacity binding when modifier is none
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>
2017-09-18 16:17:08 +03:00
Ian Ray
ab7c0b6afd desktop-shell: use binding_modifier for zoom
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>
2017-09-18 16:17:08 +03:00
Philipp Kerling
c5f1241695
desktop-shell: Set surface resizing state during interactive resize
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>
2017-07-28 14:46:10 +02:00
Philipp Kerling
ba8a0d041e
desktop-shell: Track focused shell surface by main surface
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>
2017-07-26 12:50:05 +02:00
Pekka Paalanen
9ffb25009c libweston: introduce weston_output_from_resource()
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>
2017-07-25 16:08:48 +03:00
Bryce Harrington
9ad4de1f7a
desktop-shell: Enable per-output fade animations
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>
2017-04-21 10:24:17 +02:00
Emmanuel Gil Peyrot
c394179488
desktop-shell: Position maximized surfaces on the correct output.
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>
2017-04-06 15:26:09 +02:00
Daniel Stone
2ef9b1a3c4 Fix 'implicit fallthrough' warning with new GCC
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>
2017-03-13 17:56:07 +00:00
Pekka Paalanen
77a6d95a0f shell: implement set_xwayland_position
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>
2017-01-18 13:21:02 +02:00
Quentin Glidic
da01c1d105
weston: Make the shell entrypoint specific
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>
2017-01-17 18:24:58 +01:00
Quentin Glidic
8af2beccbd
weston: Properly namespace modules entrypoint
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-01-17 18:24:56 +01:00
Quentin Glidic
82681571cf libweston: Position layers in an absolute way
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>
2017-01-17 16:50:18 +02:00
Daniel Stone
8de91494b3 desktop-shell: Initialise panel surface listener
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>
2017-01-16 15:13:39 +00:00
Abdur Rehman
7f1da1f524 desktop-shell: fix a typo
Signed-off-by: Abdur Rehman <arehmanq199@gmail.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
2017-01-03 11:58:49 +00:00
Quentin Glidic
e8bf959764 desktop-shell: Properly position the panel surface
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>
2016-11-21 18:17:49 +00:00
Quentin Glidic
581df06ad1 desktop-shell: Compute panel size without using output
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-11-21 18:17:46 +00:00