With QtQuick2 KWin is no longer the only one having an OpenGL context
thus we need to ensure that our context is current. If not it results in
highly interesting crashes when our code is executed on the QtQuick
context.
The context is made current before we swap and before we start to render
a frame. During rendering a frame it's not made current again based on
the assumption that while we render there is no interference. If this
assumption doesn't hold, we need a more sophisticated solution at the
moment it seems to fix the crashes.
Nicely integrates Qt's event loop with the Wayland event handling.
We still need to dispatch pending events before calling eglSwapBuffers as
that call might block.
Tracking cursor changes in X11. Whenever the cursor image changes, the
image is read and a wl_buffer is created with the content of the X11
cursor. This buffer is attached to a surface used as a cursor image.
As a memory pool for the cursor buffers a temporary file is created and
mmapped.
All created cursors are cached but not yet removed from the cache. Some
cleanup code would be useful also to ensure that our shared memory pool
doesn't overflow.
Rudimentary support for input events. Events from Wayland are forwarded
to X's root window using the XTest extension.
Currently supported:
* left/middle/right mouse button
* keyboard events
Not supported:
* additional mouse buttons
* mouse wheel
* touch events
Obviously this is a rather huge hack and is only intended till we have
XWayland support and proper input redirection inside KWin.
This backend is able to composite on a Wayland surface instead of an X11
overlay window. It can be considered as a prototype for a Wayland session
compositor.
For texture from X11 pixmap the backend uses XShm. This is far from
optimal, but the KHR_image_pixmap extension is not available in Mesa's
Wayland backend. It's a temporary solution till we have XWayland and
texture from Wayland buffer.
To use this backend one needs to specify the environment variable
KWIN_OPENGL_INTERFACE with "egl_wayland". In future KWin should probably
use this backend if the Wayland display env variable is defined.
To use this setup:
1. Have a normal X-Server running on e.g. VT7
2. Start Weston on VT1
3. Start a terminal on Weston
4. start KWin with:
DISPLAY=:0 KWIN_OPENGL_INTERFACE=egl_wayland kwin --replace &
This should map a Wayland surface to Weston showing the content of the X
setup. At the moment it's not yet possible to interact with the surface
as input events are not yet recieved in the backend.
There are still a lot of limitations as documented in the code.