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.
Supported Features:
* move/resize
* active/inactive
* special window type
* window decoration as missing in AnimationEffect
The animations are cancelled when they go into an invisible state (e.g.
desktop changed, minimized) and are set again when the window becomes
visible.
Where a transition is useful, the window gets animated, e.g. start/finish
of move resize.
BUG: 294856
FIXED-IN: 4.11
REVIEW: 110747
Just like Opacity for transforming only the decoration opacity.
It's an ABI break as the new enum value had to be included as anonther
non-float base value.
Cross fading with previous pixmap is achieved by referencing the old
window pixmap. WindowPaintData has a cross-fade-factor which interpolates
between 0.0 (completely old pixmap) to 1.0 (completely new pixmap).
If a cross fading factor is set and a previous pixmap is valid this one
is rendered on top of the current pixmap with opacity adjusted. This
results in a smoother fading.
To simplify the setup the AnimationEffect is extended and also takes care
about correctly (un)referencing the previous window pixmap. The maximize
effect is adjusted to make use of this new capabilities.
Unfortunately this setup has a huge problem with the case that the window
decoration gets smaller (e.g. from normal to maximized state). In this
situation it can happen that the old window is rendered with parts outside
the content resulting in video garbage being shown. To prevent this a set
of new WindowQuads is generated with normalized texture coordinates in
the safe area which contains real content.
For OpenGL2Window a PreviousContentLeaf is added which is only set up in
case the crass fading factor is set.
REVIEW: 110578
The behavior for creating a pixmap for a window is moved from Toplevel
into a dedicated class WindowPixmap. Scene::Window holds a reference to
this class and creates a new WindowPixmap whenever the pixmap needs to be
discarded. In addition it also keeps the old WindowPixmap around for the
case that creating the new pixmap fails. The compositor can in that case
use the previous pixmap which reduces possible flickering. Also this
referencing can be used to improve transition effects like the maximize
windows effect which would benefit from starting with the old pixmap.
For XRender and OpenGL a dedicated sub-class of the WindowPixmap is
created which provides the additional mapping to an XRender picture and
OpenGL texture respectively.
BUG: 319563
FIXED-IN: 4.11
REVIEW: 110577
This avoids the overhead of allocating each WindowQuad on the heap
when appending items to the list, and also ensures that the quads
are continuous in memory.
This reduces the size of the geometry that needs to be uploaded by
one-third, and allows kwin to take advantage of the post-transform
cache in the GPU.
Expose bindArrays(), unbindArrays() and add a draw() method that takes
an offset and a count. This makes it possible to upload geometry, call
bindArrays(), and then call draw() multiple times to draw different
subsets of the uploaded geometry.
Reimplement performPaint() in SceneOpenGL1Window and SceneOpenGL2Window.
The roles between begin/endRenderWindow() and performPaint() are now
reversed; performPaint() contains the specialized code while begin/
endRenderWindow() contains the shared code.
This reduces the state churn in the OpenGL2 backend from the repeated
calls to prepare/restoreStates().
This fixes artifacts from over-sampling along the edges of the
decorations when effects such a wobbly windows are active.
The textures are only cleared when framebuffer objects are supported.
All drivers support FBO's now, so in practice this shouldn't be
a problem.
Split WindowQuadDecoration into WindowQuadDecorationLeftRight
and WindowQuadDecorationTopBottom.
This simplifies the code in SceneOpenGL::Window::paintDecoration().
Use two textures per window instead of four, storing the left and
right borders in the first texture, and the top and bottom borders
in the second.
This makes it possible to render the whole decoration with only two
calls to glDrawArrays(). It also reduces the number of texture
allocations while resizing a window.
Add virtual resizePixmaps() and updatePixmaps() methods that resizes and
updates all the pixmaps. Make resize() and paint() regular virtuals
with stub implementations.
The new methods will be used by OpenGLPaintRedirector in the next commit.
This effect is controlled by KScreen. It fades out all windows when
KScreen requests this and gives feedback to KScreen once all windows are
faded out. This allows KScreen to adjust the screens in a flicker free
way.
REVIEW: 110661
BUG: 319994
FIXED-IN: 4.11
Do not schedule repaints in AnimationEffect if there are no animations
going on. If an animation is waiting for starting or kept after ending
the visual appearance is no longer changed, so no repaint is needed.
REVIEW: 110795
Loop directly over the window quad list and check the type instead of
using select(WindowQuadDecoration) when separating the decoration quads.
This avoids the step of creating an intermediate list, and then looping
over that list to separate out the quads that belong to the four sides.
xcb/xcb_iccm.h isn't C++ safe (some versions) because it has
a variable called "class" in function signatures. The hack
is to define "class" to something else before that header is
included, and then undef "class" immediately afterwards.
CCMAIL: mgraesslin@kde.org, fredrik@kde.org