20645 Commits (3b80380ba7077b316487ff3315df1b92c21878f0)
 

Author SHA1 Message Date
Arjen Hiemstra 352e92e32f Support global defaults for input devices
This adds support for reading values from a "Libinput/Defaults" group in
the input config file. This allows specifying global defaults for
devices, that are preferred over the libinput defaults. Because of the
cascading mechanisms of KConfig, this then allows distributions and
hardware vendors to supply system-wide defaults for devices.
3 years ago
Arjen Hiemstra 0319a66ead Refactor libinput::Device::ConfigData
Rather than an awkward combination of template functions, function
pointers and multiple calls to almost-the-same-but-not-entirely
functions, make ConfigData itself a template and use type erasure to
store them in the config map. This makes the data object aware of its
type and allows us to specialise the reading of config values through
template specialisation. It also removes the need for multiple
constructors and setters in the ConfigData object.
3 years ago
Vlad Zahorodnii 8e8f55b18a Drop Process helper
Direct session is long time gone and SIGUSR1 and SIGUSR2 are not used
anywhere so drop the Process helper.
3 years ago
Vlad Zahorodnii 2979a850fa Drop ClearablePoint
It's unused.
3 years ago
Fabian Vogt 677f5fcb6e wayland: Move m_layoutList assignment out of Xkb::applyEnvironmentRules
Xkb::applyEnvironmentRules is meant to do just that, move the unrelated
code outside.
3 years ago
Weng Xuetian cfa463c0ef Also forward key to input method for popup surface.
Popup may also want to use input method. If there is a keygrab, it also
need to forward input method instead of directly passing to wayland server.
3 years ago
Jan Grulich 9f44013fb5 Screencast: update PW buffer with only mouse cursor metadata on cursor change
As of now, we update cursor metadata only when the screen content changes, but
this results into not having smooth cursor movement. We can update only mouse
cursor location when it changes and send an empty buffer with mouse cursor
metadata so clients can have update mouse location.
3 years ago
Vlad Zahorodnii 861eac9205 Clean up Workspace::activeOutput()
Having both "active_client" and "client" is leftover after the active
output property being in the Screens class.
3 years ago
l10n daemon script a2774e26a9 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
3 years ago
Nicolas Fella 21212a71ec [kwin_rules_dialog] Add desktop file
This is needed for correct taskbar indentification
3 years ago
Ismael Asensio 72c0974a06 DesktopGridEffect: Fix crash when closing the effect
If the first condition would match (for instance after moving a window),
`windowMove` would be `nullptr`, triggering the crash later.

By the looks of it, it was maybe a typo.

BUG: 445335
FIXED-IN: 5.24

CC: @nicolasfella
3 years ago
Ismael Asensio d13c39bec6 kcm/kwinrules: Fix header in properties list
This provides a better fix for the header positioning bug in
the properties list sheet, instead of the previous workaround
(which wasn't enough in some situations)

Upstream bugfix (in the Kirigami component) is not advisable as
it could cause unintended consequencies in other uses/apps

See also: https://bugs.kde.org/show_bug.cgi?id=422289

BUG: 421583
FIXED-IN: 5.24
3 years ago
Fabian Vogt bd1fab3458 wayland: Honour default Xkb options
Currently KWin always uses the Options configured in kxkbrc because
QByteArray::constData() is never nullptr. This means that the system
default is ignored completely. Read ResetOldOptions to distinguish
between explicitly setting no options and using the system default.
3 years ago
Vlad Zahorodnii 81f9da17fd Drop resize effect
After recent refactor changes to improve resizing of xdg-toplevel
surfaces with an aspect ratio, the resize effect got really broken. The
resize effect has always been a problem child on wayland.

Unlike X11, geometry updates are performed asynchronously on Wayland.
It's not possible to have a smooth transition after finishing
interactive resize from the resized state to the normal state, geometry
will jump from last moveResizeGeometry() to the current frameGeometry()
and when the client repaints the window, the window size will jump back
to the move resize geometry size. There are no ways to fix that without
contradicting to how the effect is advertised to work, e.g. sending
configure events behind the back. Keeping the frame geometry out of sync
with the xdg_surface window geometry size is also not the option,
geometry updates are already too complex (due to being async).

Another wayland related issue with the resize effect is that the
compositor doesn't know about aspect ratio or any other size
constraints, except min and max size. The client can provide a smaller
buffer to account for various geometry constraints. It will be confusing
to have a mismatch between resize outline and the final real geometry.
Aspect ratio or other geometry constraints won't be exposed to the
compositor, it's a common decision of many wayland devs (including KDE).

To some extent, the wayland issues can be addressed by performing content
updates, with active feedback, the mismatch between outline and the
final geometry would become less severe, but it won't be any different
than resizing without the effect.

Given the wayland issues and in part maintenance costs, this change
drops the resize effect. Note that it can be still reimplemented without
kwin core changes, but it would still suffer from the aforementioned
issues.

BUG: 443434
3 years ago
Xaver Hugl d18e631d47 backends/drm: hide cursor again
Before 6a99bfd2, the DrmBackend took care of checking this. Now it
needs to be explicitly checked in DrmOutput
3 years ago
Vlad Zahorodnii dfe69a6784 effects: Enable the scale effect by default
It looks fancier than the fade effect.
3 years ago
Alexander Lohnau 1322b52b03 kwin scripts: No longer copy videowall metadata file in kservices folder
We load the KCM by path now and don't use KServiceTypeTrader
3 years ago
Alexander Lohnau ab2ac07e2a Define X-KDE-ConfigModule for videowall KCM
This way we do not need to go through KServiceTypeTrader for the querying
3 years ago
Alexander Lohnau a1340a9815 Rework determining of scripted effect config
Currently the plugin needs to set a property in oder to be considered configurable.

In kpackage we have the concept of optional and required files, based on the existence of those
optional files we can define different behavior. For example in Plasma the applets can optionally have a config ui.

Because here we don not use The KPackage:Package class, it is simpler to check the existence of the files on disk.
3 years ago
Alexander Lohnau f2dd50e1f9 Clean up legacy configmodule querying
In KWin we are allowed to break compat and here all first party consumers
have already been ported for quite a while.

Also the querying is very inefficient, because for every plugin where the
X-KDE-ConfigModule property is not defined all available KCMs have to be opened and
their metadata parsed.

This way we also get rid of the deprecation warning for KPluginMetaData::readStringList.
3 years ago
Alexander Lohnau 32f9ba0caf Do not embed json metadata in KCMs that get loaded by path
Doe to 1a0031c08a3b41458eb5bf2097b4cd6452ba3d09 we no longer require json metadata to be embedded.
Also we did not use the metadata anywhere, except for finding the correct plugin.
3 years ago
Alexander Lohnau 728b449891 Effectsmodel: Load KCM by path instead of searching for plugin by id
This way we do not need to embed json metadata in the plugins
and can consequently drop the metadata files entirely.

The resulting metadata object might still be invalid, however KCoreAddons
can handle such cases. See https://phabricator.kde.org/T15094 regarding
create better KCoreAddons API for such cases.
3 years ago
Devin Lin c59c52cb0c Expose org.kde.kwin.ColorCorrect.xml dbus file 3 years ago
Xaver Hugl 81905dbfaa backends/drm: properly handle pending transformations
AbstractWaylandOutput::pixelSize returns the size with already set transformation
applied but the render backends need the pending transformation
3 years ago
Xaver Hugl b06ec13ead backends/drm: test crtc+connector combinations with hardware rotation
This should enable KWin to use hardware rotation in more situations. As
a fallback all hardware rotation is disabled and the test is done again
3 years ago
Xaver Hugl dc5cddd33f backends/drm: ensure hardware transforms are properly applied and tested
Testing only the pipeline that this output uses is not enough and can
cause breakage on multi-monitor setups.
3 years ago
Xaver Hugl 2af3f46357 backends/drm: adjust logging verbosity 3 years ago
Ismael Asensio 088e870d54 TabBox: Add SwitcherItem to declarative API 3.0
Not sure if this was left out on purpose as a kind of deprecation.

It would be necessary to allow port the tabbox switchers to the newer 3.0 API and use their components (such as `Workspace`)

Probably for `Plasma/5.25` now.
3 years ago
Vlad Zahorodnii 457e9faaa1 Avoid sending a configure event when starting interactive move
There's nothing to configure that needs an acknowledgement from the
client.
3 years ago
Vlad Zahorodnii feaebcf81d Rename XdgToplevelClient::m_requestedStates to m_nextStates
It's consistent with m_nextDecoration and m_requestedStates contains
both requested and "not requested" states (i.e. the ones set by kwin
without waiting for acknowledged from the client, e.g. activated).
3 years ago
Vlad Zahorodnii 5420e11bd4 Make AbstractClient::titlebarPosition() return Qt::Edge
Conceptually, it's an edge, the titlebar can't be in a window corner.
3 years ago
Fabian Vogt 63a2a88e6c Allow starting kwin_wayland as root
Running a Plasma Wayland session as root is not insecure, it is in fact the
opposite. There is no way for other users to somehow influence this session
due to the user separation and the user is more likely to only use this for
administrative actions. This is in contrast to regular user sessions, which
most likely start a mix of unprivileged programs next to privileged windows
like some with authorized kauth helpers or even just sudo in a konsole tab.
3 years ago
Laurent Montel 9521ca1e56 Use const'ref here 3 years ago
Vlad Zahorodnii 5f83f2a781 Replace abort() with Q_ASSERT and Q_UNREACHABLE
This change replaces abort() with Q_ASSERT and Q_UNREACHABLE() macros to
make kwin code base consistent. Besides that, Q_UNREACHABLE may
potentially provide the compiler more info that can be used to generate
more efficient machine code.
3 years ago
Vlad Zahorodnii dde3010353 Move X11-specific code from interactive move resize handler to X11Client
When moving or resizing a window on X11, the window based screen edges
won't receive pointer input, so handleInteractiveMoveResize() explicitly
pokes the ScreenEdges to check if there's any approached screen edge.

On Wayland, it's not an issue. This change moves X11-specific code to
X11Client to avoid checking screen edges twice.
3 years ago
Vlad Zahorodnii d85ab218ee Avoid changing geometry when finishing interactive move resize
When finishing interactive resize operation, the move resize geometry is
already good and the client should have sent the corresponding configure
event. So, this moveResize() call is redundant.

This change moves code that is responsible for quitting maximized
horizontally or vertically mode to the start of the interactive resize
operation. It makes handling of MaximizeFull mode consistent, and it
kills one moveResize() call at the end of the interactive resize
operation, which is good because it makes simpler handling of resizing
aspect ratio aware windows on wayland.

However, in order to make resizing of aspect ratio aware windows good
for real, we will need to augment configure events with gravity info.
3 years ago
Vlad Zahorodnii dbee0573c4 Lock clientStepUserMovedResized to move resize geometry changes
On Wayland, the move resize geometry and the frame geometry are
completely out of sync.

This change synchronizes emitting of the clientStepUserMovedResized
signal to the move resize geometry changes.

It simplifies code of InternalClient and XdgSurfaceClient, and makes
adding support for other shell surface protocols easier as there's less
boilerplate stuff that you would need to take care of.
3 years ago
Vlad Zahorodnii dd7972ce46 wayland: Avoid repetitive move() and resize() calls during interactive move/resize
With internal clients and xdg-shell clients, geometry updates occur in
asynchronous fashion when interactively resizing the window.

As is, performInteractiveMoveResize() will call resize() if the move
resize geometry is different from the current frame geometry. This can
result in kwin sending excessive configure events.

With this change, kwin will send less configure events during
interactive resize.
3 years ago
Vlad Zahorodnii fcf0b4796f Drop geometry tip
It's not practical, regular users don't care about window geometry. One
could argue that it can be useful for creating window rules, but window
rules kcm pulls relevant properties from kwin.

If needed, one can reimplement this feature as a QtQuick script that creates
an overlay window positioned above the window that is being interactively
moved or resized.
3 years ago
Weng Xuetian 6cc0c204fd
Fix tests by checking if InputMethod::self() is null.
Only integration test has InputMethod instance.
3 years ago
Méven Car d81b106c15 Apply the rgbrange read from Kscreen configuration on startup
CCBUG: 442520
3 years ago
Xaver Hugl 93d5127014 backends/drm: improve dmabuf feedback
Instead of only allowing the current format, send the default tranches modified
to only contain formats and modifiers suitable for scanout.
In order to not fail when we can't do direct scanout with a given format
(because that may require a modeset, which we don't allow), keep a blacklist
of attempted formats and modifiers for the current client.
3 years ago
Xaver Hugl 0ba2c35e1a dmabuf feedback: limit modifiers to those supported by egl 3 years ago
Xaver Hugl 5a6f1e42c1 backends/drm: make the placeholder screen as big as the last screen
The fixed size of 1080p makes windows change their size and place. To
prevent that from happening, make the placeholder screen the same size
as the last disconnected screen.
This is not a bullet proof solution, only a fast one. Ideally KWin
should remember the window layout on a given monitor setup and restore
it when reconnected.

BUG: 447419
FIXED-IN: 5.24
3 years ago
Vlad Zahorodnii bc3d80db2a Use default member initialization in Compositor consistently 3 years ago
Vlad Zahorodnii e81a360194 Bump libepoxy to 1.3
1.3 has been released in 2015 which is sufficiently old enough.
3 years ago
Vlad Zahorodnii 9e97c06758 Move graphics reset handling to RenderBackend
This makes the Scene less overloaded and it's needed for things such as
render layers.

In hindsight, it would be great to merge checkGraphicsReset() and
beginFrame(), e.g. make beginFrame() return the status like in QRhi or
VkSwapchain. If it's OUT_OF_DATE or something, reinitialize the
compositor.
3 years ago
Weng Xuetian ca7298a325 Ensure modifier change is forwarded after the key sending to input method.
Same as real hardware wl_keyboard, key should be sent before modifier
change. For example, Left Ctrl press and release should produce
key events in the order of Control_L and Control+Control_L.
3 years ago
l10n daemon script db55e463f0 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
3 years ago
Xaver Hugl 5e75d2a095 backends/drm: fix cursor crash 3 years ago