30 Commits (master)

Author SHA1 Message Date
Laurent Montel bc6116c5a7 There's no QVector anymore, QList is the QVector in Qt6 11 months 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 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
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 ae01354638 autotests: Remove invalid cases in testScreens
The Workspace requires at least one output and no output has 0x0 size.

This fixes a crash in confineToBoundingBox() where qBound() asserts that
the min value is less than the max value, in our case the x coordinate
of the left edge of the workspace is less than the x coordinate of the
right edge of the workspace.
2 years ago
Vlad Zahorodnii 187f556f85 Drop Screens 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 070f63c451 Drop Screens::geometry() and Screens::size()
Currently, the main user of these two functions is the X11 standalone
platform.

This change ports that code to Workspace::geometry(), which is not great
but the X11 backend already depends on the Workspace indirectly via the
Screens. Not sure if it's worth making the standalone X11 backend track
the xinerama rect internally.
2 years ago
Vlad Zahorodnii a5ac7cf0ae scripting: Port ClientModel V2 from Screens 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 43b78e40d8 screens: move singleton to Workspace 2 years ago
Vlad Zahorodnii a198516871 Drop Platform::enabledOutputs()
At the moment, a platform should provide two output lists - one that
lists all available outputs, and the other one that contains only
enabled outputs. In general, this amounts to some boilerplate code and
forces backends to be implemented in some certain way, which sometimes
is inconvenient, e.g. if an output is disabled or enabled, it will be
simpler if we only change Output::isEnabled(), otherwise we need to
start accounting for corner cases such as the order in which
Output::isEnabled() and Platform::enabledOutputs() are changed, etc.
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 5a8beacd2b Drop Platform::findOutput()
Please, don't use integer ids to identify outputs!
2 years ago
Vlad Zahorodnii 22e5c8a260 autotests: client -> window 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
Vlad Zahorodnii 09fa095039 Drop unused Screens::intersecting() 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 6ca411a84a Port AbstractClient::sendToScreen() to AbstractOutput 3 years ago
Vlad Zahorodnii 282e0d1c4d autotests: Port the tests to new xdg-shell helpers 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
Xaver Hugl 2aae299eba Fix testScreens 3 years ago
Vlad Zahorodnii 93194a6720 autotests: Convert testScreens into an integration test
At the moment, the Screens class is convoluted with ifdefs because of
MockScreens.

The goal of this change is to reduce the number of usages of the
MockScreens class so it is possible to get rid of the ifdefs.
4 years ago