Commit Graph

23 Commits (92c9c514b8bb0cf6c324a6554131f43933c64856)

Author SHA1 Message Date
Martin Gräßlin f4597a3552 [kwin] Drop unused includes to KDebug 2014-02-03 11:36:46 +01:00
Martin Gräßlin 5b07d4c2a1 Merge branch 'KDE/4.11'
Conflicts:
	kwin/egl_wayland_backend.cpp
	kwin/eglonxbackend.cpp
	kwin/glxbackend.cpp
	kwin/scene_opengl.cpp
	plasma/generic/wallpapers/color/plasma-wallpaper-color.desktop
	plasma/generic/wallpapers/image/plasma-wallpaper-image.desktop
2014-01-28 08:18:41 +01:00
James Jones 6acef12932 Don't call into GL without a context
After losing current from the EGL or GLX
context, calls to the GL or GLES functions
have undefined behavior.  Perform all
cleanup that may touch OpenGL and check for
GL errors before losing current from the
context.

REVIEW: 115311
2014-01-28 07:54:32 +01:00
Martin Gräßlin b28effff23 A Scene doesn't need to use an X11 Overlay Window
Only the X based Scenes need an overlay window, so the Compositor doesn't
need to check for it in the Wayland case.

OverlayWindow is moved from OpenGLBackend to the sub classes which need
to provide it.
2014-01-08 09:22:40 +01:00
Martin Gräßlin c9779825d1 Support frame callback in Wayland backend
The egl wayland backend registers for the callback for a rendered frame.
This allows to throttle KWin's compositor so that we don't render frames
which wouldn't end up on the screen.

For this the Scene provides a method to query whether the last frame got
rendered. By default this returns true in all backends. The Egl Wayland
backend returns true or false depending on whether the callback for the
last frame was recieved.

In case the last frame has not been renderd when performCompositing is
tried to be called, the method returns just like in the case when the
overlay window is not visible. Once the frame callback has been recieved
performCompositing is invoked again.
2014-01-08 09:22:40 +01:00
Martin Gräßlin f4ee319c6a Move XShm helper class to xcbutils
That way it can be used also in other parts of KWin.
2014-01-08 09:22:40 +01:00
Martin Gräßlin 0f09f00210 WaylandBackend becomes a KWin Singleton
The backend gets created by Workspace, but only if the environment
variable WAYLAND_DISPLAY is set.

Because of that the egl wayland backend does no longer create the
backend, but uses the already created one.
2014-01-08 09:22:40 +01:00
Martin Gräßlin baf477ac00 Split out non-EGL functionality of WaylandBackend into own source files
The functionality to create the connection to a Wayland compositor and
creating a fullscreen surface is moved into wayland_backend.(h|cpp). The
wl_egl_window for the surface is moved into the EglWaylandBackend to have
the actual WaylandBackend free from Egl. This will allow in future to
implement other compositing backends for Wayland which do not use egl.
This means that egl is no longer a build requirement for the wayland
related functionality.
2014-01-08 09:22:40 +01:00
Martin Gräßlin f1a9dc4d25 [kwin] Re-enable the optional and experimental Wayland support
* Find Wayland was missing in CMakeLists.txt
* Wayland Backend is adjusted for new virtual methods (makeCurrent, doneCurrent)
* Buffer Age is implemented
2014-01-07 11:57:29 +01:00
Fredrik Höglund c25b2939b1 kwin: Prepare the backend interface for EXT_buffer_age
Allow prepareRenderingFrame() to return a region that will be
repainted in addition to the damaged region.

Pass both the damaged region and the repainted region, which
may be larger, as parameters to endRenderingFrame().
2013-12-12 01:36:45 +01:00
Martin Gräßlin c2aacca735 Ensure that our compositing context is current when starting to render
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.
2013-09-26 11:13:40 +02:00
Anselmo L. S. Melo d258759ac9 Port from KTemporaryFile to QTemporaryFile
REVIEW: 112742
2013-09-24 08:07:41 -03:00
Martin Gräßlin 57905c0cc2 And we got rid of KDebug
Usages of kBacktrace got dropped.
2013-09-02 13:14:39 +02:00
Martin Gräßlin cc66b75609 Fix unitialized variable 2013-06-24 12:42:12 +02:00
Martin Gräßlin 1664a143ab Mark Wayland backend as an experimental backend
Users might try it and play with it, but we don't want any bug reports.

REVIEW: 110689
BUG: 319996
FIXED-IN: 4.11
2013-06-05 13:46:31 +02:00
Martin Gräßlin 9d3404b090 Map the Wayland compositing surface as fullscreen
Now it's just like X11, isn't it ;-)
2013-06-05 13:46:01 +02:00
Martin Gräßlin 448f16220c Use a QSocketNotifier to wait for Wayland events
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.
2013-06-05 13:46:01 +02:00
Martin Gräßlin 01fa261537 Install cursor again after a ping event
Weston switches to the waiting cursor and does not reset, so we need to
ensure that the correct cursor is used once we sent the pong.
2013-06-05 13:46:01 +02:00
Martin Gräßlin 40cb4f5cd6 Map cursors from X11 to Wayland
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.
2013-06-05 13:46:01 +02:00
Martin Gräßlin cef62541ce Support mouse wheel events
Emitting button/press release events on buttons 4 to 7 to emulate the
vertical and horizontal scrolling.
2013-06-05 13:46:00 +02:00
Martin Gräßlin 5d3aa8e7cf Mark Wayland surface as opaque 2013-06-05 13:46:00 +02:00
Martin Gräßlin b6990078ec Add support for Wayland seat: keyboard and pointer
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.
2013-06-05 13:46:00 +02:00
Martin Gräßlin bab5f16d3c Egl Backend using a Wayland surface for rendering
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.
2013-06-05 13:45:45 +02:00