Commit Graph

10674 Commits (70f93c12a888aa0d19ea9220e69153f26a4b7063)

Author SHA1 Message Date
Fredrik Höglund 4a95f7f1f1 kwin: Check for an empty quad list in beginRenderWindow()
BUG: 320845
2013-06-07 23:46:06 +02:00
Martin Gräßlin b7423a45cd Only build Wayland backend if both Wayland and EGL are found 2013-06-07 11:57:08 +02:00
l10n daemon script 42719a96cc SVN_SILENT made messages (.desktop file) 2013-06-07 05:52:30 +00:00
l10n daemon script 31fb163a07 SVN_SILENT made messages (.desktop file) 2013-06-07 03:40:35 +00:00
Martin Gräßlin 7ec31b4c9c Remove labels from TabBox section in kcfg
Not used and containing technical wording useless for translation.

BUG: 320796
2013-06-06 08:11:02 +02:00
l10n daemon script 3f30610010 SVN_SILENT made messages (.desktop file) 2013-06-06 03:45:21 +00:00
Thomas Lübking 516ea86341 block quick tiling unless actually moved
REVIEW: 109485
BUG: 289494
FIXED-IN: 4.11
2013-06-05 14:11:00 +02:00
Thomas Lübking 74d17bd5f5 remove plasma theme workaround
REVIEW: 110676
2013-06-05 14:11:00 +02:00
Thomas Lübking 175f117af3 drop malicious waitSync
REVIEW: 110558
2013-06-05 14:11:00 +02:00
Thomas Lübking 6c998fc668 manage triple buffering
REVIEW: 110556
2013-06-05 14:10:59 +02:00
Thomas Lübking b8439145bd always defer delete of Deleted to next event cycle
BUG: 317765
FIXED-IN: 4.11
REVIEW: 110756
2013-06-05 14:10:59 +02:00
Thomas Lübking abaf6faae1 revert wrong leak fix, caused double free
BUG: 320439
FIXED-IN: 4.11
REVIEW: 110754
2013-06-05 14:10:58 +02:00
Thomas Lübking 6f5f999c54 catch NULL client pointer
BUG: 320589
FIXED-IN: 4.11
REVIEW: 110782
2013-06-05 14:10:58 +02:00
Thomas Lübking 3a3579d6d4 Fix supportWindow creation
xcb_create_window seems noop on 0x0 windows

BUG: 320271
FIXED-IN: 4.11
REVIEW: 110657
2013-06-05 14:10:58 +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
Martin Gräßlin 0063e2ed2d Translucency effect rewritten in JavaScript
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
2013-06-05 08:31:17 +02:00
Martin Gräßlin 5660801192 Add DecorationOpacity to AnimationEffect
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.
2013-06-05 08:27:09 +02:00
Martin Gräßlin 941c02a60f Introduce cross-fading with previous pixmap
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
2013-06-05 08:18:28 +02:00
Martin Gräßlin e7ab3adafd New class to encapsulate a Window's Pixmap
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
2013-06-05 08:18:11 +02:00
l10n daemon script 34c8d6feb6 SVN_SILENT made messages (.desktop file) 2013-06-05 04:54:40 +00:00
Fredrik Höglund 40918e0193 kwin: Make WindowQuadList inherit from QVector
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.
2013-06-05 00:43:17 +02:00
Fredrik Höglund 57b78daf33 kwin: Use the new API for rendering quads 2013-06-05 00:41:25 +02:00
Fredrik Höglund dbbda21129 kwin: Support quads in makeInterleavedArrays()
A new type parameter is added for specifying the primitive type.
2013-06-05 00:41:24 +02:00
Fredrik Höglund 7e22bd314c kwin: Add support for rendering quads using an index buffer
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.
2013-06-05 00:41:24 +02:00
Fredrik Höglund 479ea5db61 kwin: Resolve functions for GL_ARB_copy_buffer 2013-06-05 00:41:24 +02:00
Fredrik Höglund 5e7b2a34a8 kwin: Resolve functions for GL_ARB_draw_elements_base_vertex 2013-06-05 00:41:23 +02:00
Fredrik Höglund 7c4b736cec kwin: Upload all the vertex data at the same time
With this change we only map the vertex buffer once per window.
The vertex arrays are also only set up once.
2013-06-05 00:41:23 +02:00
Fredrik Höglund 993b50cf1c kwin: Add a new GLVertexBuffer::draw() method
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.
2013-06-05 00:41:23 +02:00
Fredrik Höglund 40d6bd66d4 kwin: Refactor SceneOpenGL::Window
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().
2013-06-05 00:41:23 +02:00
Fredrik Höglund 631769d18f kwin: Rename SceneOpenGL::debug to m_debug and add an accessor 2013-06-05 00:41:23 +02:00
Fredrik Höglund 4f2d12a4a7 kwin: Rename SceneOpenGL::Window::texture to m_texture 2013-06-05 00:41:23 +02:00
Fredrik Höglund 7bac2dd425 kwin: Add new convenience methods in SceneOpenGL
Add a paintRedirector() and a getDecorationTextures() method.
These will be used in an upcoming commit.
2013-06-05 00:41:22 +02:00
Fredrik Höglund 70921b8119 kwin: Make hardwareClipping a member 2013-06-05 00:41:22 +02:00
Fredrik Höglund c92f65583a kwin: Clear the decoration textures after resizing
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.
2013-06-05 00:41:22 +02:00
Fredrik Höglund d0703292fc kwin: Align decoration texture sizes to 128 pixels
This reduces the number of texture reallocations while
resizing windows.
2013-06-05 00:41:22 +02:00
Fredrik Höglund ac5f1317e9 kwin: Split WindowQuadDecoration into two types
Split WindowQuadDecoration into WindowQuadDecorationLeftRight
and WindowQuadDecorationTopBottom.

This simplifies the code in SceneOpenGL::Window::paintDecoration().
2013-06-05 00:41:22 +02:00
Fredrik Höglund 120e65b2c1 kwin: Use texture atlases for the decorations
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.
2013-06-05 00:41:22 +02:00
Fredrik Höglund e862bfe569 kwin: Refactor some code in the PaintRedirector
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.
2013-06-05 00:41:22 +02:00
Martin Gräßlin 1fd779695f Rewrite of dialog parent effect in JavaScript
REVIEW: 110802
2013-06-04 17:17:08 +02:00
Martin Gräßlin a4ec610d23 Copy modal state and mainWindows from Client to Deleted
Otherwise it's not possible to access them in the windowClosed handler.
That the dialog parent effect worked at all was pure chance.
2013-06-04 17:17:08 +02:00
Martin Gräßlin 4b4646973b Use QList<KWin::EffectWindow*> as return type for mainWindows()
QtScript bindings fails when using EffectWindowList.
2013-06-04 17:17:08 +02:00
Martin Gräßlin 76c207df09 Helper effect for KScreen integration
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
2013-06-04 17:06:42 +02:00