Commit graph

40 commits

Author SHA1 Message Date
Vlad Zahorodnii
6412fd2c34 autotests: Add WM_TRANSIENT_FOR tests 2024-03-20 08:12:54 +00:00
Vlad Zahorodnii
fb6ce3707a autotests: Add _NET_WM_STATE_MODAL tests 2024-03-19 12:47:59 +00:00
Vlad Zahorodnii
6b1e2f24f4 autotests: Add _NET_WM_MOVERESIZE tests 2024-03-18 20:54:10 +00:00
Vlad Zahorodnii
8892b16626 autotests: Add tests to check unmaximizing X11Window by dragging it 2024-03-18 18:23:33 +00:00
Vlad Zahorodnii
22ef6d9ddf autotests: Stabilize X11WindowTest
Make a roundtrip to the x server to ensure that WM_STATE changes have
been propagated. xcb_flush() is not good enough, there's still a race
condition between the wm flushing its connection and the client reading
window properties.
2024-03-18 08:46:11 +00:00
Vlad Zahorodnii
f563bade46 autotests: Add desktop tests in X11WindowTest 2024-03-16 10:25:32 +00:00
Vlad Zahorodnii
7db47ac2fd autotests: Add a test case for _NET_WM_WINDOW_OPACITY 2024-03-15 21:23:31 +02:00
Vlad Zahorodnii
2d5a69b1d2 autotests: Add skip switcher/pager/taskbar tests in X11WindowTest 2024-03-15 17:16:27 +00:00
Vlad Zahorodnii
0b4c6f8b3b autotests: Reduce amount of boilerplate code in X11 window test 2024-03-14 21:27:05 +00:00
Vlad Zahorodnii
acb4945cd3 autotests: Add more basic X11 window tests 2024-03-14 18:36:41 +00:00
David Edmundson
32be54b19d x11window: Disable strict geometry placement by default in wayland
Strict geometry disables certain user activites; full screen requests
and only sending configure events at sizes the client claims to support.

This was added as a workaround for xterm in 19 years ago. It's a client
side bug as applications can still choose to ignore the configure event,
so kwin shouldn't have to sanitise them in advance. xterm seems to have
fixed it's bug, and pragmatically we know not all window managers
perform these checks so most clients should not be relying on it.

On Wayland this additional check is proving problematic, the handling of
scaling especially fractional scaling is hitting cases where it's better
to always ask the client to do what kwin wants.

Tests that refer to sizeIncrements are dropped as they are only used in
the strict geometry passes which is being obsoleted. Resizing in general
is still tested.

BUG: 481456
2024-02-26 10:32:49 +00:00
Vlad Zahorodnii
aac5d562fb Drop "<N>" window caption suffix
The current implementation of the `<N>` suffix is still buggy and its
benefits are doubtful. One could argue that visual aids such as window
thumbnails or highlighting the windows are better. On its own, these
numbers don't have strong connections to the windows and can change on
a whim.
2024-02-05 11:10:53 +02:00
Vlad Zahorodnii
86084d118c libkwineffects/ -> effect/ 2023-11-20 11:32:43 +00:00
Vlad Zahorodnii
8566cb3735 Move effectloader.h to libkwineffects/ 2023-11-16 15:51:39 +02:00
Vlad Zahorodnii
15b47ce7fc Merge EffectsHandlerImpl and EffectsHandler 2023-11-15 15:21:50 +02:00
Vlad Zahorodnii
14ab38b596 composite.h -> compositor.h 2023-09-08 09:48:59 +03:00
Vlad Zahorodnii
6b2f46ca1f autotests: Remove unused outputbackend.h includes 2023-05-23 11:42:32 +03:00
Xaver Hugl
6e9d5c2cc3 autotests: directly call setVirtualOutputs 2023-05-09 15:18:33 +00:00
Vlad Zahorodnii
e0da725533 autotests: Fix Test::waitForWindowDestroyed
Before Deleted merge, it used to be equivalent to waiting until the
window is closed.

This fixes tests waiting until the window closing animation completes
and the Window object is destroyed.
2023-04-22 13:55:29 +00:00
Vlad Zahorodnii
e31ec802f4 Drop Deleted
Currently, the normal window lifecycle looks as follows: create Window,
wait until it's shown, add it to Workspace, wait until it's closed,
create a Deleted, copy properties from the original window to the
deleted one, destroy the original window, wait until the last deleted
window reference is dropped.

There are a couple of issues with this design: we can't nicely
encapsulate X11 or Wayland specific implementation details if they need
to be accessed for closed windows; manual copying of properties is
cumbersome and error prone and we've had a dozen of cases where effects
worked incorrectly because some properties had not been copied.

The goal of this patch is to drop Deleted and extend the lifetime of the
original window, but with a special state set: Window::isDeleted().

The main danger is that somebody can try to do something with deleted
windows that they should not do, but on the other hand, such code needs
to be guarded with relevant checks too.
2023-03-28 08:31:08 +00:00
Vlad Zahorodnii
1f43605329 Drop Workspace::clientList() 2023-03-24 22:28:46 +00:00
Vlad Zahorodnii
c91b90c58a Tidy Window::windowClosed() signal
"window" is redundant, so remove it. Also remove the original window
argument to improve the API consistency.
2023-03-14 07:15:56 +00:00
Vlad Zahorodnii
2f56cdc3fe Replace Deleted with Window where possible
With this, Window and Deleted can be interchanged, which makes merging
the two easier.
2023-03-13 14:41:44 +02:00
Vlad Zahorodnii
a2062090eb Rename interactive move resize lifecycle signals
Add the "interactive" word to be consistent and put "started",
"stepped", and "finished" at the end of signal names where they are more
expected.
2023-02-23 11:38:34 +00:00
Xaver Hugl
4cd25cf571 cursor: make position, hotspot and size floating point
This allows all pixel positions to be used on high dpi screens,
and corrects damage tracking with Xwayland cursors

CCBUG: 466094
2023-02-20 21:01:39 +00:00
David Edmundson
29b456ff25 Autotests: Use a helper method to create X11 connection 2023-02-06 16:02:50 +00:00
Vlad Zahorodnii
f04ad754ce autotests: Make testX11Window quicker
Before

    Executed in   17.39 secs      fish           external
       usr time  422.91 millis    1.92 millis  420.99 millis
       sys time  586.41 millis    0.22 millis  586.19 millis

After

    Executed in    1.23 secs      fish           external
       usr time  395.63 millis    0.00 millis  395.63 millis
       sys time  228.55 millis    2.13 millis  226.42 millis
2023-01-12 09:23:43 +00:00
Vlad Zahorodnii
12acd9bb78 autotests: Port away from OutputBackend::setInitialWindowSize() 2022-11-17 14:20:44 +00:00
Vlad Zahorodnii
b830d408af core: Rename Platform to OutputBackend 2022-11-10 10:10:28 +02:00
Vlad Zahorodnii
482741499d autotests: Reduce the number of "using namespace KWayland::Client"
KWayland::Client has ambiguous type names such as "Compositor" or
"Output". Use full types to improve code readability.
2022-11-08 13:34:58 +00:00
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.
2022-09-14 09:21:29 +00:00
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.
2022-09-06 11:21:40 +03:00
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.
2022-08-09 08:17:18 +00:00
Xaver Hugl
8955a2420e replace all uses of QScopedPointer with std::unique_ptr 2022-08-04 12:30:09 +00:00
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.
2022-07-21 08:43:50 +00:00
David Edmundson
7292af3d04 Use floating geometry throughout
With fractional scaling integer based logical geometry may not match
device pixels. Once we have a floating point base we can fix that. This
also is
important for our X11 scale override, with a scale of 2 we could
get logical sizes with halves.

We already have all input being floating point, this doubles down on it
for all remaining geometry.

- Outputs remain integer to ensure that any screen on the right remains
aligned.
 - Placement also remains integer based for now.
- Repainting is untouched as we always expand outwards
 			   (QRectF::toAdjustedRect().
 - Decoration is untouched for now
 - Rules are integer in the config, but floating in the adjusting/API
This should also be fine.

At some point we'll add a method to snap to the device pixel
grid. Effectively `round(value * dpr)  / dpr` though right now things
mostly work.

This also gets rid of a lot of hacks for QRect right and bottom which
are very
confusing.

Parts to watch out in the port are:
 QRectF::contains now includes edges
QRectF::right and bottom are now sane so previous hacks have to be
removed
 QRectF(QPoint, QPoint) behaves differently for the same reason
 QRectF::center too

In test results some adjusted values which are the result of
QRect.center because using QRectF's center should behave the same to the
user.
2022-07-14 10:04:46 +01:00
Vlad Zahorodnii
79e0051b04 autotests: Port more tests from obsolete Screens 2022-07-12 07:05:45 +00:00
Vlad Zahorodnii
22e5c8a260 autotests: client -> window 2022-04-27 12:45:46 +00:00
Vlad Zahorodnii
175037d9d1 Prefer the term "window" over "client" in Workspace 2022-04-25 11:33:55 +00:00
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.
2022-04-23 07:55:51 +00:00
Renamed from autotests/integration/x11_client_test.cpp (Browse further)