[RFC weston 0/6] libweston-desktop, first try

Quentin Glidic sardemff7+wayland at sardemff7.net
Sun Jul 17 08:59:17 UTC 2016


From: Quentin Glidic <sardemff7+git at sardemff7.net>

Hi,

Here is my first RFC series for libweston-desktop.

The code style does not match weston’s, it lacks documentation and
there are still segfaults here and there, but it works.
A little regression: surfaces are not activated when created, I am
not sure why… I think the rest works as before.

The main goal of libweston-desktop is to abstract shell protocols
details from the actual window management. Therefore, it should
handle all the things that the spec describes and hide some of
them from the compositor, like popup positioning.
In other words, only toplevel surfaces are exposed to the
compositor, and their state is also taken care of internally, so
the compositor only has to provide a few event handlers and use
a few getters to manage these surfaces.

My goals by introducing this library are:
  - to pool (wow, wasn’t aware of this translation) efforts for
    libweston-based compositors, so it is easier to create one
  - to ease the implementation of future xdg_shell versions
    (as a PoC, v6 is now supported)

Versionning should follow libweston, and it should basically be
considered as a part of it (so both will “break ABI” at the same
time). Actually, it could be for real, but I started it in my
compositor project so all files were split already.

The second commit is a bonus, and was not in my original code.
With libweston-desktop in Weston tree, we can hide (and thus break
at will) the XWayland interface.

The desktop-shell commits are split to ease understanding what’s
going on, as the complete patch is just a mess. I tried to modify
the minimum, and we could do more cleanup as follow-ups.

The last commit requires the wip branch of wayland-protocols *with*
the pending patches.
xdg_positioner is not implemented yet and currently use the position
as fixed.

I hope it will get accepted in Weston, as the second commit
(and potential future similar commits) are, IMO, a great bonus to
have.
I will maintain it in my compositor as an unstable internal library
if you feel like it does not belong to Weston.
Or as a split project if some of you want to help out (in weston-wall
probably).

I think that’s all. Thanks for reading, and please enjoy this series.

Cheers,


Quentin Glidic (6):
  Introduce libweston-desktop
  xwayland: Introduce a private struct for XWayland interface
  desktop-shell: Rough port to libweston-desktop
  desktop-shell: Remove xdg_shell and wl_shell protocol bits
  desktop-shell: Remove stuff handled by libweston-desktop
  libweston-desktop: Implement xdg_shell_v6

 Makefile.am                               |   33 +-
 configure.ac                              |    1 +
 desktop-shell/shell.c                     | 2562 ++++-------------------------
 desktop-shell/shell.h                     |    4 +-
 libweston-desktop/client.c                |  139 ++
 libweston-desktop/internal.h              |  109 ++
 libweston-desktop/libweston-desktop.c     |  201 +++
 libweston-desktop/libweston-desktop.h     |  111 ++
 libweston-desktop/libweston-desktop.pc.in |   12 +
 libweston-desktop/seat.c                  |  328 ++++
 libweston-desktop/surface.c               |  525 ++++++
 libweston-desktop/wl-shell.c              |  318 ++++
 libweston-desktop/xdg-shell-v5.c          |  641 ++++++++
 libweston-desktop/xdg-shell-v6.c          |  884 ++++++++++
 libweston-desktop/xwayland.c              |  290 ++++
 libweston/compositor.h                    |   34 +-
 shared/helpers.h                          |   11 +
 xwayland/window-manager.c                 |   83 +-
 xwayland/xwayland-internal-interface.h    |   64 +
 19 files changed, 4048 insertions(+), 2302 deletions(-)
 create mode 100644 libweston-desktop/client.c
 create mode 100644 libweston-desktop/internal.h
 create mode 100644 libweston-desktop/libweston-desktop.c
 create mode 100644 libweston-desktop/libweston-desktop.h
 create mode 100644 libweston-desktop/libweston-desktop.pc.in
 create mode 100644 libweston-desktop/seat.c
 create mode 100644 libweston-desktop/surface.c
 create mode 100644 libweston-desktop/wl-shell.c
 create mode 100644 libweston-desktop/xdg-shell-v5.c
 create mode 100644 libweston-desktop/xdg-shell-v6.c
 create mode 100644 libweston-desktop/xwayland.c
 create mode 100644 xwayland/xwayland-internal-interface.h

-- 
2.9.0



More information about the wayland-devel mailing list