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 makes KWin switch to in-tree copy of KWaylandServer codebase.
KWaylandServer namespace has been left as is. It will be addressed later
by renaming classes in order to fit in the KWin namespace.
The .clang-format file is based on the one in ECM except the following
style options:
- AlwaysBreakBeforeMultilineStrings
- BinPackArguments
- BinPackParameters
- ColumnLimit
- BreakBeforeBraces
- KeepEmptyLinesAtTheStartOfBlocks
[5/6] Make autotests create fake input devices
Migrate all input simulation functions from kwinApp()->platform()->...
to the their counter part in the Test namespace.
With the LEDs enum being defined in kwinglobals.h, wayland_server.h
won't need to include keyboard_input.h, which is good for compilation
times and wayland_server.h will drag less stuff, e.g. QtWidgets (input.h
includes QAction)
With a "Surface" type in kwin, KWayland::Client::Surface without fully
specified namespace will conflict with kwin's Surface type.
In some way, it also improves readability as it's clear where Surface
comes from.
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.
Re-use Qt's implementation of handling non-Latin layouts here
For full ASCII range support (Alt+`, etc.) Qt needs to be patched still,
see QTBUG-90611
BUG: 375518
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:
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
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
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
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
Summary:
This change removes all traces of wl-shell in the test suite. That's a
prerequisite for dropping wl-shell support in KWin.
Given that wl-shell and xdg-shell are not interchangeable, some tests
were removed and initialization sequence in some tests was adjusted.
The most notable change is ensuring that each plasmashell window sets
its role and initial position before committing the surface. Setting
those properties before the first surface commit is important because
our window placement code needs to know window type in order to
avoid maximizing panels, popups, etc.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D23561
Summary:
So far wayland was used by internal clients to submit raster buffers
and position themselves on the screen. While we didn't have issues with
submitting raster buffers, there were some problems with positioning
task switchers. Mostly, because we had effectively two paths that may
alter geometry.
A better approach to deal with internal clients is to let our QPA use
kwin core api directly. This way we can eliminate unnecessary roundtrips
as well make geometry handling much easier and comprehensible.
The last missing piece is shadows. Both Plasma::Dialog and Breeze widget
style use platform-specific APIs to set and unset shadows. We need to
add shadows API to KWindowSystem. Even though some internal clients lack
drop-shadows at the moment, I don't consider it to be a blocker. We can
add shadows back later on.
CCBUG: 386304
Reviewers: #kwin, davidedmundson, romangg
Reviewed By: #kwin, romangg
Subscribers: romangg, kwin
Tags: #kwin
Maniphest Tasks: T9600
Differential Revision: https://phabricator.kde.org/D22810
Summary:
When using composite key combinations, kwin would do random weird
actions when the first key was pressed (e.g. ` key). This makes sure we
are not trying to match.
BUG: 390110
Reviewers: #kwin, graesslin
Reviewed By: #kwin, graesslin
Subscribers: graesslin, kwin, #kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D12416
Summary:
KWin passes the current keysym converted to a Qt::Key in the QKeyEvent.
The current keysym does not always change when a key gets released, so
when pressing a shortcut the release carry a Qt::Key which could be
considered as wrong.
QtWayland transforms the actual pressed/released key into a keysym and
passes that through the QKeyEvent. This change does the same for the
internal windows. A new QKeyEvent is created and adjusted in a way that
it matches what Qt expects.
Why not change everything to how Qt expects it? The key is used at
various places and in KWin internally we expect the behavior how it is
currently implemented. So it's better to use Qt's expectation only when
interacting with Qt.
Also the change carries a workaround for a bug in QKeySequenceEdit
(see QTBUG-62102) and transforms Super to Meta. As this adjustment only
makes sense for the internal windows we need to send in an adjusted
QKeyEvent anyway, so another argument for using the Qt behavior only in
this place.
Test Plan:
Can set a shortcut on Wayland and it can be used to activate
the window.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D6828
Summary:
The generation of the shortcut caption part is moved from Client to
AbstractClient. The ShellClient also has a captionSuffix and implements
the full part in caption.
Overall this needs more refactoring to support more sharing between the
two implementations. But one step at a time.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D7093
Summary:
Moves most of the implementation from Client to AbstractClient, so that
it can be used for both Client and ShellClient. Only the X11 specific
code is kept in Client.
Not yet implemented is updating the window caption.
Unfortunately the testing of this feature showed that setting a window
shortcut is not working on Wayland at all (the Qt widget doesn't properly
catch the shortcut). So this feature is currently only of erm theoretical
use.
Test Plan: Added new test case. No testing in real world as explained.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D6818
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:
A shortcut with e.g. shift+w could not be triggered as shift is
considered as consumed. It transforms the keysym to an uppercase variant
thus it is consumed.
This change checks for the condition that shift is pressed and is the
only consumed modifier. If the current keysym is a letter the shift is
removed from the consumed modifier again to still support the shortcut.
BUG: 370341
FIXED-IN: 5.8.2
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3015
Summary:
If a key could be turned into a keysym with a modifier xkbcommon
considers the modifier as consumed even if not pressed.
E.g. Alt+F3 considers alt as consumed as there is a keysym gnerated with
Ctrl+Alt+F3 (vt switching).
This change tries to workaround the problem by ignoring the consumed
modifiers if there are more modifiers consumed than active. It's
possible that this will create regressions for other shortcuts - we need
to test it in the wild. Although this might cause regressions I'm aiming
for Plasma/5.8 branch with the change. It only affects Wayland and fixes
quite important shortcuts from window manager perspective (desktop
switching (ctrl+f1 to ctrl+f4), desktop grid (ctrl+f8), present windows
(ctrl+f9, ctrl+10), cube (ctrl+f11), user actions (alt+f3), close window
(alt+f4)). If it causes regressions they need to be fixed as well in the
Plasma/5.8 branch.
A new API entry point for xkbcommon was proposed, but is not yet merged
and there is no release with it yet. Once that is available the
workaround should get removed and replaced by the new API call.
BUG: 368989
FIXED-IN: 5.8.1
Test Plan: Going to restart session now with the change
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2945