Commit graph

22854 commits

Author SHA1 Message Date
Vlad Zahorodnii
cf3fe003e6 Move ownership of Session to Application
The Session can be useful not only to the platform backend but also
input backends and for things such as vt switching, etc. Therefore it's
better to have the Application own the Session.
2022-07-24 19:14:26 +03:00
Vlad Zahorodnii
5e669aece9 backends/libinput: Take Session explicitly
The API will be more clear about what the libinput backend needs.
2022-07-24 19:14:26 +03:00
Alexander Lohnau
4f7b2054e1 Remove "KCModule" ServiceType for KCMs
This is not needed anymore.

Task: https://phabricator.kde.org/T14483
2022-07-24 15:52:12 +00:00
Alexander Lohnau
ce694e838f De-duplicate json metadata of KPackages
Systemsettings and Plasma-Settings use the embedded json metadata instead of the KPackage one

Task: https://phabricator.kde.org/T14983
2022-07-24 15:52:12 +00:00
Alexander Lohnau
1a38ea6aba Port to KCM desktop file generation method from kcmutils
This de-duplicates the translations needed for the KCMs.

Task: https://phabricator.kde.org/T15609
2022-07-24 15:52:12 +00:00
Vlad Zahorodnii
36e238cda5 backends/drm: Remove EdidOverwrite config option
This is a too niche feature. It also doesn't have to be implemented in
the compositor. The kernel provides a way to overwrite the edid blob,
which is not specific to the running compositor.
2022-07-24 15:37:44 +00:00
Vlad Zahorodnii
96f3a5eec2 backends/drm: Fix dangling connectors in m_allObjects
We add connectors to m_allObjects but never remove them.

CCBUG: 457002
2022-07-24 14:20:12 +00:00
Vlad Zahorodnii
5aef41663a backends/drm: Fix potential use-after-free
When the output is removed, there are legit cases when the connector can
be still accessed.

CCBUG: 457002
2022-07-24 14:20:12 +00:00
Xaver Hugl
f0d59b078b backends/drm: explicitly initialize all fields of drmModeModeInfo 2022-07-24 13:49:54 +00:00
Xaver Hugl
bf6990da45 backends/x11/windowed: rename files to be more consistent 2022-07-24 13:05:13 +00:00
Xaver Hugl
2420949628 backends/x11/common: rename files to be more consistent 2022-07-24 13:05:13 +00:00
Xaver Hugl
ff0e89b030 backends/x11/standalone: rename files to be more consistent 2022-07-24 13:05:13 +00:00
Xaver Hugl
d251d33402 backends/drm: rename files to be more consistent 2022-07-24 13:05:13 +00:00
Xaver Hugl
24b1eab228 backends/wayland: rename files to be more consistent 2022-07-24 13:05:13 +00:00
Xaver Hugl
9d3561faf8 backends/virtual: rename files to be more consistent 2022-07-24 13:05:13 +00:00
Vlad Zahorodnii
50e99808e8 utils/udev: Drop Udev::listFramebuffers()
The fbdev backend was dropped so it's unused.
2022-07-24 09:23:35 +00:00
Xaver Hugl
6d1c97c4bc workspace: fix resize snapping
With the existing behavior there was a 1px gap between windows
2022-07-23 22:14:56 +00:00
Vlad Zahorodnii
045da603a4 Make backends part of libkwin
Platform backends are provided as plugins. This is great for
extensibility, but the disadvantages of this design outweigh the
benefits.

The number of backends will be limited, it's safe to say that we will
have to maintain three backends for many years to come - kms/drm,
virtual, and wayland. The plugin system adds unnecessary complexity.

Startup logic is affected too. At the moment, platform backends provide
the session object, which is awkward as it starts adding dependencies
between backends. It will be nicer if the session is created depending
on the loaded session type.

In some cases, wayland code needs to talk to the backend directly, e.g.
for drm leasing, etc. With the plugin architecture it's hard to do that.
Not impossible though, we can approach it as in Qt 6, but it's still
harder than linking the code directly.

Of course, the main disadvantage of shipping backends in a lib is that
you will need to patch kwin if you need a custom platform, however such
cases will be rare.

Despite that disadvantage, I still think that it's a step in the right
direction where the goal is to have multi-purpose backends and other
reusable components of kwin.

The legacy X11 standalone platform is linked directly to kwin_x11
executable, while the remaining backends are linked to libkwin.
2022-07-23 11:52:42 +00:00
Vlad Zahorodnii
0fbd5fa377 backends/virtual: Provide own logging.h file
target_sources() doesn't work as expected with generated source files.
2022-07-23 11:52:42 +00:00
l10n daemon script
acd5bf9a6e 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-07-23 01:47:37 +00:00
ivan tkachenko
df6331b60a effects/colorpicker: Fix picking colors
Due to the wrong buffer format, the function failed with
GL_INVALID_OPERATION error, which was silently ignored by the effect.
It resulted in the constant phantom color being returned over and over
again.

Co-Authored-By: David Edmundson <kde@davidedmundson.co.uk>
BUG: 454974
FIXED-IN: 5.24.7, 5.25.4, 5.26
2022-07-22 19:51:11 +00:00
Nate Graham
282e79c178 useraction: port away from DEF macros
Currently, defining shortcuts in useractions.cpp is done using one of
six macros, some of which allow the name that ends up as the key in
the config file to be autogenerated from an untranslated form of the
user-facing text.

Whenever a shortcut using one of these macros is renamed, the key in the
config file changes too, so users lose any custom shortcuts they had
assigned.

To avoid this, developers need to know that they have to switch to the
relevant macro that allows the name and description to be defined
separately, remember to do so, and manually set a name that matches the
old user-facing text. This can be forgotten, is not obvious to new
developers, and is a subtle source of user-facing bugs.

In addition the macros are largely unnecessary, as they are wrappers 
around a custom function. We can just call the custom function 
ourselves.

This commit ports away from the macros and calls the initShortcut()
instead, which resolves both issues.

cc @davidre
2022-07-22 16:50:25 +00:00
Volker Krause
9e8b370453 Adapt to Qt 6.3 API changes to QMutableEventPoint 2022-07-22 14:03:30 +00:00
Vlad Zahorodnii
1fccb3daf1 plugins/colord-integration: Expose outputs managed by Workspace
Workspace knows better about managed outputs, and it removes one more
dependency on Platform::enabledOutputs() and the corresponding signals.
2022-07-22 13:49:12 +00:00
Vlad Zahorodnii
82c1cf3de2 backends/drm: Pass DrmGpu to page flip handler through user data
The page flip handler can be simpler if it gets the gpu through user
data. It also removes a usage of the Application singleton.
2022-07-22 12:02:47 +00:00
Vlad Zahorodnii
e179d9cea1 Load plugins after Workspace is created
The original intention behind creating plugins before the workspace was
to handle the case where kwin_wayland may need to wait until outputs are
available. However, since things have changed a lot in that regard,
plugins can be loaded after the workspace now.

The main benefit behind this is that plugins can be simpler, they won't
need to track when the workspace is created.

On X11, plugins are already loaded after the workspace is instantiated.
2022-07-22 11:28:21 +00:00
Vlad Zahorodnii
211d0c00fc Remove unused main.h includes 2022-07-22 13:13:14 +03:00
Xaver Hugl
b6cf576efa move DecorationBridge singleton into Workspace 2022-07-21 15:24:57 +02:00
Xaver Hugl
7f1923cc9b move ApplicationMenu singleton into Workspace 2022-07-21 15:24:57 +02:00
Xaver Hugl
1cf2205283 move Activities singleton into Workspace 2022-07-21 15:24:51 +02:00
Xaver Hugl
f2ad6bcce9 move ColorManager singleton to Application 2022-07-21 15:16:40 +02:00
Xaver Hugl
9337f145d5 move InputMethod singleton to Application 2022-07-21 15:16:40 +02:00
Xaver Hugl
45d4677973 move PluginManager singleton to Application 2022-07-21 15:16:40 +02:00
Xaver Hugl
4121d45c42 backends/libinput: remove global state 2022-07-21 15:16:40 +02:00
Xaver Hugl
1ce7dc9e02 move FocusChain singleton into Workspace 2022-07-21 15:16:40 +02:00
Vlad Zahorodnii
0a7661c9df backends/drm: Remove DrmGpu::{outputEnabled,outputDisabled}
They are unused.
2022-07-21 12:35:51 +00:00
Vlad Zahorodnii
8ce8d9a330 Remove Application::isClosingX11Connection()
It's unused.
2022-07-21 13:18:35 +03:00
Vlad Zahorodnii
fb3787a4d7 Drop unused Application::platformCreated() signal 2022-07-21 08:43:50 +00:00
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.
2022-07-21 08:43:50 +00:00
Vlad Zahorodnii
724d6761cd backends/drm: Store desktop and non-desktop outputs in the same list
Now, the drm backend exposes all outputs. It's the job of the workspace
layer to filter out outputs it's not interested in.
2022-07-21 08:43:50 +00:00
Vlad Zahorodnii
8dabeb4709 backends/drm: Use DrmOutput to represent non-desktop outputs too
The main motivation behind this change is to make the drm backend
multi-purpose. That's it, to make it suitable for implementing all kinds
of compositors. At the moment, there's an artificial split between
"desktop" and "non-desktop" outputs, i.e. VR headsets, which stands in
the way of that and moving the remaining wayland code out of the drm
backend for better layering and architecture.
2022-07-21 08:43:50 +00:00
ivan tkachenko
1dddf271d2 x11: Inline condition to avoid potential extra call 2022-07-21 07:11:56 +00:00
David Edmundson
62cf7e8830 Only calculate surfaceInputTransformation when we have a surface 2022-07-20 22:00:36 +00:00
Vlad Zahorodnii
1c25c7101d Simplify Workspace::clientArea()
We don't need to look up unrelated areas, for example looking up the
screen area when we are after the work area.
2022-07-20 14:10:01 +00:00
Aleix Pol
4220e7ac25 wayland/tablet_v2: Keep also the pad surface in a QPointer
This way we make sure that we don't explode if for some reason the
surface is destroyed (e.g. it's closed).
This will make it work exactly like the other references to
SurfaceInterface.

BUG: 456817
2022-07-20 15:23:33 +02:00
Vlad Zahorodnii
c7af7adda6 x11: Hard-code 0 default screen
The screen number matters only on multi-head setups.
2022-07-20 11:37:57 +00:00
Vlad Zahorodnii
8f2748b1e1 Move udev.{h,cpp} to src/utils 2022-07-20 12:31:32 +03:00
David Redondo
6576a83aee Add outputlocator effect
An effect that implements the "identify" functionality of
the screen configuration kcm. It displays a label on each
screen that identifies the screen.
Doing this as a kwin effect allows to correctly handle
the case when outputs are mirrored (on wayland) compared to
absolute positioning of windows which end up on top of each other.
2022-07-20 07:01:05 +00:00
David Redondo
ab55c0276f Provide extra information about outputs to effects
Adds output manufacturer, model and serial number to EffectScreen.
2022-07-20 07:01:05 +00:00
David Redondo
499474ed66 Fetch and parse EDIDs on X11
This allows us to get more information about the outputs like vendor
and model and for example provide them to effects which might find
the extra info useful.
2022-07-20 07:01:05 +00:00