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.
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.
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.
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.
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.
The .clang-format file is based on the one in ECM except the following
style options:
- AlwaysBreakBeforeMultilineStrings
- BinPackArguments
- BinPackParameters
- ColumnLimit
- BreakBeforeBraces
- KeepEmptyLinesAtTheStartOfBlocks
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.
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.
Since the Screens class is a convenience wrapper around AbstractOutput
objects that come from the Platform, it should not be platform-specific.
By dropping createScreens(), output-related code becomes simpler.
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.
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.
Summary:
AbstractOutput::name() behaviour is changed so that it matches the X11
behaviour, showing an identifier like "HDMI-0".
XdgOutput.name is set to this name.
XdgOutput.description is currently set to the manufacturer name and
model, but it's not exposed to Qt so we probably don't care too much.
This should fix plasmashell changing applets when switching between X11
and wayland.
Test Plan:
Relevant unit test
I still need to run it on my laptop.
Reviewers: #kwin, #plasma, zzag
Reviewed By: #kwin, #plasma, zzag
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D28230
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
Test Plan:
Very minimal expansion of unit tests which uses WaylandScreens
Wrote mini app to debug actual output of xdg-output for testing the DRM code
Main relevant user of this is xwayland > 1.20 which I don't have, so that
part remains untested
Reviewers: #plasma, graesslin
Reviewed By: #plasma, graesslin
Subscribers: romangg, graesslin, bshah, kwin
Tags: #kwin
Maniphest Tasks: T8501
Differential Revision: https://phabricator.kde.org/D12243
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
Summary:
This is a preparation step for no longer creating a socket in the tests
and slightly simplifies the init test code.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3575
Summary:
Most platforms like the nested and virtual do not handle the outputs
themselves and WaylandServer announces the Outputs to Wayland.
So far this was static: at startup it got announced once to Wayland
and any changes were not catched.
This change makes WaylandServer listen to changes to the Screens and
sync them to Wayland.
Unfortunately KWin's internal Screen information is not sufficient to
properly synchronize this to Wayland and also Wayland by not supporting
adding/removing modes does not help.
Thus the solution implemented here is to add new outputs reflecting the
changes and then removing the old ones. This creates situations with more
outputs being present than actually there, but prevents that there are
no outputs at all.
Test Plan: Auto test added which verifies this for the virtual platform
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2233