Commit graph

20534 commits

Author SHA1 Message Date
Vlad Zahorodnii
337261bbf7 effects/slidingpopups: Remove slide manager global with a delay 2021-11-22 17:04:56 +00:00
Vlad Zahorodnii
be183cd55b effects/contrast: Schedule contrast manager removal with a delay
This prevents flickering behind plasma panels after changing compositing
settings.

If the contrast effect is disabled, the destructor of the ContrastEffect will
start the contrast manager remove timer. When it expires, the contrast manager
global will be removed and it will be finally destroyed after 5s (to work
around the wl_global race condition).

If compositing is toggled, the destructor of the ContrastEffect will start
the remove timer and the constructor of the ContrastEffect will stop the
timer, the contrast manager object will be unaffected.

The contrast effect has no options that could affect the shader, so the
reconfigure() method was removed.
2021-11-22 17:04:56 +00:00
Vlad Zahorodnii
76db5d76e7 effects/blur: Schedule blur manager removal with a delay
This prevents flickering behind plasma panels after changing compositing
settings.

If the blur effect is disabled, the destructor of the BlurEffect will
start the blur manager remove timer. When it expires, the blur manager
global will be removed and it will be finally destroyed after 5s (to work
around the wl_global race condition).

If compositing is toggled, the destructor of the BlurEffect will start
the remove timer and the constructor of the BlurEffect will stop the
timer, the blur manager object will be unaffected.

The blur effect options don't affect the generated shader code, so the
shader status check was removed in reconfigure().
2021-11-22 17:04:56 +00:00
David Edmundson
190a92bc3f set EGL_NV_robustness_video_memory_purge where applicable
This enables kwin to get notified when a memory has been lost in the
system, allowing the driver to purge all the memory and have kwin create
new contexts.

This matches what we do on GLX.
2021-11-22 14:00:37 +00:00
David Edmundson
8febb1f343 Check for extensions in logic for global contexts
The current code for creating the root shared context is very naive and
does not take into account aspects like robustness or versions.

It is not always possible to mix attributes, in particular robustness
meaning we are unable to opt into these features in future contexts.

This refactors everything to use a common path to make all contexts.
2021-11-22 14:00:37 +00:00
Xaver Hugl
c4dcbb40d6 properly fix bsd build 2021-11-22 13:15:01 +00:00
Ismael Asensio
5e17de0ffd kcm/kwinrules: Port away from DelegateRecycler
We want to port from this compontent in general, as the ListView can reuse items
directly and it's a bit less bug-prone.

CCBUG: 445806
FIXED-IN: 5.24
2021-11-22 12:48:38 +00:00
Xaver Hugl
912b7d0b02 fix freebsd build 2021-11-22 13:36:57 +01:00
Xaver Hugl
c4d50e984f backends/drm: drop some unused stuff in DrmGpu 2021-11-22 11:30:31 +00:00
Xaver Hugl
95f64a7ac7 backends/drm: drop DrmBackend as a friend of DrmOutput
It's unused
2021-11-22 11:30:31 +00:00
Xaver Hugl
cd8a7ac0b0 backends/drm: don't make DrmGpu a friend of DrmOutput
Making the constructor and updateModes private isn't necessary
2021-11-22 11:30:31 +00:00
Xaver Hugl
6cea76bfaf backends/drm: inline DrmPipeline::updateProperties
It's only used in one place
2021-11-22 11:30:31 +00:00
Xaver Hugl
3e24bc008a backends/drm: force soft cursor if image creation fails
If the soft cursor is only set but not forced then KWin will try to update
cursors again, making it go into code paths that will crash.

BUG: 445507
2021-11-22 08:43:29 +00:00
Xaver Hugl
50c39e202b backends/drm: properly check for vrr property with legacy
BUG: 445907
2021-11-22 09:00:50 +01:00
Alexander Lohnau
468acd0cbe Fix determining of scripted effect config from KPluginSelector
In the KPluginSelector we don't have the possibility to set the args for
each KCM. Because of that we use the metadata of the KPluginFactory as a
fallback to read the plugin keyword, which specifies the KCM we want to display.

This requires kcmutils 54b196a9bad88732debe0b49111af4755268f09f, which landed in the last release.

BUG: 445667
2021-11-22 07:48:37 +00:00
l10n daemon script
16d473a326 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-11-22 01:30:44 +00:00
l10n daemon script
f07c66f040 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-11-20 01:25:15 +00:00
Vlad Zahorodnii
045c1337a9 effects/overview: Make Esc key handling more intuitive when searching
The person that added krunner search integration uses vim. It seemed
intuitive to that person that the Escape key should quit the search mode
instead of quitting the effect. But it seems like more intuitive thing
is to actually stop the effect.

BUG: 445708
2021-11-19 15:27:30 +00:00
Vlad Zahorodnii
17dbdf89bd effects/overview: Prevent WindowHeap accepting mouse events while searching
If the opacity property is set to 0, the item will still receive mouse
events. One either needs to set the enabled or the visible property to
false to ensure that the WindowHeap receives no mouse events.

The reason for setting the opacity to 0 instead of the visible property
to false was that I thought later will nuke the paint node, but it seems
like that's not the case.

BUG: 445707
2021-11-19 15:27:30 +00:00
Vlad Zahorodnii
35c6a3c0a1 effects/overview: Set Qt.ClosedHandCursor cursor shape during dnd
Many apps change the cursor shape during active dnd, do the same here
for the consistency sake.
2021-11-19 15:12:03 +00:00
David Edmundson
38348a006b [backends/x11] Fix typo causing crash 2021-11-19 13:20:48 +00:00
Vlad Zahorodnii
35b9950eb9 effects/overview: Implement internal implicit grab logic
This is needed to ensure that mouse release events go to the view that
received mouse press events; otherwise some views can get stuck in a
state thinking that button xyz is pressed.
2021-11-19 10:57:59 +00:00
Vlad Zahorodnii
caa62fa736 effects/overview: Sync cursor set by QtQuick
Currently, cursor shape set by QtQuick is not sync'ed, which can be seen
as the pointer not changing its shape to i-beam when hovering the search
field.
2021-11-19 10:53:26 +00:00
Vlad Zahorodnii
379ae2d5c2 effects/overview: Reuse qml loading results between effect activations
Currently, every time you launch the overview effect, QtQuick will go
out and parse QML files. With the overview effect gaining more features
and the code size getting bigger, it takes more time for the overview to
present the first frame after it got triggered.

With this change, the overview effect will keep the ScreenView
QQmlComponent object around that can be used to avoid reparsing qml code
every time the overview effect is launched.

It also ports the Overview effect from de-facto deprecated qml context
to initial properties, which yield slightly better startup times.

BUG: 445666
2021-11-19 10:52:45 +00:00
Vlad Zahorodnii
20aeff20ea Fix build
idOffset is a static const variable, it doesn't need to be captured.
2021-11-19 11:09:29 +02:00
Arjen Hiemstra
310ef5e1c2 Add support for touch events to Overview effect
Implement touchUp/touchMotion/touchDown and forward them to the
EffectQuickView.
2021-11-19 09:04:23 +00:00
Arjen Hiemstra
626e4bc7e6 Add support for forwarding touch events to EffectQuickView
This allows effects to support touch input.

Unfortunately, Qt's TouchEvents require the full touch point state,
whereas KWin's internal touch handling only deals with one point at a
time. So we need to keep track of the touch state in EffectQuickView and
pass that on to Qt. Additionally, we need a QTouchDevice as lots of Qt
code depends on it.
2021-11-19 09:04:23 +00:00
David Edmundson
044767e296 Speed up EffectQuickView teardown
On my Nvidia machine there was a massive lag exitingthe overview effect.
Hotspot showed it as being in QOpenGLVertexArrayObjectPrivate::destroy.
In this method we clean up some shared objects used in the context when
the context closes.

In order to do this we need the context to be current. If it is not
current Qt currently internally creates a temporary offscreen surface.

To fix this we need to have our context current during destruction,
which includes changing order so it is destroyed before the surface.
2021-11-19 08:09:39 +00:00
Vlad Zahorodnii
030cc2d844 effects/overview: Add basic keyboard navigation support in DesktopBar
With this change, user will be able to press Tab and use Enter, Delete,
and F2 keys to activate, remove, and rename virtual desktops, respectively.

Co-authored: Fushan Wen <qydwhotmail@gmail.com>
2021-11-19 07:00:08 +00:00
Aleix Pol
afd525ced0 Improve our reaction when primary changes
Ensure we sanitise the input so a client can't randomly crash KWin that
way.
2021-11-18 17:48:39 +00:00
Vlad Zahorodnii
039b1d031e wayland: Enable window rules for all xdg-toplevel
If a window wants to be initially shown in fullscreen mode, it will
issue an xdg_toplevel.set_fullscreen request before the first surface
commit.

If a window wants to be shown in fullscreen mode and there hasn't been
any first surface commit, kwin will cache the request and apply
fullscreen mode when checking window rules in the initialize() function.

On the other hand, window rules are disabled for plasma surfaces. The
motivation behind that was to forbid user from messing with plasma's
surfaces (this change was suggested during redesign of xdg-shell
implementation).

As it turns out, there are cases where plasma may ask to show a window
in fullscreen mode, which also has a plasma surface installed, e.g.
fullscreen application dashboard.

In order to fix the dashboard, this change allows window rules to be
applied to xdg-toplevel windows that also have plasma surfaces installed.

As is, xdg-toplevel surfaces and plasma surfaces are very different in
nature. Adding more quirks to handle plasma surfaces in
XdgToplevelClient is not worth the effort and there are better
alternatives, e.g. layer-shell.
2021-11-18 10:16:25 +00:00
Vlad Zahorodnii
262cb23dd9 effects/overview: Use PlasmaCore.ColorScope.backgroundColor in DesktopBar with light desktop themes 2021-11-18 07:26:33 +00:00
Vlad Zahorodnii
c167ef5208 effects/overview: Remove window caption drop shadow effect 2021-11-18 07:26:33 +00:00
Vlad Zahorodnii
555a8018fc effects/overview: Make text in desktop bar have the same color as in search results 2021-11-18 07:26:33 +00:00
Vlad Zahorodnii
4f04da4e7a effects/overview: Bump underlay opacity to 0.75
This improves contrast when searching using Milou.
2021-11-18 07:26:33 +00:00
Vlad Zahorodnii
195de46c91 effects/overview: Use Milou for search results
Based on user feedback, it will be great to have krunner functionality
integrated in the overview/present windows effect.

This change ports the overview effect to Milou for search results. With
it, one can search for existing windows or launch new applications.

BUG: 445207
2021-11-18 07:26:33 +00:00
Aleix Pol
a5899c2cbb screencast: Do not report a cursor geometry before we have a cursor texture
Otherwise we just crash as we don't know the size yet.
2021-11-18 03:02:19 +00:00
Aleix Pol
19df0996f5 scene: Do not clamp 1x1 windows
Without the margins, they become 0x0 and we crash.
2021-11-17 16:01:16 +00:00
Vlad Zahorodnii
e21a3c7955 effects: Add support for cross-compiling support
kwin-strip-effect-metadata needs to run on the host. First, one needs to
build it, e.g.

    cmake --build build-native --target kwin-strip-effect-metadata

then when cross-compiling, point cmake to the native build directory, e.g.

    cmake -DKWIN_HOST_TOOLING=${path}/build-native
2021-11-17 14:40:41 +00:00
Vlad Zahorodnii
a6090e7f83 effects: Strip unused builtin effect metadata
This improves plugin loading times. As is, the main issue is the number
of builtin effects and the fact that each has a lot of translated
strings, which combined adds up to noticeable loading times. KWin itself
will never read those translated strings, it only needs two pieces - the
plugin id and whether the plugin is enabled by default.

This change adds a little helper to strip unnecessary info from metadata
files.
2021-11-17 14:40:41 +00:00
Vlad Zahorodnii
068d60e36a Revert "wayland: Check workspace position when preferred deco mode changes"
This reverts commit 2560288e4b.

It broke alacricitty. The fix is not obvious, so revert the commit for
the time being.

BUG: 445444
2021-11-17 06:58:30 +00:00
Xaver Hugl
8528bbf800 backends/drm: ignore placholder outputs for the output config
They can only introduce intermediary state when a real output gets enabled
and are not relevant to the actual output config
2021-11-16 17:08:08 +01:00
Xaver Hugl
b6b0af727d backends/drm: don't take crtcs from dpms disabled outputs
Fixes a crash I have with dpms + suspend, which was caused by the udev
event for updating outputs being called before the output got enabled
again. When DrmGpu::updateOutputs got called it removed the crtc from
the inactive output and then disabled the output afterwards. Instead,
only remove crtcs if an output is really disabled.
This also allows to generalize the logic for lease outputs, and could
in the future allow for faster dpms on/off switching.
2021-11-16 17:05:31 +01:00
Xaver Hugl
47d5d50bdf backends/drm: don't assume we have a cursor plane
CCBUG: 445507
2021-11-16 16:16:30 +01:00
Vlad Zahorodnii
e605ea0c46 effects/blur: Fix tracking of blur region after compositing restart
updateBlurRegion() doesn't setup a
SurfaceInterface::blurChanged() signal connection. slotWindowAdded()
does that.
2021-11-16 13:57:31 +02:00
Vlad Zahorodnii
6234357675 effects/contrast: Fix tracking of contrast region after compositing restart
updateContrastRegion() doesn't setup a
SurfaceInterface::contrastChanged() signal connection. slotWindowAdded()
does that.
2021-11-16 13:56:27 +02:00
Vlad Zahorodnii
7228e9aefd Unify beginFrame() and endFrame() hooks for OpenGL and QPainter backends
This unifies frame hooks for OpenGL and QPainter render backends. There
are a couple of reasons why it's a good idea - it provides one mental
framework to start painting a frame, the Compositor will be able to
start and submit frames. The last one is very cool because it gives the
Compositor more power over compositing.

Besides unifying frame hooks, this cleans up a bit the arg naming mess
in endFrame(). As is, "damage" and "damagedRegion" are very confusing
names. "damage" arg has been renamed to "renderedRegion," because that's
what it is. The renderedRegion arg specifies the region that has been
repainted by the Scene. It's different from the damagedRegion as that
one specifies the surface damage, i.e. the difference between the
current and the next frame, while the renderedRegion may include a
region that had to be repainted to repair the back buffer. The main
reason why we need renderedRegion is the X11 platform. On Wayland, it's
unused.

In the future, we will need to extend this api with output layers.
2021-11-16 10:43:56 +00:00
Vlad Zahorodnii
aaf88cd906 scenes/opengl: Keep lanczos filter after changing outputs
The lanczos filter checks the screen size before rendering in
LanczosFilter::updateOffscreenSurfaces(), so this is not needed.

This simplifies lifetime handling of the lanczos filter, e.g. we
don't need to bother with opengl context anymore, and makes the
scene use less Screens' features.
2021-11-16 10:42:58 +00:00
Vlad Zahorodnii
af4c37c095 plugins/screencast: Rename PipeWireStream to ScreenCastStream
This change renames the PipeWireStream class to ScreenCastStream to make
naming consistent.
2021-11-16 09:04:10 +00:00
David Redondo
5d5780c770 Remove manual lnf default handling
This is now correctly set up when inside a plasma session.
2021-11-16 08:27:42 +00:00