Move the buffer-swap-pending state from the compositing backends to
the Compositor class. The Compositor is the only class that needs to
access the state, and this way it to do it without calling through
a chain of virtual functions. This commit adds two new functions to
Compositor; aboutToSwapBuffers() and bufferSwapComplete(). The
backends call these functions to set and reset the buffer-swap-pending
state.
This commit also renames a number of functions and variables to make
their meaning clear.
The act of promoting the contents of the back buffer to become the
contents of the front buffer is referred to as posting the buffer,
presenting the buffer, or swapping the buffers; rendering the buffer
is what paintScreen() does.
The wayland protocols need the .c files compiled in gnu90 mode.
All known compilers used for kwin support the -std= flag, so setting it
unconditionally should be fine
REVIEW: 120231
This is a very interesting auto test as Screens uses both Workspace
and Client. Thus it operates in the "impossible to mock" area.
The solution is to provide mock includes in autotests and ensure that
when building the auto-test the mock header includes will be picked
first. There is now a mock class for Workspace and Client providing
just the API pieces used inside Screens.
As Screens is abstract and we cannot properly interact with
QDesktopWidget there is also a MockScreens class inheriting from Screens
and mocking the required functionality (by just operating on a list of
QRects).
The auto-test itself is only performing checks on the abstract class.
The mock class is indirectly tested by Screens calling into the virtual
methods. The test case is not yet complete, but looking quite good
already.
We are only using the UrgencyHint, InputHint and GroupLeader from
WMHints. Those are provided by NETWinInfo, so we can use the
functionality provided by NETWinInfo instead of calling XGetWMHints.
REVIEW: 120162
Create and import X sync fences into GL and use them to synchronize
the kwin command stream with the X command stream.
This prevents damaged windows from being composited by kwin before
the rendering that triggered the damage events have finished on
the GPU.
Requires GL_EXT_x11_sync_object.
Tested-by: Marco Martin <notmart@gmail.com>
The Text.horizontalAlignment property expects AlignHCenter instead of
AlignCenter. By not using AlignHCenter the centering broke when a window
got maximized.
Not all RGBA 8888 fbconfigs in the NVIDIA driver have an associated
X visual with a 32 bit depth.
This fixes a regression from 88f8078073.
Tested-by: Eike Hein <hein@kde.org>
So far the Seat interface is provided together with pointer and
keyboard. As always touch is not yet implemented. The pointer interface
is still lacking the set cursor callback. Keyboard on the other hand is
complete.
Both Keyboard and Pointer have the concept of a focused surface and only
to the bound interface belonging to the same client as the focused
surface events are sent.
The change comes with a set of new auto tests also verifying the client
side which wasn't possible before as we couldn't fake events.
ShellSurfaceInterface is not yet completely implemented. Several parts
are still TODO, e.g. move/resize is missing, setting to maximized is
missing and also flags for fullscreen are missing.
The surface test is extended as far as possible.
The Display provides a method to create the shm pool and a
BufferInterface class is added to the server module. It is created
from the SurfaceInterface when a buffer gets attached to the surface.
The BufferInterface can be referenced and once its unreferenced it
sends a buffer release to the client and destroys itself.
For the case that the buffer is a shm buffer the BufferInterface
provides a convenience method to turn it into a QImage.
The auto test for Surface is extended by attaching buffers to the
surface and verifying that the content is correct.
As far as it's currently possible to implement. CompositorInterface is
able to create a surface and emits the created SurfaceInterface. It
does not yet support regions.
The SurfaceInterface is already more complete. It keeps track of the
double buffered states and emits signals when one of the values are
changed after the committing. It supports frame callbacks and has a
hook to mark the frame as rendered.
What's still missing are the regions (as it's not implemented in
CompositorInterface) and attaching the buffer as we do not yet support
creating shm buffers and pools.
The client side test is changed to use our own server and extended to
test damage and frame callback. The test needs to be extended for scale
and transform, but that is still missing in the client side
implementation.
So far this new module contains:
* Display
* OutputInterface
Display manages the server socket and server event loop. In general it's
the entry point to any part of the server.
OutputInterface is the abstraction for the wl_output interface on server
side. An OutputInterface is created through the Display.
The auto tests for ConnectionThread and Output are adjusted to use the
internal server instead of starting Weston. Especially the Output test
could be extended to test much more as we have absolute control over
the server now.
Technically the Surface itself does not have a size, it's the
ShellSurface or the size of the FullScreenShell's Output. But it
simplifies a lot if we keep track of the size in the Surface as that
way we can hide the fact which kind of Shell is used.
The user of the Surface must connect either the FullscreenShell's
Output or the ShellSurface to set the size on the Surface.
This adds a SceneOpenGL::Texture::load(..., xcb_visualid_t) overload,
and uses it to bind window pixmaps to textures.
By taking the RGBA masks in the visual into account when choosing an
FBConfig for the GLXPixmap, we are able to disambiguate formats that
have the same depth, such as GL_RGB10_A2 and GL_RGBA8.