Commit graph

24323 commits

Author SHA1 Message Date
l10n daemon script
705885b203 GIT_SILENT Sync po/docbooks with svn 2023-02-24 02:26:30 +00:00
Vlad Zahorodnii
711b6e36d2 effects/zoom: Fix rendering with mixed scale factors
When allocating offscreen texture, we should use screen's scale rather
than current render target's scale.

In addition to that, the cached vbo cannot be used for rendering on
other screens with different scale factors, which can happen.
2023-02-23 23:19:36 +00:00
Vlad Zahorodnii
a62dc13161 effects/magnifier: Reduce the number of heap allocations
Reserve enough of space for all vertices instead of dynamically
expanding the QVector to accommodate for new data.
2023-02-23 23:04:33 +00:00
Vlad Zahorodnii
42cff94f72 effects/magnifier: Fix rendering on multi screen setups
The projection matrix is constructed incorrectly, use the one provided
by the scene instead.
2023-02-23 23:04:33 +00:00
Vlad Zahorodnii
0dec5e3f20 Merge Window::client{Minimized,Unminimized} with Window::minimizedChanged
This merges Window::clientMinimized() and Window::clientUnminimized()
signals with the Window::minimizedChanged() signal to simplify some
code.

The avoid animation flag has been dropped because its main usage is to
avoid playing animation during window initialization. But it's not possible
to trigger minimize animation at that moment. API-wise it's better to avoid
having such flags too and rely on surface role to decide whether to play a
given animation.
2023-02-23 22:33:26 +00:00
Vlad Zahorodnii
84521ddb18 Use setMinimized() during window initialization
If setMinimized() is used during window initialization, no animation
will be played, so we could use setMinimized() instead of minimize()
that takes "avoid animation" boolean trap.
2023-02-23 22:33:26 +00:00
Vlad Zahorodnii
b53621136d Drop Window::desktopPresenceChanged()
This signal exists as a convenience helper, but it's not always emitted
as it's advertised to work. Instead of fixing it, let's drop the signal
to simplify virtual desktop code. Its effects can be accomplished by
monitoring Window::desktopChanged() and VirtualDesktopManager::currentChanged()
signals in effects and scripts where needed.
2023-02-23 22:10:37 +00:00
Aleix Pol Gonzalez
a60c3130e3 backends/drm: Make sure attributes are always initialized
It only gets set on specific cases and assumes false as default anyway.
kwin/src/backends/drm/drm_gpu.cpp:691:12: runtime error: load of value 190, which is not a valid value for type 'bool'
2023-02-23 21:52:01 +00:00
Xaver Hugl
5f0ea95bfa backends/wayland: fall back to qpainter when there's no render node
While we could still access the primary node, as we're not getting GPU acceleration
anyways we might as well fall back to CPU rendering directly

BUG: 466302
2023-02-23 19:46:19 +01:00
Vlad Zahorodnii
017bb6d3c8 scripting: Drop Window.desktop property 2023-02-23 16:41:30 +02:00
Vlad Zahorodnii
ecb58c987f scripting: Drop Window.x11DesktopIds property 2023-02-23 14:25:02 +00:00
Aleix Pol
150b098ba7 screencasting: Minimise pixel format conversions while streaming
Instead of best-guessing, at BGR (which in retrospect was a bad guess),
offer whatever resembles most the internal representation. This way the
frame gets to be least treated as it goes into the client.
2023-02-23 14:11:41 +00:00
Harald Sitter
4fcc545628 backends/x11: explicitly free the outputs
...before releasing the connection!

this was randomly causing crashes because of use-after-disconnect
problems. since we would tear down the connection in ~X11WindowedBackend
but outputs wouldn't get cleaned up until QObject children cleanup of
the X11WindowedBackend object (or more precisely the OutputBase). this
would then result in ~X11WindowedOutput accessing a backend connection
that had already been closed

to help debug this type of problem moving forward let's also reset the
connection to nullptr during destruction. it's kinda pointless but it
makes it easier to spot use-after-disconnect

BUG: 466183
2023-02-23 13:50:00 +00:00
Vlad Zahorodnii
08e392f368 Revert "wayland: Update shadow immediately"
This reverts commit 4b1ef33c1e.

It introduced a crash. The large icons task switcher can create and
destroy the shadow in the middle of painting. When a shadow is
destroyed, kwin can make opengl context current. It will reset current
QOpenGLContext, and QtQuick can crash.

BUG: 466279
2023-02-23 12:48:11 +00:00
Vlad Zahorodnii
a2062090eb Rename interactive move resize lifecycle signals
Add the "interactive" word to be consistent and put "started",
"stepped", and "finished" at the end of signal names where they are more
expected.
2023-02-23 11:38:34 +00:00
Vlad Zahorodnii
8bb2d52972 Rename Window::clientMaximizeStateChanged signal
Make it shorter to be more readable.
2023-02-23 09:17:47 +00:00
Vlad Zahorodnii
88c974835c Drop duplicate clientMaximizedStateChanged signal 2023-02-23 09:17:47 +00:00
Vlad Zahorodnii
7f4071c7d4 Drop Window::addWorkspaceRepaint
It's used only by window elevation logic, but it can be moved inside
libkwineffects. It should also fix missing repainting in scripted effects.
2023-02-23 07:40:26 +00:00
l10n daemon script
911138f9db GIT_SILENT Sync po/docbooks with svn 2023-02-23 02:30:03 +00:00
l10n daemon script
5d60f218d4 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"
2023-02-23 02:01:06 +00:00
Vlad Zahorodnii
da26deaa5c backends/libinput: Fix crash upon receiving motion absolute events
The input events can be processed when the workspace is not available,
e.g. during startup or shutdown, so add a corresponding guard.

As a long term plan, we need to decouple Workspace from low-level input
backend parts, but it will be a too invasive change for now.

BUG: 449317
BUG: 465456
2023-02-22 21:39:14 +02:00
Xaver Hugl
520fa3042a pointer input: always confine pointer to screens
Checking if the pointer needs to be confined before doing `std::clamp` on
the position is useless and causes problems. With this change, the pointer
will always be confined to exactly the screen, without any fractional offsets.

BUG: 461911
2023-02-22 19:01:22 +00:00
Vlad Zahorodnii
4b1ef33c1e wayland: Update shadow immediately
Updating OpenGL textures no longer takes place immediately.
2023-02-22 14:53:26 +00:00
Vlad Zahorodnii
bc0502b3ca effects: Fix selecting hidden windows using keyboard
WindowHeapDelegate used to have hidden property. It was renamed to
activeHidden, but WindowHeap has not been adjusted to the new name.

BUG: 466120
2023-02-22 11:53:47 +00:00
Vlad Zahorodnii
0e906ec182 scene: Decouple scene bits from Shadow class
Currently the Shadow class is scene specific, which adds coupling
between Window and scene bits.

This change introduces ShadowTextureProvider that contains scene
specific stuff so the Shadow acts like a data source and is not coupled
to concrete scene.
2023-02-22 10:07:41 +00:00
Vlad Zahorodnii
21d410710c Fix coding style issue 2023-02-22 09:29:06 +02:00
l10n daemon script
48289c33ae GIT_SILENT Sync po/docbooks with svn 2023-02-22 02:15:23 +00:00
Adam Williamson
779005f1d2
feat: allow VT switching even with global shortcuts disabled 2023-02-21 23:10:28 +01:00
Vlad Zahorodnii
e0062f675d Port away from QRectF::contains()
QRectF::contains() considers right and bottom edges inside the
rectangle, but the relevant code has the opposite expectations.
2023-02-21 19:45:51 +00:00
Nicolas Fella
bae75abf6d Remove unneeded X-KDE-ParentApp from KCM metadata 2023-02-21 17:36:54 +00:00
Aleix Pol
8c86648172 inputmethod: Give text input managers a parent
Otherwise they linger forever
2023-02-21 15:26:48 +00:00
Nicolas Fella
a1639da6e5 [kcm/common] Port EffectsModel away from KPluginMetaData::metaDataFileName
It's gone in KF6

It's only used to obtain the install location of the package and resolve files relative to that

Use QStandardPaths to locate those files directly
2023-02-21 14:55:28 +00:00
Vlad Zahorodnii
2de5236e3f scene: Ensure there's current opengl context when DecorationItem is repainted for last time
BUG: 466186
2023-02-21 13:22:15 +00:00
Aleix Pol
93815aede4 screencasting: only invert the texture manually when it's not marked as inverted
In the cases where isYInverted(), the texture will be properly placed.
It's only when not that we need to mirror it vertically.
2023-02-21 12:22:20 +00:00
Aleix Pol
1be2b8868c wayland_egl: Reuse the texture we already have for textureForOutput 2023-02-21 12:22:20 +00:00
Vlad Zahorodnii
c24a5f0395 effects/glide: Fix transform
Translation should be in logical pixels.

BUG: 465849
2023-02-21 11:54:34 +00:00
David Edmundson
01fd54d753 Aurorae: Add dummy window for working device pixel ratio
Aurorae uses a QQuickWindow that receives an implicit scale through the
QPA. Unfortunately there's a known quirk with device pixel ratio not
being followed when offscreen surfaces are never shown and an
independent render control is used.

Without this QQuickRenderControl::grab ends up using a buffer the size
of the window * dpr, but with the contents rendered at 1x in the corner
along with incorrect device pixel ratio information.

This patch copies a used solution from EffectQuickView. This can be
resolved more neatly with newer Qt.

BUG: 452730
BUG: 465790
2023-02-21 11:07:33 +00:00
David Redondo
38cd1fc491 scripting: Mark QObjects returned from invokables as having C++ ownership
Otherwise the script engine may delete them if they have no parent and
there are no more references to them.
2023-02-21 11:12:08 +01:00
Vlad Zahorodnii
18d6159be1 tiling: Make child tiles inherit padding from parent tile
If a new tile is added, make it inherit parent tile's padding to ensure
consistent padding.

BUG: 465842
2023-02-21 09:22:19 +00:00
Arjen Hiemstra
edbbe996d3 effects/contrast: Round device coordinates when creating geometry
Since normal geometry is now rounded, we need to make sure to round
anything that should match that geometry, otherwise we risk things
peeking out of the normal geometry.

BUG: 464526
2023-02-21 07:50:53 +00:00
l10n daemon script
996a0c05fa GIT_SILENT Sync po/docbooks with svn 2023-02-21 02:28:10 +00:00
l10n daemon script
6a5d809f81 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"
2023-02-21 02:04:35 +00:00
Xaver Hugl
4cd25cf571 cursor: make position, hotspot and size floating point
This allows all pixel positions to be used on high dpi screens,
and corrects damage tracking with Xwayland cursors

CCBUG: 466094
2023-02-20 21:01:39 +00:00
David Redondo
7366545d0f Move Layer and QuickTile enum to kwinglobals.h
Q_NAMESPACE can ever only be used once for a namespace otherwise
there will be multiple defintions of the staticMetaObject.
2023-02-20 20:22:26 +00:00
Xaver Hugl
81571203f1 cursorsource: fix scaling with Xwayland
Before this commit, the device pixel ratio of the cursor was set to ignore
the Xwayland scale override, while the size of the cursor surface was scaled.
This change removes the scaling of the cursor surface size, to make the cursor
be no longer cut off in rendering.

BUG: 466094
2023-02-20 19:50:30 +01:00
Xaver Hugl
3334fb8752 cursordelgate: round cursor position when rendering
Otherwise there can be weird artifacts when screen scaling is involved
2023-02-20 16:22:24 +01:00
David Redondo
264a19247b Mark Window as damaged when decoration or shadow changes
Enforms thumbnails, screencasts and effects of these changes and
that the window needs repainting.
BUG:464417
FIXED-IN:5.27.1
2023-02-20 11:55:22 +01:00
David Edmundson
ada8e40792 outputchangeset: Round passed scale
Converting to wl_fixed is lossy. Especially for non-round values like 1.15.

This causes various visual glitches and off sizes.

Given we're using units of 120ths for the fractional scale protocol it makes sense
to fix the passed values for anything else over the wayland protocol.

BUG: 465850

Testing done:
ran a 1920 screen at 1.15 scale, got a logical size of 1670 which matches what it should be
2023-02-20 10:02:06 +00:00
l10n daemon script
6d25104849 GIT_SILENT Sync po/docbooks with svn 2023-02-20 02:29:21 +00:00
l10n daemon script
d5207b95c8 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"
2023-02-20 02:04:26 +00:00