Commit graph

31 commits

Author SHA1 Message Date
Vlad Zahorodnii
6432f29e9f autotests: Remove unused screenedge.h include 2022-01-25 21:16:51 +02:00
Vlad Zahorodnii
5ee8389705 autotests: Remove unused screens.h includes 2022-01-25 21:13:30 +02:00
Vlad Zahorodnii
543145e76f autotests: Port common screen check preamble to AbstractOutput 2021-08-31 08:16:27 +00:00
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.
2021-08-30 13:28:23 +00:00
Vlad Zahorodnii
b08807cc36 autotests: current abstract output 2021-08-30 13:28:23 +00:00
Vlad Zahorodnii
1b2c7b248b Run clazy with qt-keywords fixit
In C++20, there will be emit() class member, which can conflict with the
emit keyword. Given that, there are plans to enable QT_NO_KEYWORDS by
default in the future.

See also
https://lists.qt-project.org/pipermail/development/2020-February/038812.html
2021-06-08 10:49:42 +03:00
Vlad Zahorodnii
07c4057180 autotests: Stabilize tests that create Xwayland windows
The order in which Xwayland surfaces are associated with X11 windows is
undefined, meaning that we cannot assume that a newly created X11 window
won't have a surface associated with it already.
2021-05-15 16:16:48 +00:00
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.
2021-05-10 12:33:43 +00:00
Vlad Zahorodnii
83388295c8 wayland: Adjust kwin to PointerInterface changes 2021-03-10 14:10:16 +00:00
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
Aleix Pol
3a9d7a6e9d Port KWin to KWaylandServer
Summary: Away from KWayland::Server and KF5WaylandServer.

Test Plan: Builds, ran nested session

Reviewers: #kwin, #plasma, #frameworks, davidedmundson, zzag

Reviewed By: #kwin, #plasma, davidedmundson, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29278
2020-04-30 12:56:08 +02:00
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
2020-04-03 01:16:45 +02: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 Zahorodnii
4f9cbe4369 [autotests] Make XWaylandInputTest more robust 2020-02-14 02:02:04 +02:00
Vlad Zahorodnii
1181af2cd1 Provide input geometry and input transformation matrix for Xwayland clients
Summary:
We need to provide the input geometry and the input transformation
matrix for Xwayland clients in order to make sure that input events
are correctly mapped from the global screen coordinates to the
screen-local coordinates.

BUG: 417444
FIXED-IN: 5.18.1

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D27375
2020-02-14 01:49:27 +02:00
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
2019-10-02 11:46:37 +03:00
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
2019-09-25 21:11:37 +03: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
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
2019-08-27 12:24:49 +02:00
Roman Gilg
73fa7df1fc [autotests] Fix remaining autotests with failing border calculation
Summary:
As in 2c088894b fix remaining autotests failing since no borders has become
the new default behavior of Breeze.

Autotests should not rely on this default behavior of Breeze though, but be
run with a faked deco such that changes on Breeze does not directly change
the autotests behavior. That's a goal for the future.

Test Plan: 100% tests passed, 0 tests failed out of 147

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D21746
2019-06-27 13:44:03 +02:00
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
2018-03-19 22:12:22 +01:00
Martin Gräßlin
2feea7837a Warp the xcb pointer whenever pointer leaves an X11 surface
Summary:
For Xwayland windows we observed that passing pointer focus to another
window does not trigger proper leave events on X. Which results in e.g.
tooltip windows to show after the pointer moved to a completely
different position on a completely different surface.

This is a bug in Xwayland which will be fixed in 1.19 (already fixed in
master). Given that there is a runtime version check. Although it's fixed
in Xwayland master it's worth to carry a workaround.

To circumvent this problem KWin warps the xcb pointer to 0/0 whever an
X window loses pointer focus. That way the X window gets a proper leave
through the X protocol.

This created a problem though: when giving focus back to the X window it
started to warp the pointer for maximized windows as KWin got pointer
motion events through the X11 event filter for positions on the window
decoration. These are passed into the screen edge filter which pushes
the pointer back and warps our Wayland pointer. To solve this problem
KWin no longer performs any actions for pointer motion in the X11 event
filter if not on X11. The event filter needs to be reworked and most of
it should be moved into the Platform API, if possible.

Test Plan:
Reproduced situations where one could see that pointer updates
don't trigger leave. E.g. going from a highlighted window to the decoration.

Reviewers: #kwin, #plasma_on_wayland, bshah

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2531
2016-08-24 13:12:06 +02:00
Martin Gräßlin
91a6efce33 [autotests] Fix X version check for skip in XWaylandInputTest
Was missing one digit.
2016-08-23 13:39:23 +02:00
Martin Gräßlin
9aa6b2c1e5 [autotests] QSkip XWaylandInputTest if we don't have at least Xwayland 1.18
The test seems to fail with too old Xwayland, so let's skip it.
2016-08-23 11:25:57 +02:00
Martin Gräßlin
3c235e63cc [autotests] Further verifications in XwaylandInputTest
Trying to understand why it fails on build.kde.org...
2016-08-23 10:39:17 +02:00
Martin Gräßlin
33ca7750c2 [autotests] Further condition check in XWaylandInputTest
Just to figure out an idea why the test fails on build.kde.org...
2016-08-23 09:57:20 +02:00
Martin Gräßlin
a0154d01eb [autotests] Verify in XWaylandInputTest that cursor is not on new mapped window
Test fails on build.kde.org. This just adds an additional condition to
verify that the setup is correct.
2016-08-23 09:40:23 +02:00
Martin Gräßlin
efb62fd2ff [autotests] Add a test case for pointer enter/leave of X windows
This test simulates the situation that pointer leave on an X surface
does not send the XCB_LEAVE_NOTIFY event to the X window.
2016-08-23 09:15:05 +02:00