47 Commits (14ab38b5968eacb5a2149476fb151a24e58566bb)

Author SHA1 Message Date
Vlad Zahorodnii 9cf6011ba4 autotests: Don't be so paranoid about compositing type
In many cases it's irrelevant, what we care about is whether given effect
is loaded and performs its function. So remove these paranoid checks
except the tests where it's important to use OpenGL compositing.
1 year ago
Vlad Zahorodnii 6b2f46ca1f autotests: Remove unused outputbackend.h includes 1 year ago
Xaver Hugl 6e9d5c2cc3 autotests: directly call setVirtualOutputs 1 year ago
Vlad Zahorodnii c693450976 backends/virtual: Port to gbm
The virtual backend uses the surfaceless platform. On the other hand, we
move in a direction where the graphics buffer type is explicit, which
creates issues for the virtual backend.

This change ports the virtual backend to gbm so we could manually
allocate dmabuf buffers in order to unify buffer handling in kwin.

Its main drawback is that you won't be able to use the virtual backend
on setups without render nodes. On the other hand, given that the
compositor is meaningless without clients being able to share buffers
with it, it's reasonable to require some way to create and export prime
buffers.
1 year ago
Vlad Zahorodnii e88a4e34a3 Remove some include_directories()
It seems we've settled on dir/dir/header.h includes, so let's use them
consistently.
2 years ago
Vlad Zahorodnii c91b90c58a Tidy Window::windowClosed() signal
"window" is redundant, so remove it. Also remove the original window
argument to improve the API consistency.
2 years ago
Vlad Zahorodnii 8bb2d52972 Rename Window::clientMaximizeStateChanged signal
Make it shorter to be more readable.
2 years ago
Vlad Zahorodnii 88c974835c Drop duplicate clientMaximizedStateChanged signal 2 years ago
Vlad Zahorodnii f71ee59a37 Port away from Cursor::setPos()
Use input device specific apis to change the position of the cursor. The
main reason to do so is to break the assumption that Cursor position is
the same as pointer position, which I would like to rely on later to
merge tablet and pointer cursors.
2 years ago
David Edmundson 29b456ff25 Autotests: Use a helper method to create X11 connection 2 years ago
Vlad Zahorodnii 12acd9bb78 autotests: Port away from OutputBackend::setInitialWindowSize() 2 years ago
Xaver Hugl 34aa734c7b plugins: use more std::unique_ptr 2 years ago
Vlad Zahorodnii b830d408af core: Rename Platform to OutputBackend 2 years ago
Vlad Zahorodnii 6d3f00e82c autotests: Remove QVERIFY(signalSpy.isValid())
We use the PMF syntax so the isValid() check is unnecessary as the
compiler will notify about wrong signal at compile time. It makes
writing autotests feel less boilerplaty.
2 years ago
Vlad Zahorodnii d2fb4147fc Move multi-purpose code in its own directory
Things such as Output, InputDevice and so on are made to be
multi-purpose. In order to make this separation more clear, this change
moves that code in the core directory. Some things still link to the
abstraction level above (kwin), they can be tackled in future refactors.
Ideally code in core/ should depend either on other code in core/ or
system libs.
2 years ago
Vlad Zahorodnii e24ee60bb2 autotests: Remove Test::initWaylandWorkspace()
It reduces the amount of boilerplate code and makes startup sequence in
autotests similar to the one in kwin_wayland.
2 years ago
Vlad Zahorodnii 4bfb0acc17 Make Workspace track managed outputs
This change adjusts the window management abstractions in kwin for the
drm backend providing more than just "desktop" outputs.

Besides that, it has other potential benefits - for example, the
Workspace could start managing allocation of the placeholder output by
itself, thus leading to some simplifications in the drm backend. Another
is that it lets us move wayland code from the drm backend.
2 years ago
Vlad Zahorodnii 22e5c8a260 autotests: client -> window 2 years ago
Vlad Zahorodnii 175037d9d1 Prefer the term "window" over "client" in Workspace 2 years ago
Vlad Zahorodnii a21aa839b1 Rename X11Client to X11Window
The word "client" means different things in wayland and kwin. Use a
better word to refer to windows.
2 years ago
Nils Fenner b491aeb9ae Rename AbstractClient to Window 2 years ago
Vlad Zahorodnii 8e7a8c5a11 Rename AbstractOutput to Output
AbstractOutput is not so Abstract and it's common to avoid the word
"Abstract" in class names as it doesn't contribute any new information.
It also significantly reduces the line width in some places.
2 years ago
Vlad Zahorodnii 7096e3ead8 Run clang-format
The .clang-format file is based on the one in ECM except the following
style options:

 - AlwaysBreakBeforeMultilineStrings
 - BinPackArguments
 - BinPackParameters
 - ColumnLimit
 - BreakBeforeBraces
 - KeepEmptyLinesAtTheStartOfBlocks
3 years ago
Julius Zint 270a963350 Migrate all autotest input simulation functions
[5/6] Make autotests create fake input devices

Migrate all input simulation functions from kwinApp()->platform()->...
to the their counter part in the Test namespace.
3 years ago
Vlad Zahorodnii 6432f29e9f autotests: Remove unused screenedge.h include 3 years ago
Vlad Zahorodnii 5ee8389705 autotests: Remove unused screens.h includes 3 years ago
Vlad Zahorodnii 48f943bd75 Introduce explicit base render backend type
The main idea behind the render backend is to decouple low level bits
from scenes. The end goal is to make the render backend provide render
targets where the scene can render.

Design-wise, such a split is more flexible than the current state, for
example we could start experimenting with using qtquick (assuming that
the legacy scene is properly encapsulated) or creating multiple scenes,
for example for each output layer, etc.

So far, the RenderBackend class only contains one getter, more stuff will
be moved from the Scene as it makes sense.
3 years ago
Vlad Zahorodnii 543145e76f autotests: Port common screen check preamble to AbstractOutput 3 years ago
Vlad Zahorodnii 7016da39c8 Move active output tracking to workspace
Active output is a window management concept. It indicates what output
new windows have to be placed on if they have no output hint. So
Workspace seems to be a better place for it than the Screens class, which
is obsolete.
3 years ago
Vlad Zahorodnii b08807cc36 autotests: current abstract output 3 years ago
Vlad Zahorodnii a06690021d Remove OpenGL2Compositing enum
OpenGLCompositing and OpenGL2Compositing enums mean de-facto the same
thing, it's confusing to have them both.
3 years ago
Aleix Pol a3d32fa836 Ensure we start our tests with wayland already initialised
When debugging modifier_only_shortcut_test in _waylandonly mode I saw
that it was failing, among other things, because some aspects were not
initialised.

This changes every test we have to run the new
Test::initWaylandWorkspace() that calls waylandServer()->initWorkspace()
but also makes sure that WaylandServer::initialized is emitted before we
proceed.
3 years ago
Vlad Zahorodnii 3cdc97a4e9 Avoid converting socket name between QString and QByteArray back and forth
It only contributes overhead.
4 years ago
Vlad Zahorodnii 4ce853e8e4 Prettify license headers 4 years ago
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.
4 years ago
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.
4 years ago
Aleix Pol 6abd23ed02 Make it possible to have a separate cursor for the tablet
Summary:
As is KWin only had 1 Cursor which was a singleton. This made it impossible for
us to properly implement the tablet (as in drawing tablets) support and show where
we're drawing.
This patch makes it possible to have different Cursors in KWin, it makes all the
current code still follow the mouse but the tablet can still render a cursor.

Test Plan: Tests pass, been using it and works as well as before but with beautiful tablet cursors.

Reviewers: #kwin, cblack, davidedmundson

Reviewed By: #kwin, cblack, davidedmundson

Subscribers: davidedmundson, cblack, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D28155
5 years ago
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
5 years ago
Vlad Zahorodnii 7d4471eba6 Rename geometry property to frameGeometry
Summary:
In order to properly implement xdg_surface.set_window_geometry we need
two kinds of geometry - frame and buffer. The frame geometry specifies
visible bounds of the client on the screen, excluding client-side drop
shadows. The buffer geometry specifies rectangle on the screen that the
attached buffer or x11 pixmap occupies on the screen.

This change renames the geometry property to frameGeometry in order to
reflect the new meaning assigned to it as well to make it easier to
differentiate between frame geometry and buffer geometry in the future.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24334
5 years ago
Vlad Zahorodnii ffcbe24e2b Rename Client to X11Client
Summary:
Currently each managed X11 client is represented with an instance of
Client class, however the name of that class is very generic and the
only reason why it's called that way is because historically kwin
was created as an x11 window manager, so "Client" was a sensible choice.

With introduction of wayland support, things had changed and therefore
Client needs to be renamed to X11Client in order to better reflect what
that class stands for.

Renaming of Client to X11Client was agreed upon during the last KWin
sprint.

Test Plan: Compiles, the test suite is still green.

Reviewers: #kwin, romangg

Reviewed By: #kwin, romangg

Subscribers: romangg, davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24184
5 years ago
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
5 years ago
Roman Gilg cd6b69a4d2 [platforms/virtual] Create output devices
Summary:
Create output devices in virtual backend. For that the setVirtualOutputs call
can only come after the Wayland server has been initiliazied such that the
display exists to create the output and output device interfaces. Tests have
been adjusted for that.

Test Plan:
```
98% tests passed, 3 tests failed out of 148

Total Test time (real) = 362.97 sec

The following tests FAILED:
         33 - kwin-testInternalWindow (Failed)
         39 - kwin-testPointerInput (Failed)
        101 - kwin-testMoveResize (Failed)
```
Failing of these tests looks unrelated to the change.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Maniphest Tasks: T11459

Differential Revision: https://phabricator.kde.org/D23477
5 years ago
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
6 years ago
Martin Flöser c19627b492 Copy plastik window decoration to build directory
Summary:
This ensures that DontCrashAuroraeDestroyDecoTest can load the plastik
window decoration when run from build directory as it happens on
build.kde.org.

Test Plan: Test passes now when manipulating XDG_DATA_DIRS to hide system install

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16745
6 years ago
Roman Gilg 8136c2722b [platforms/virtual] Add virtual output class
Summary:
This matches the DRM backend more closely and allows mid-test removal and
addition of virtual outputs with different properties in the future.

Test Plan: Before and after 93% tests passed.

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: graesslin, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D11351
7 years ago
Martin Gräßlin 3c04d5295d Handle situation of no XDG_RUNTIME_DIR gracefully
Summary:
If KWin fails to start the Wayland server due to XDG_RUNTIME_DIR not
being set, kwin_wayland should terminate with an error condition but
not crash.

This change makes sure that KWin detects that the Wayland server does
not work and terminates the startup early and ensures that it doesn't
crash while going down.

An error message is shown that we could not create the Wayland server.

Test Plan:
Test case added which verifies that WaylandServer fails to
init. Manual testing that kwin_wayland exits with error 1.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2078
8 years ago
Martin Gräßlin d6dd4af8cf Rename autotests/wayland to autotests/integration
It's not about Wayland, but more about Integration. It can test both
Wayland and X11 windows.

Reviewed-By: Bhushan Shah
8 years ago