25 Commits (master)

Author SHA1 Message Date
Vlad Zahorodnii 14ab38b596 composite.h -> compositor.h 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 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.
1 year ago
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.
2 years ago
Vlad Zahorodnii 1f43605329 Drop Workspace::clientList() 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 2f56cdc3fe Replace Deleted with Window where possible
With this, Window and Deleted can be interchanged, which makes merging
the two easier.
2 years ago
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.
2 years ago
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
2 years ago
David Edmundson 29b456ff25 Autotests: Use a helper method to create X11 connection 2 years ago
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
2 years ago
Vlad Zahorodnii 12acd9bb78 autotests: Port away from OutputBackend::setInitialWindowSize() 2 years ago
Vlad Zahorodnii b830d408af core: Rename Platform to OutputBackend 2 years ago
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.
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
Xaver Hugl 8955a2420e replace all uses of QScopedPointer with std::unique_ptr 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
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.
2 years ago
Vlad Zahorodnii 79e0051b04 autotests: Port more tests from obsolete Screens 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