Commit graph

22934 commits

Author SHA1 Message Date
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
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