Commit graph

20743 commits

Author SHA1 Message Date
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.
2022-01-11 08:01:10 +00:00
Vlad Zahorodnii
2979a850fa Drop ClearablePoint
It's unused.
2022-01-11 08:01:10 +00:00
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.
2022-01-10 19:54:58 +00:00
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.
2022-01-10 17:16:14 +00:00
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.
2022-01-10 12:41:19 +00:00
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.
2022-01-10 11:23:55 +00:00
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"
2022-01-09 01:50:30 +00:00
Nicolas Fella
21212a71ec [kwin_rules_dialog] Add desktop file
This is needed for correct taskbar indentification
2022-01-08 20:16:34 +01:00
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
2022-01-07 21:16:04 +00:00
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
2022-01-07 11:04:42 +00:00
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.
2022-01-06 08:12:32 +00:00
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
2022-01-05 19:00:22 +02:00
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
2022-01-05 16:39:56 +01:00
Vlad Zahorodnii
dfe69a6784 effects: Enable the scale effect by default
It looks fancier than the fade effect.
2022-01-05 08:26:36 +00:00
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
2022-01-05 08:13:09 +01:00
Alexander Lohnau
ab2ac07e2a Define X-KDE-ConfigModule for videowall KCM
This way we do not need to go through KServiceTypeTrader for the querying
2022-01-05 08:12:13 +01:00
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.
2022-01-05 08:12:13 +01:00
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.
2022-01-05 08:12:13 +01:00
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.
2022-01-05 08:12:13 +01:00
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.
2022-01-05 08:12:13 +01:00
Devin Lin
c59c52cb0c Expose org.kde.kwin.ColorCorrect.xml dbus file 2022-01-05 01:33:01 +00:00
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
2022-01-04 22:22:57 +00:00
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
2022-01-04 22:22:57 +00:00
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.
2022-01-04 22:22:57 +00:00
Xaver Hugl
2af3f46357 backends/drm: adjust logging verbosity 2022-01-04 22:22:57 +00:00
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.
2022-01-04 20:07:45 +00:00
Vlad Zahorodnii
457e9faaa1 Avoid sending a configure event when starting interactive move
There's nothing to configure that needs an acknowledgement from the
client.
2022-01-04 18:28:54 +02:00
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).
2022-01-04 18:28:54 +02:00
Vlad Zahorodnii
5420e11bd4 Make AbstractClient::titlebarPosition() return Qt::Edge
Conceptually, it's an edge, the titlebar can't be in a window corner.
2022-01-04 15:57:42 +00:00
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.
2022-01-04 16:01:57 +01:00
Laurent Montel
9521ca1e56 Use const'ref here 2022-01-04 14:00:41 +01:00
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.
2022-01-04 10:28:42 +02:00
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.
2022-01-04 07:36:42 +00:00
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.
2022-01-04 07:36:42 +00:00
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.
2022-01-04 07:36:42 +00:00
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.
2022-01-04 07:36:42 +00:00
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.
2022-01-04 07:36:42 +00:00
Weng Xuetian
6cc0c204fd
Fix tests by checking if InputMethod::self() is null.
Only integration test has InputMethod instance.
2022-01-03 18:34:53 -08:00
Méven Car
d81b106c15 Apply the rgbrange read from Kscreen configuration on startup
CCBUG: 442520
2022-01-03 15:40:52 +00:00
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.
2022-01-03 10:45:44 +00:00
Xaver Hugl
0ba2c35e1a dmabuf feedback: limit modifiers to those supported by egl 2022-01-03 10:45:44 +00:00
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
2022-01-03 11:17:50 +01:00
Vlad Zahorodnii
bc3d80db2a Use default member initialization in Compositor consistently 2022-01-03 10:51:21 +02:00
Vlad Zahorodnii
e81a360194 Bump libepoxy to 1.3
1.3 has been released in 2015 which is sufficiently old enough.
2022-01-02 22:30:06 +02:00
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.
2022-01-02 22:29:36 +02:00
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.
2022-01-02 03:26:23 +00:00
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"
2022-01-02 02:01:24 +00:00
Xaver Hugl
5e75d2a095 backends/drm: fix cursor crash 2022-01-01 13:22:20 +00:00
l10n daemon script
1d6de6a3a9 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"
2022-01-01 01:43:48 +00:00
l10n daemon script
5e5752b8c4 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"
2021-12-31 01:42:54 +00:00