Commit graph

12 commits

Author SHA1 Message Date
Vlad Zahorodnii
3cdc97a4e9 Avoid converting socket name between QString and QByteArray back and forth
It only contributes overhead.
2020-12-09 15:07:29 +02:00
Vlad Zahorodnii
4ce853e8e4 Prettify license headers 2020-08-07 19:57:56 +00:00
Vlad Zahorodnii
1fb9f6f13a Switch to SPDX license markers
The main advantage of SPDX license identifiers over the traditional
license headers is that it's more difficult to overlook inappropriate
licenses for kwin, for example GPL 3. We also don't have to copy a
lot of boilerplate text.

In order to create this change, I ran licensedigger -r -c from the
toplevel source directory.
2020-08-07 19:57:56 +00:00
Vlad Zahorodnii
d1b35f306d Introduce started signal in Application
The new signal is emitted when the Application has fully been initialized.

It allows us to change the startup sequence, for example create workspace
before starting the Xwayland server, without making any adjustments in our
test suit.
2020-07-17 09:10:51 +00:00
Vlad Zahorodnii
be759b7d33 Use AbstractClient instead of XdgShellClient wherever possible
Summary:
Currently, we have only one shell client type - XdgShellClient. We use
it when we are dealing with Wayland clients. But it isn't really a good
idea because we may need to support shell surfaces other than xdg-shell
ones, for example input panel surfaces.

In order to make kwin more extensible, this change replaces all usages
of the XdgShellClient class with the AbstractClient class.

Test Plan: Existing tests pass.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D27778
2020-03-04 09:57:13 +02:00
Vlad Zagorodniy
168ea98845 Rename ShellClient to XdgShellClient
Summary:
Rename ShellClient to XdgShellClient in order to reflect that it
represents only xdg-shell clients.

Test Plan: Compiles, tests still pass.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D23589
2019-09-23 17:28:56 +03:00
Roman Gilg
8c047613c5 Partly remove Compositor restart functionality
Summary:
This removes the restart function of the Compositor class and renames the
internal reinitialize function.

Instead of the restart function reinitialize can be called. Reading again
the settings in this case is fine, since it is done rarely. This reduces
the code complexity.

Test Plan: Manually on Wayland and X. 100% autotests pass.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: davidedmundson, zzag, kwin

Tags: #kwin

Maniphest Tasks: T11071

Differential Revision: https://phabricator.kde.org/D22225
2019-07-04 15:31:40 +02:00
Martin Flöser
cbbe94d769 Restrict available supported compositors based on first initialized one
Summary:
On Wayland we cannot switch from OpenGL to QPainter compositor as this
would break any running OpenGL application. KWin registers it's
EGLDisplay to Wayland and without OpenGL this doesn't make sense any
more. We are not able to render OpenGL buffers in the QPainter
compositor.

While it's theoretically possible to switch from QPainter to OpenGL it
doesn't make any sense for the same reason. Any running OpenGL
application would be using llvmpipe and could not be switched to proper
OpenGL.

This change stores the selected compositing type in Platform and the
implementations can use it to restrict the supported compositors. On X11
we don't need this, all other Platforms implement the restriction. Thus
it's no longer possible to switch the backends at runtime.

Test Plan:
Adjusted tests run, no runtime test as gui doesn't support
switching to QPainter anyway.

Reviewers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D19084
2019-02-22 16:59:08 +01:00
Martin Flöser
99df3c82f3 [autotests] Don't check whether there is a /dev/dri/card0
Summary:
With EGL_MESA_platform_surfaceless we don't need a dri device anymore.
So we don't need to skip the tests if the device is missing. Instead the
tests verify that OpenGL compositing is used if requested.

Test Plan: ctest passes

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18014
2019-01-12 07:36:28 +01:00
Martin Flöser
50470e97c6 [autotests] Drop cast to SceneOpenGL GenericSceneOpenGLTest
Not really needed, instead we can compare on the compositing type.
2017-09-08 16:06:33 +02:00
Martin Flöser
004c0f3892 [autotests] Test creating core context profile
Extends OpenGL testRestart to once with GLCore and once with legacy.
2017-06-25 09:48:46 +02:00
Martin Flöser
66f0839925 [autotests] Introduce a SceneOpenGL ES test
The SceneOpenGLTest is transformed into a GenericSceneOpenGLTest which
can create either an OpenGL or an OpenGL ES scene based on env variable
which it sets in initTestCase. The env variable to set is passed as a
ctor argument from the SceneOpenGLTest and the new SceneOpenGLESTest.

This allows to easily run the same test code for both our OpenGL and
OpenGL ES compositor.
2017-06-24 21:05:49 +02:00