Commit graph

20 commits

Author SHA1 Message Date
Sjoerd Simons be8a6d3cfb xdg-shell: validate positioner object
According to the xdg-shell v6 protocol a positioner object is only
complete if both the size and its anchor rectangle are set. Ensure the
weston clients do this and let weston be more strict on checking if a
client has done so.

This also fixes weston-terminal popups not showing up on gnome-shell
3.22.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
2016-11-16 10:31:11 +08:00
Giulio Camuffo 2dae4d0110
libweston-desktop: destroy wl_shell_surface after the wl_surface is destroyed
The wl_shell_surface spec says that it is destroyed automatically by the
server when the wl_surface is destroyed, and indeed it does not have a
destroy request. So, do that.

Signed-off-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2016-10-14 10:52:36 +02:00
Giulio Camuffo 72f68c53ea
libweston-desktop: fix sending the configure event with wl_shell
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2016-10-01 11:17:17 +02:00
Armin Krezović 4e2fa0abc3
libweston-desktop: Fix some clang warnings
Fixes:

implicit conversion from enumeration type '...' to different
enumeration type '...' [-Wenum-conversion]

Signed-off-by: Armin Krezović <krezovic.armin@gmail.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2016-09-24 12:16:18 +02:00
Quentin Glidic a56b053ee1
libweston-desktop: Fix configure event for already well-sized surfaces
Even if the surface size is already correct, we need to store the
configured size in case some other state change triggers a configure
event.

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Arnaud Vrac <avrac@freebox.fr>
2016-09-14 10:07:43 +02:00
Quentin Glidic 0abf8903cb
libweston-desktop/xdg_shell_v6: Raise errors on not-yet-possible requests
These requests need a mapped surface, which can only happen after the
initial configure event.

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2016-09-12 16:51:13 +02:00
Quentin Glidic 3d7e60798a
libweston-desktop/xdg_shell_v6: Add surface as needed
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2016-09-12 16:46:49 +02:00
Quentin Glidic 6967f0e2d2
libweston-desktop/xdg_shell_v5: Add surface as needed
This way we are sure the compositor is aware of a surface when we
forward a request for said surface.

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2016-09-07 12:22:36 +02:00
Quentin Glidic 1714f01e0c
libweston-desktop/xwayland: Do not over-destroy the view
With this weston_view_destroy() call, Xwayland popups make Weston freeze
in a busy-loop (probably corrupted wl_list).

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-09-01 01:26:07 +02:00
Bryce Harrington 097193369c Revert "libweston-desktop: Add listener and API to drop the idle inhibitor"
This reverts commit e7069bcf93.

(Accidental landing)
2016-08-30 12:04:37 -07:00
Bryce Harrington e7069bcf93 libweston-desktop: Add listener and API to drop the idle inhibitor
Listen for the drop_idle_inhibitor signal from libweston, and propagate
the call to a corresponding libweston-desktop API.
2016-08-29 18:36:13 -07:00
Quentin Glidic 6384edf025
libweston-desktop/{wl_shell, xwayland}: Fix changing between toplevel states
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Tested-by: Emmanuel Gil Peyrot <emmanuel.peyrot@collabora.com>
2016-08-16 11:57:21 +02:00
Quentin Glidic f6636a8dec
libweston-desktop/xwayland: Actually destroy the view
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2016-08-16 11:10:41 +02:00
Quentin Glidic f01ecee75a
libweston-desktop: Rename _destroy_view to _unlink_view
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>
2016-08-16 11:10:27 +02:00
Quentin Glidic 003da8863b libweston-desktop: Drop (wrongly named) new_buffer in committed
Instead we store the buffer move and just use it when the signal is
fired.

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2016-08-15 20:07:28 +08:00
Quentin Glidic cba26e7b65 libweston-desktop/xdg_shell_v6: Check for buffer directly in committed
This is what we are interested in for real, and new_buffer is wrongly
named.

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2016-08-15 20:07:28 +08:00
Quentin Glidic 9c5dd7ef70 libweston-desktop: Implement xdg_shell_v6
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/D1210
2016-08-15 17:46:15 +08:00
Quentin Glidic e42541ac79 libweston-desktop: Fix libweston-desktop.pc
Also remove ${pkgincludedir} to be on par with libweston.pc.

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-08-15 11:46:46 +03:00
Quentin Glidic 955cec06c7
xwayland: Introduce a private struct for XWayland interface
libweston-desktop implements this private struct.

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/D1208
2016-08-14 09:29:08 +02:00
Quentin Glidic 248dd10965
Introduce libweston-desktop
libweston-desktop is an abstraction library for compositors wanting to
support desktop-like shells.

The API is designed from xdg_shell features, as it will eventually be
the recommended shell for modern applications to use.
In the future, adding new shell protocols support will be easier, as
limited to libweston-desktop.

The library versioning is the same as libweston. If one of them break
ABI compatibility, the other will too.

The compositor will only ever see toplevel surfaces (“windows”), with
all the other being internal implementation details.
Thus, popups and associated grabs are handled entirely in
libweston-desktop.
Xwayland special surfaces (override-redirect) are special-cased to a
dedicated layer, as the compositor should not know about them.

All the shell error checking is taken care of too, as well as some
specification rules (e.g. sizes constraint for maximized and fullscreen
surfaces).

All the compositor has to do is define a few callbacks in the interface
struct, and manage toplevel surfaces.

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/D1207
2016-08-14 09:29:00 +02:00