Commit graph

22926 commits

Author SHA1 Message Date
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
l10n daemon script
ff9bfc2e3b 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-20 01:44:06 +00:00
Vlad Zahorodnii
dd9b4aa37a backends/x11: Remove AbstractEglBackend::setSurface() call
KWin requires surfacesless contexts, so this setSurface() is not needed.
This ensures that makeCurrent() won't make the opengl context current
against a surface that belongs to a removed output.
2022-07-19 18:56:12 +00:00
Vlad Zahorodnii
42285bc659 backends/wayland: Remove AbstractEglBackend::setSurface() call
KWin requires surfacesless contexts, so this setSurface() is not needed.
This ensures that makeCurrent() won't make the opengl context current
against a surface that belongs to a removed output.
2022-07-19 18:56:12 +00:00
Eric Edlund
99913bab5d Make EffectWindowVisibleRef mandatory when refrencing window visibility in effects
This should prevent a stray visiblity unrefrence in an effect from crashing kwin.
2022-07-19 17:32:46 +00:00
Vlad Zahorodnii
b81f16fbd5 x11: Remove unused field in EglOnXBackend 2022-07-19 17:19:40 +03:00
Vlad Zahorodnii
4dd9b0f15b x11: Drop support for multi-head
The main reason to drop multi-head support is that it has been simply
unmaintained for many many years. When implementing a feature, we don't
even bother checking if multi-head is broken, KCMs don't handle
multihead, window management features are written for Xinerama. KWin
is optimized for Xinerama-like operation mode in general, which is
provided out of the box.

If you use multihead for esoteric gpu stuff, consider using kwin_wayland!
2022-07-19 11:44:00 +00:00
David Edmundson
80fb713787 Support keyboard navigation between windows across desktops
If a DesktopView doesn't handle a keyboard navigation event it
propagates to main which then focusses the next desktop view and the
relevant window.

Empty desktops can also be selected.

BUG: 456068
2022-07-19 10:35:09 +00:00
David Edmundson
00ba4aedcc Make DesktopView a FocusScope 2022-07-19 10:35:09 +00:00
David Edmundson
9152df4b4f Accept keys in windowheap conditionally
In WindowHeap we currently always accept the keyboard event regardless
of whether the event was handled.

This will allow the event to propagate to other handlers
2022-07-19 10:35:09 +00:00
David Edmundson
a61719ddc4 Accept keys in windowheap conditionally
In WindowHeap we currently always accept the keyboard event regardless
of whether the event was handled.

This will allow the event to propagate to other handlers
2022-07-19 10:14:47 +00:00
Xaver Hugl
e726779c9b manage plugins with std::unique_ptr 2022-07-19 08:42:22 +00:00
Xaver Hugl
dc4436a754 core: port a few things away from manual memory management 2022-07-19 08:42:22 +00:00
Vlad Zahorodnii
faa006d76f backends/x11: Manage X11WindowedQPainterOutput using std::unique_ptr 2022-07-19 07:51:46 +00:00
Vlad Zahorodnii
c74fa4b571 backends/x11: Port windowed backend from Screens 2022-07-19 07:51:46 +00:00
Vlad Zahorodnii
c414efc353 Stop unregistering org.kde.kwin dbus service
We don't use KApplication.
2022-07-19 10:21:04 +03:00
Vlad Zahorodnii
7d05cb7d79 Remove unused X11 kwin-specific properties
There are no seems to be any usages of these properties.
2022-07-19 10:20:59 +03:00
Aleix Pol
1cb2d38a64 activation: Be liberal about the StartupWMClass
Some apps (e.g. VirtualBox) are inconsistent there.
2022-07-18 21:00:24 +02:00
Aleix Pol
c68a0f5dc0 activation: Fix activation notification of Xwayland clients
Most xwayland clients don't know their desktop file name, so use the
StartupWMClass field in their desktop files as means to inferring their
desktop file name.

BUG: 455265
2022-07-18 19:58:03 +02:00
Aleix Pol
b2aacba086 activation: Simplify icon loading logic 2022-07-18 19:35:31 +02:00
Xaver Hugl
61b1eac5b8 platform, scenes: use std::unique_ptr for creation functions 2022-07-18 14:26:26 +00:00
Xaver Hugl
f50547de1e backends/drm: manage drm objects with std::unique_ptr
Also makes the connector detection code a bit more readable
2022-07-18 14:26:26 +00:00
Xaver Hugl
affa7386f8 backensd/drm: manage gpus with std::unique_ptr 2022-07-18 14:26:26 +00:00
Xaver Hugl
32c2ae15a4 backends/drm: manage drm properties with std::unique_ptr 2022-07-18 14:26:26 +00:00
Vlad Zahorodnii
aa739c59cf wayland: Make mapping from xinerama indices to Output correct
We assume that outputs in kwinApp()->platform()->enabledOutputs() are
stored in the xinerama order. However, this is not the case on Wayland
and it's not going to be changed because it increases the complexity.

This change makes Workspace::xineramaIndexToOutput() use Xinerama
extension API to map a xinerama index to the associated Output object.

With this, Xwayland applications will be able to put on outputs as
expected.

Note that xinerama indices are not cached because
Workspace::xineramaIndexToOutput() is not used in any hot code path. If
that changes, xinerama indices can be cached. The cache must be
invalidated whenever we get screens changed notify event from RANDR.
2022-07-18 13:52:58 +00:00
Vlad Zahorodnii
5a8beacd2b Drop Platform::findOutput()
Please, don't use integer ids to identify outputs!
2022-07-18 13:52:58 +00:00
Vlad Zahorodnii
fc58fbaa71 Add conversion helpers between xinerama indices and output objects
Currently, we implicitly assume that enabled outputs are stored in the
xinerama order, but with ongoing refactorings, it's easy to break that
assumption. Also, we are not going to change the DRM backend so it
stores enabled outputs in the xinerama order.

This change adds xinerama index conversion helpers in order to reduce
the number of potential regressions with output refactorings.
2022-07-18 13:52:58 +00:00
Vlad Zahorodnii
4790916fb1 x11: Fix shading with non-zero border
There was a geometry change that fixed mixing the next and current
geometries. While it did fix issues on wayland, it broke window shading
on x11 because of an obscure resize() call.

That obscure resize() had a side-effect that ensures m_clientGeometry
has the right value so the next time the window is unshaded,
implicitSize() will return a good value.

In order to make window size computation more robust, this change makes
X11Window compute the natural frame size based on cached size in
m_client, which shouldn't change when the window is shaded.

However, given how buggy window shading is and how difficult it is to
make it work right, I think that it's better to deprecate window shading
and remove it in some future release.

BUG: 450582
2022-07-18 11:39:06 +00:00
Vlad Zahorodnii
64c71a37a0 backends/virtual: Use #pragma once 2022-07-18 08:36:04 +00:00