Commit graph

6013 commits

Author SHA1 Message Date
Vlad Zahorodnii
9692c65390 Drop "sub-feedback" concept in PresentationFeedback
This gets rid of the container feedback to simplify presentation
feedback organization.
2023-11-14 14:58:40 +00:00
Vlad Zahorodnii
79d5a70c01 wayland: Make SurfaceInterface::{frameRendered,takePresentationFeedback} not touch subsurface tree
This gives us greater flexibility and in general more cleaner code.
2023-11-14 14:58:40 +00:00
Weng Xuetian
9e047059c1
Add isInputMethod in EffectWindow and do not dim input method window 2023-11-14 06:29:51 -08:00
Vlad Zahorodnii
aabc162632 x11: Unload effects before destroying Workspace and Compositor
Effects can hold references to closed windows, which can cause problems
after the workspace is destroyed.

This change makes ApplicationX11 unload effects before destroying the
Workspace and the Compositor similar to how it's done in main_wayland.

BUG: 475511
2023-11-14 15:51:03 +02:00
Xaver Hugl
75304afe0f backends/drm: only disallow direct scanout with mismatching color descriptions
Generically disabling it with color management is a bit overkill
2023-11-14 14:17:37 +01:00
Xaver Hugl
38575ac33d backends/drm: re-allow the hardware cursor with color management
It doesn't look wrong anymore, presumably what caused it to look wrong before
was just a bug. Blending in sRGB or PQ is still technically wrong, but it
looks okay, and that's an acceptable tradeoff to make in order to get the
responsiveness and power usage improvements the hardware cursor offers
2023-11-13 20:49:22 +01:00
Natalie Clarius
5ee2d53561 rename user facing name 'Night Color' -> 'Night Light'
This 1. is more familiar terminology as on other platforms (Gnome, Android); 2. avoids confusion with a planned future day/night light/dark color scheme switcher.
2023-11-13 15:53:29 +00:00
Xaver Hugl
869e86ff00 backends/drm: disable buffer readability checks on Intel
They cause stutters and reduced frame rates on some Intel laptops because the
buffers don't become readable in time, so disable the checks until that's fixed
on the driver side. For debugging purposes, the environment variable
KWIN_DRM_DISABLE_BUFFER_READABILITY_CHECKS can be used to override the default
behavior.

BUG: 476860
2023-11-13 14:33:44 +00:00
Xaver Hugl
93443a8228 backends/drm: set the correct content transform for shadow buffer
BUG: 476931
2023-11-13 13:44:54 +00:00
Xaver Hugl
7bf38e54bf wayland: implement presentation time 2023-11-13 14:25:26 +01:00
Xaver Hugl
46f8bfcf7b dpmsinputeventfilter: don't filter out key release events
If the release event is filtered out, the rest of the system thinks the
button is still pressed, even though it isn't
2023-11-13 13:05:12 +00:00
Xaver Hugl
2a3068b14e workspace: ignore placeholder output for dpms
This doesn't fix any issues, but it's not necessary to destroy and then
re-create the dpms filter just because of the placeholder output
2023-11-13 13:05:12 +00:00
Nathan Garside
3662c75a53 tiling: update ui on shift press/release 2023-11-13 12:31:17 +00:00
Harald Sitter
b8fb43db95 pointer_input: position cursor on the primary output after a placeholder
this improves the out of the box behavior which has regressed a bit over
time. since we default to kcfg_ActiveMouseScreen=true the active screen
by default follows the pointer. during early startup we position the
pointer on a Placeholder output, this output does eventually get
replaced by the real output(s). because of the update logic we'd
re-position the pointer on the closest real output, but that isn't
necessarily the intended primary output.

e.g. consider an eDP + HDMI setup depending on the geometries involved
the cursor may end up on the HDMI screen by default rather than the eDP
resulting in plasma-welcome opening on the HDMI output.

to mitigate this problem we now track whether the last output was a
placeholder and if so we instead try to position the pointer on the
current primary output
2023-11-13 11:34:09 +00:00
Vlad Zahorodnii
0b8b9b70bb Merge EffectWindowImpl with EffectWindow
The indirection no longer required because libkwineffects has been
merged with libkwin. EffectWindow will be eventually dropped in favor
of apis provided by Window and WindowItem.
2023-11-13 11:24:04 +00:00
David Edmundson
4016406e1e wayland: Drop isTrustedOrigin check
The rationale behind the check was sandboxed apps could have a different
mount namespace to kwin, therefore lying about the executable path was
doable.

Moving forward anything sandboxed will have a security context app Id.
Anything not sandboxed can circumvent these checks anyway.

This significantly improves application launch time.
2023-11-13 10:41:35 +00:00
David Edmundson
aec896acc0 wayland: Prefer security context appId for permission lookup where available
The security context appId is set by the launching container (i.e
flatpak) and is therefore more trustworthy than any other source of
application ID.

Use this when looking up allowed wayland extensions.
2023-11-13 10:41:35 +00:00
David Edmundson
4f9531ad77 Support SecurityContextManagerV1
This allows KWin to securely identify the client for a given connection,
without relying on the process name.

This patch does not do anything meaningful with the application ID other
than store it.

This first version does not support kwin restarts, it can come
afterwards.

Testing done:
With latest flatpak, running `WAYLAND_DEBUG=1 flatpak run org.telegram.desktop |& grep security`
shows that flatpak itself bound the security context, and the client did not see it advertised.
2023-11-13 09:51:28 +00:00
l10n daemon script
e772428180 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-11-13 02:07:54 +00:00
Fushan Wen
b7e30f2804
main_x11: use QBAV more
to reduce allocations.
2023-11-12 11:25:39 +08:00
l10n daemon script
ba55a6cb55 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-11-12 02:07:55 +00:00
l10n daemon script
472956b4fa 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-11-11 02:13:54 +00:00
Natalie Clarius
a5d1646590 plugins/nightcolor: expose daylight property in DBus interface
So that the applet can provide more detail about the current status, now that there is a configurable day time temperature.
2023-11-10 16:38:05 +00:00
Xaver Hugl
04766c384a outputconfigurationstore: handle missing EDID identifiers correctly 2023-11-10 16:50:31 +01:00
Xaver Hugl
fde1393076 outputconfigurationstore: invalidate duplicate output entries
The configuration file may contain entries that have the same output identifiers if
there's a bug in the implementation. To repair the config, this commit checks for
duplicate entries in the output list and removes them when loading the config file.
2023-11-10 16:50:31 +01:00
Xaver Hugl
0a844c2bde outputconfigurationstore: fix repairing the output list 2023-11-10 16:50:31 +01:00
Xaver Hugl
bd6b946a7e utils/edid: log a warning when parsing fails 2023-11-10 16:50:31 +01:00
Vlad Zahorodnii
7b5ac472c9 libkwineffects: Make OffscreenQuickView opaque
OffscreenQuickView replaces the contents of the default scene. Nothing
will be repainted beneath it.

On the other hand, if the OffscreenQuickView contains translucent region,
there might be visual glitches. To prevent that, this change makes
scene effect views opaque.
2023-11-10 09:07:04 +00:00
Vlad Zahorodnii
7478c81a48 libkwineffects: Add alpha channel option in OffscreenQuickView
We want some quick views to be opaque, for example SceneEffect views.
This changes adds an api allowing to specify whether the given
OffscreenQuickView must be opaque or translucent.
2023-11-10 09:07:04 +00:00
Alexander Lohnau
22dfc8978e Adjust to removed QueryMatch::Type enum in KRunner 2023-11-10 07:11:44 +01:00
Xaver Hugl
acba91672b backends/drm: fix typo 2023-11-09 15:53:08 +01:00
Xaver Hugl
d24edc7890 backends/drm: ensure correct colors with direct scanout of NV12 buffers
If another compositor changes the color encoding and color range properties, the
resulting colors will be wrong. This commit ensures they're always set to BT.709
limited range to prevent that
2023-11-09 12:16:17 +00:00
Xaver Hugl
c1312a5551 backends/drm: fix pageflip events getting lost when outputs get turned off
When a display gets turned off while a pageflip event was still pending, the pending
state gets changed immediately, without waiting for the pageflip event to arrive first.
When this happens, activePending() returns false, and so the pageflip event gets discarded.
This commit changes the logic to only check for activePending() when the pageflip is for a
modeset, avoiding that issue.

BUG: 476340
BUG: 476341
BUG: 476342
BUG: 437520
BUG: 475146
2023-11-09 11:35:19 +00:00
l10n daemon script
e2d072afec 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-11-09 02:08:31 +00:00
Xaver Hugl
bdc62b3516 backends/drm: ensure icc profiles aren't applied with HDR
ICC profiles don't support HDR yet, and they don't make a lot of sense with
how unpredictable displays behave with BT2020 and/or PQ inputs
2023-11-09 01:42:10 +00:00
Nate Graham
cdadf7cf7f Access ShadowedLabel from PlasmaExtras
That's where it's been moved to; see
https://invent.kde.org/plasma/plasma-framework/-/merge_requests/951.
2023-11-08 13:26:22 -07:00
Aleix Pol Gonzalez
6cac17aac0 GLShader: Use floating point values to interact with vectors
Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
2023-11-08 17:07:37 +01:00
Aleix Pol Gonzalez
7b64433830 GLShader: Fix sdrBrightness into float
It's used as a float and otherwise it makes (some?) drivers very
confused as they're required to cast at runtime.
The original value is double so it makes sense to keep the same type.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
2023-11-08 16:46:45 +01:00
Xaver Hugl
15080192f7 Remove latency policy and render time estimator settings
As KWin measures render times properly now, these settings and estimations
should no longer be necessary, so this commit replaces them with one hardcoded
algorithm that should prevent most dropped frames and reduce latency
2023-11-08 13:29:29 +00:00
Vlad Zahorodnii
d52ba8c3fe wayland: Fix transaction cleanup with destroyed surfaces
When sorting surfaces in the ancestor order we need to ignore null
surfaces.

In addition to that, we also need to properly handle the case where
a transaction with dependencies is unlocked and it contains null
surfaces.

For example, if there are three transactions A -> B -> C, and the B
transaction is unlocked, we cannot apply it until transaction A is
applied. The readiness check is based on checking the first pending
transaction of the surface. But if the surface is null, the check
will be skipped, which is not ideal as transaction B can be applied
before transaction A now. To address that, this change makes every
transaction entry remember the previous transaction. With that, the
readiness check can be performed even if the surface has been destroyed.

BUG: 475648
2023-11-08 13:09:51 +00:00
Vlad Zahorodnii
16389f0298 Remove NAMELINK_SKIP for libkwin
libkwin headers are installed now, so it should be removed.
2023-11-08 09:06:54 +00:00
Xaver Hugl
9d4fe3adf1 implement the frog color management protocol 2023-11-07 20:23:06 +01:00
Xaver Hugl
15d6d8c336 wayland/surface: add the output a surface is on the most 2023-11-07 20:23:06 +01:00
Christophe Marin
b40e960ad7 Bump kwin soversion to 6 2023-11-07 12:56:29 +01:00
Nate Graham
c5a3749a40 XWayland: allow snooping non-character keys with elevated snooping modes
These keys do not represent a security risk to allow apps to snoop since
they can't be used to type passwords etc.

BUG: 474705
FIXED-IN: 6.0
2023-11-06 15:19:19 +00:00
Xaver Hugl
28c27609a4 xdgshellwindow: enforce a minimum size for clients
It doesn't make sense for a window to become 1x1 pixels small. When we have
server side decorations we also know that the decoration takes a lot of
space, so this commit enforces a bigger minimum size for decorated windows

BUG: 469237
2023-11-06 14:55:57 +00:00
Xaver Hugl
d0a9e90716 platformsupport/scenes/opengl: fix format filtering
We support formats that are neither 10 nor 8 bits per color, so the filtering needs
to reflect that
2023-11-06 12:42:00 +01:00
Noah Davis
ea75c094a9 plugins/fallapart: Blacklist spectacle
Spectacle needs to be blacklisted in order to stay out of its own
screenshots.

BUG: 473565
2023-11-06 10:01:03 +00:00
David Edmundson
a8466c3604 layershell: Implement dockWantsInput
Kwin logic has a separate method for if a dock wants input, given layer
shells are always docks it is important to implement this.
2023-11-06 09:37:13 +00:00
Vlad Zahorodnii
0f5e719b61 wayland: Fix none keyboard interactivity in LayerShellV1Window
Window::acceptsFocus() is not taken into account when a window is
activated using Workspace::activateWindow(). The main reason is because
of different input models on X11.

Instead, Window::takeFocus() should check itself if the window accepts
focus.
2023-11-06 08:07:32 +00:00
Nicolas Fella
dc826911ec Adapt to KWindowSystem changes 2023-11-06 00:22:14 +01:00
Nate Graham
40a4f4c90b kcms/options: set focus policy strings on load, not just on change
Right now the string is only set when the option is changed to anything
else. That's fine, but we need to set it on load too, or else the user
will see a placeholder string instead of the real text if they don't
change anything.

BUG: 456718
FIXED-IN: 6.0
2023-11-01 22:41:25 +00:00
Xaver Hugl
b1f2c40827 kcms/compositing: remove tearing setting
It's now shown in KScreen instead
2023-11-01 21:44:07 +00:00
Xaver Hugl
ba3a70e8a8 backends/drm: remove m_current
It's not needed and just adds overhead
2023-11-01 21:29:00 +00:00
Xaver Hugl
ff2bc0798f backends/drm: fix properties not being applied when a modeset is not needed
When testing whether or not a modeset is needed, all that gets tested is
whether or not the kernel would allow the commit to happen without the ALLOW_MODESET
flag. If there's properties that are only changed in DrmPipeline::prepareAtomicModeset,
we need to apply those in the next commit, regardless of whether or not
the ALLOW_MODESET flag is necessary.

BUG: 476060
2023-11-01 21:29:00 +00:00
Xaver Hugl
457deeb27d glshadermanager: optimize pq conversions 2023-11-01 21:15:20 +01:00
Xaver Hugl
cbb574efff libkwineffects/glshadermanager: support PQ as client EOTF 2023-11-01 21:02:38 +01:00
Xaver Hugl
21d8b58e82 scene/surfaceitemwayland: set initial color description 2023-11-01 21:02:38 +01:00
Aki Sakurai
36e7eaf13a Add option to map tablet to full desktop area.
Some users might want to map the tablet to full desktop area.

BUG: 450874
2023-11-01 17:42:39 +00:00
Xaver Hugl
190f688c97 libkwineffects: add support for scRGB 2023-10-31 22:51:39 +00:00
Arjen Hiemstra
8e5d45ae9d Update showfps effect to QuickCharts API changes 2023-10-31 20:35:26 +00:00
Nate Graham
85008c4a0d kcm/rules: Port away from Kirigami.AbstractListItem
It's being removed for KF6 and ItemDelegate works fine here.
2023-10-31 14:05:20 -06:00
l10n daemon script
74ef01dbc0 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-10-30 02:09:50 +00:00
Niccolò Venerandi
7f0e201880 Fix animation when clicking grouped windows in task manager
Since hidden windows are not placed in the grid-like view, `cell.isReady` is always false for them, and they never switch to the "active-hidden" state when the effect is turned on. This commit makes sure that windows hide even if their cell isn't ready.
2023-10-29 19:05:15 +00:00
Xaver Hugl
a902b66299 backends/drm: remove unnecessary comment
DrmPipeline::needsModeset, and by extension, DrmGpu::needsModeset is no
longer expensive in any way, so checking them multiple times per frame is
not a problem anymore
2023-10-29 13:04:04 +00:00
l10n daemon script
b7dc3e3698 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-10-28 02:14:03 +00:00
Vlad Zahorodnii
22efedc09c Rename VirtualDesktopManager::desktopCreated signal
Rename it to desktopAdded to match activityAdded, windowAdded, etc.
2023-10-26 07:21:49 +00:00
Vlad Zahorodnii
8fbf287254 libkwineffects: Port to VirtualDesktop
This makes effects api consistent with the scripting api. In addition to
that, VirtualDesktop objects are more stable.
2023-10-26 07:21:49 +00:00
Laurent Montel
465499d3a7 GIT_SILENT: use KLocalizedString::setApplicationDomain(QByteArrayLiteral => saving one deep data copy 2023-10-26 07:02:28 +00:00
l10n daemon script
0b82df303d 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-10-26 02:19:20 +00:00
Vlad Zahorodnii
f2dfac8497 libkwineffects: Drop EffectsHandler.windowToDesktop
Use EffectsHandler.windowToDesktops instead.
2023-10-25 18:52:37 +03:00
Vlad Zahorodnii
b3b2e96148 libkwineffects: Replace EffectScreen with Output 2023-10-25 15:13:14 +00:00
Xaver Hugl
7db4df9915 outputconfigurationstore: differentiate between outputs with their mst path
The DisplayPort multi stream path should be more stable in comparison to
connector names, so prefer that for differentiating between outputs with
the same EDID.

BUG: 470718
2023-10-25 14:58:47 +00:00
Xaver Hugl
0391b65628 scene/itemrenderer_opengl: switch shaders depending on the input
This allows using more expensive shaders where needed, and less expensive ones
where possible
2023-10-25 14:19:12 +00:00
Xaver Hugl
09278caf48 add colorspace metadata to surfaces and items, and use it in the OpenGL renderer 2023-10-25 14:19:12 +00:00
Xaver Hugl
c1b4806962 delete the colord integration plugin
ICC profiles are now set through KScreen, which conflicts with colord. Colord is also
dropped because applications may read the profile for the current output from it, and
so KWin and the application both apply the profile, resulting in wrong colors.
2023-10-25 16:05:27 +02:00
Xaver Hugl
872aa55630 allow setting the icc profile through the output management protocol 2023-10-25 16:05:26 +02:00
Xaver Hugl
006d1f6a14 outputconfigurationstore: store icc profile paths 2023-10-25 15:46:13 +02:00
Xaver Hugl
e441b5f35d libkwineffects/colorspace: add some documentation 2023-10-25 15:34:21 +02:00
Xaver Hugl
8d25550c22 backends/drm: support applying icc profiles with color management
While applications are still restricted to sRGB, this allows working on sRGB
content on displays with a wide color gamut as the whole profile gets applied,
instead of just the VCGT.

CCBUG: 439135
2023-10-25 15:34:21 +02:00
Xaver Hugl
7d0a3dcd1e libkwineffects/openglcontext: require support for 3D textures
They will be used in the drm backend for ICC profiles.
2023-10-25 15:34:21 +02:00
Xaver Hugl
0429ec8053 libkwineffects: add a 3d lookup table class 2023-10-25 15:34:21 +02:00
Xaver Hugl
1f8a1a0788 libkwineffects: add a lookup table class 2023-10-25 15:34:21 +02:00
Xaver Hugl
b200a3180f libkwineffects/colorspace: apply chromatic adaption 2023-10-25 15:30:34 +02:00
Xaver Hugl
1e4701309f core/iccprofile: read colorimetry, BToA1 and BToA0 tags 2023-10-25 15:30:33 +02:00
Xaver Hugl
286914133e core/colortransformation: add floating point transformation helper 2023-10-25 15:01:44 +02:00
Xaver Hugl
1206dad079 move icc profile handling into Output 2023-10-25 15:01:44 +02:00
Xaver Hugl
44ae4ba004 core: introduce icc profile helper 2023-10-25 15:01:44 +02:00
Xaver Hugl
4d9f1453d0 libkwineffects/colorsapce: fix typo in toXYZ matrix calculation 2023-10-25 15:01:44 +02:00
Vlad Zahorodnii
0ef8562e61 Add missing find_dependency(Wayland::Server) 2023-10-25 12:46:12 +00:00
Vlad Zahorodnii
d7b1661e08 Merge libkwineffects into libkwin
libkwineffects was introduced when kwin used to be an executable. It
provided an api to implement effects and shielded from the technical
quirks in kwin.

Over the time, kwin internals had been split and abstractions were
refactored so they can be consumed in scripts or plugins. Besides that,
new ways to implement extensions have been introduced, which use
kwin's internal abstractions.

On the other hand, effects continue using libkwineffects specific apis.
This has a few issues: qtquick effects use both apis and it bites us,
duplicating same apis.

The best solution so far is to merge libkwineffects with libkwin, and
replace libkwineffects abstractions with libkwin abstractions, e.g.
EffectScreen -> Output, etc. This change takes care of adjusting libs.

Obviously, the main disadvantage of doing so is that binary effects
have to be recompiled every time new libkwin is released. But it's
already the case with libkwineffects too.
2023-10-25 12:46:12 +00:00
Vlad Zahorodnii
416c2c64b1 Link Qt::Concurrent with libkwin privately 2023-10-25 12:46:12 +00:00
Vlad Zahorodnii
3bed991941 Link KI18n with libkwin privately 2023-10-25 12:46:12 +00:00
Vlad Zahorodnii
e01da45d13 Link Qt::Sensors with libkwin privately 2023-10-25 12:46:12 +00:00
David Edmundson
4bdb94c87f Overview: Fix clear button working in overview search
onTextEdited only updates on user-invoked key presses, and not
programatic changes.

This is a better choice when we have a two-way bindings such  as with
configuration files, but in this case we always want the UI to reflect
the current contents of the search box making onTextChanged the better
signal.

BUG: 475789
2023-10-25 11:52:56 +00:00
Nicolas Fella
cb4e972065 Don't manually undo pending shortcut changes
This causes user-after-free because the KShortcutsEditor is already destroyed

undo happends automatically when the editor is destroyed

BUG: 475083
2023-10-24 20:48:28 +00:00
Xaver Hugl
1d77f896df backends/drm: use libdrm function for checking if a device is kms capable 2023-10-24 18:52:38 +02:00
Xaver Hugl
6e05314739 backends/drm: disable the hardware cursor with color management
Blending needs to happen in linear space, which is not the case if the
inverse EOTF and VCGT are applied before blending
2023-10-24 14:16:39 +00:00
Xaver Hugl
4582276cf8 compositor_wayland: handle the cursor layer returning std::nullopt correctly 2023-10-24 14:16:39 +00:00
Xaver Hugl
7ad1c163a3 scene/cursordelegate_opengl: recreate texture if the format is wrong 2023-10-24 14:16:39 +00:00
Vlad Zahorodnii
1cb43e8407 plugins/zoom: Fix viewport on X11
On X11, there's no per screen rendering. The primary screen is specified
as the painted screen. RenderViewport::renderRect() should be used.

BUG: 475799
2023-10-24 12:00:25 +00:00
Aki Sakurai
115ea7454b Send tablet events to every bound wl_resource
Some apps, notably Tablet KCM, will rebind the tablet interface and consume all events that should be sent to the GUI toolkit.
This commit sends events to every consumer and also stores the latest cursor indexed by wl_client instead of wl_resource.
BUG:473126
2023-10-24 11:22:27 +00:00
Vlad Zahorodnii
255283b74a plugins/overview: Fix MMB and RMB
Both MMB and RMB are broken because acceptedPointerTypes doesn't accept
PointerDevice.GenericPointer.

RMB is broken because there's no "desktopView" object.

BUG: 475681
2023-10-24 11:14:31 +00:00
l10n daemon script
54d72abd6e 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-10-24 02:10:20 +00:00
Jami Kettunen
4d4b22d8ab core/graphicsbuffer: sort includes alphabetically 2023-10-23 22:30:24 +03:00
Vlad Zahorodnii
fb638f26c5 libkwineffects: Drop QObject parent argument in OffscreenQuickView constructor
All usages of OffscreenQuickView have been ported to smart pointers. So
let's drop the QObject parent argument to simplify the API.
2023-10-23 19:00:38 +00:00
Jami Kettunen
8cc1c7eca7 core/graphicsbuffer: add missing unistd.h include
Fixes an error: use of undeclared identifier 'ftruncate' under Chimera
Linux which uses the musl C standard library.
2023-10-23 18:47:07 +00:00
David Edmundson
ad45dcb40b x11window: Sync xcb_sync_destroy_alarm to lifetime of the window being alive
Recent-ish changes meant that the X11 window is kept alive whilst an
effect may be using the window.

This changes the lifetime of the sync alarm. This is problematic in the
case of an XWayland crash, we can assume whilst an X11 client is valid
the X11 connection is also valid, but if a close animation is used the
connection might not be valid when the destructor is called.
2023-10-23 18:35:28 +00:00
Vlad Zahorodnii
364afe0f69 libkwineffects: Make Texture export mode default in OffscreenQuickView
Mainly, only aurorae decoration theme needs image export mode. All other
usecases use texture export mode.
2023-10-23 18:52:40 +03:00
Vlad Zahorodnii
5d925799d7 plugins/outputlocator: Manage OffscreenQuickView with smart pointers 2023-10-23 18:52:37 +03:00
Vlad Zahorodnii
98eecafe29 libkwineffects: Make parent optional in OffscreenQuickView
The parent argument is redundant if the view is managed with a smart
pointer.
2023-10-23 16:10:22 +03:00
Vlad Zahorodnii
1ca4c23db1 libkwineffects: Use more conventional constructor argument order in OffscreenQuickView 2023-10-23 16:10:22 +03:00
Vlad Zahorodnii
0f7369ed1b Fix scheduling repaints in Effect::prePaintScreen()
If a repaint is scheduled in the prePaintScreen() function, we want
it to be applied in the next frame, not the current one.

Currently, it doesn't work like this because prePaintScreen() runs first
then the Compositor gathers repaints and resets them.

This is important to qtquick effects that use qtquick3d as some items in
qtquick3d schedule repaints for the next frame after synchronizing, i.e.
in OffscreenQuickView::update() which is called in prePaintScreen() by
QuickSceneEffect.
2023-10-23 12:53:20 +00:00
Alexander Lohnau
0d3b017b23 Avoid QtDBus module include in commonly used headers
Because all of QtCore and QtDBus is no longer pulled in, a few placed had to get explicit includes
2023-10-22 13:45:28 +00:00
Alexander Lohnau
f9aa624d5b useractions: Also adapt weird formatted for loop
GIT_SILENT
2023-10-22 13:45:28 +00:00
Alexander Lohnau
bffff9470d libinput/device: Remove unneeded toVector call on variable that is already a vector
In Qt5, this variable was a QList and thus the conversion to a vector was needed
2023-10-22 13:45:28 +00:00
Kristen McWilliam
1b1cc67792 inline variables & remove redundant check for decorations 2023-10-22 12:34:22 +00:00
Kristen McWilliam
dd5ec684b7 include-shadow defaults to true so this isn't a breaking change 2023-10-22 12:34:22 +00:00
Kristen McWilliam
53a4faf4e6 refactor window geometry checking 2023-10-22 12:34:22 +00:00
Kristen McWilliam
5c8b85861e plugins/screenshot: make window shadows optional
Right now screenshots of windows always have drop shadows. This change
makes the shadows optional. Resolves a 7-year-old bug report in
conjunction with an incoming change to Spectacle.

BUG: 372408
2023-10-22 12:34:22 +00:00
Kai Uwe Broulik
3eb90b2c60 Adjust to KDecoration init API returning a bool
Will allow a fallback to client-side decoration when KDecoration init fails.
2023-10-22 10:52:42 +02:00
l10n daemon script
f3012a3eda 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-10-22 02:34:36 +00:00
Kai Uwe Broulik
9f8b03cbe6 Window: Check parent windows for icon geometry
For instance, when a dialog isn't shown in the task manager.
Also matches what X11Window is doing.
2023-10-21 20:12:37 +00:00
Alexander Lohnau
6b83654560 useractions: Use static regex
The method is called quite often during KWins lifetime.
Because the pattern is constant, we can reuse the value instead of creating a new regex every time
2023-10-21 19:35:08 +00:00
Alexander Lohnau
08c3399568 useractions: Simplify for loops 2023-10-21 19:35:08 +00:00
Alexander Lohnau
f842493563 x11_standalone_overlaywindow: Adjust initialization order
This fixes a clang warning about fields being initialized in a different order than they were declared
2023-10-21 19:35:08 +00:00
Alexander Lohnau
41f66a37a1 kscreenintegration: Do not use pointer in QMap as key
Sorting bases om memory addresses doesn't make sense, also, we have proper sorting using std::sort in the readOutputConfig method
2023-10-21 19:35:08 +00:00
Alexander Lohnau
55c58e72a6 kscreenintegration: Utilize QJsonObject QLatin1String overloads for faster lookups
We have a dedicated QLatin1String overload which is faster at runtime and smaller at compile time
2023-10-21 19:35:08 +00:00
Alexander Lohnau
778c85343b debug_console: Avoid iterator usage on temporary return value
This works, because the value is not modified. Hwoever, it is an antipattern and can easily break
2023-10-21 19:35:08 +00:00
Alexander Lohnau
4a8d952544 plugins/windowview: Remove unused gestureCallback lambda
The usages were removed in 028dd552cf, but the lambda remained
2023-10-21 19:35:08 +00:00
Xaver Hugl
87a7033ca6 main: use kcminit correctly 2023-10-21 18:11:16 +00:00
Xaver Hugl
10eeba06f8 main_wayland: set Xwayland scale after Xwayland starts 2023-10-21 18:11:16 +00:00
Xaver Hugl
1ff3cd9684 main: set config values for fonts and style KCMs to do their job 2023-10-21 18:11:16 +00:00
Xaver Hugl
657aa35d8f Revert "main: directly set Xwayland scale, instead of starting a KCM to do the same"
This reverts commit 2eb72d0820. The KCMs set more than just
the DPI, so it's best to keep running them
2023-10-21 18:11:16 +00:00
Xaver Hugl
2b79316e4b plugins/colorpicker: use glReadPixels instead of glReadnPixels
We always know the data for the single pixel will fit into the buffer, so
it's unnecessary to use the checked variant (which is only available in
OpenGL 4.5)
2023-10-21 16:02:19 +02:00
Xaver Hugl
f69c622831 plugins/colorpicker: make sure values aren't clipped
With the floating point buffer used with color management, storing values into
uint8_t won't always work
2023-10-21 16:00:46 +02:00
Nicolas Fella
2e3881b14d Adapt to KWindowSystem API change 2023-10-20 22:41:32 +02:00
Vlad Zahorodnii
754b549f01 Restart compositing if kwinrc changes only on X11
On Wayland, options don't influence compositing as on X11. For example,
kwin cannot easily switch between compositing modes, etc.

One can still force kwin_wayland to reinitialize compositing by using
the dbus api.
2023-10-20 22:28:04 +03:00
Vlad Zahorodnii
49b84ddf8c Avoid destroying effects if animation speed changes
It makes little sense to destroy effects if the animation speed changes.
The effects are written with the assumption that the animation time can
change and therefore they handle this case in reconfigure().
2023-10-20 19:15:53 +00:00
Vlad Zahorodnii
f22da5f62a Fix reloading animation speed option
Amends 4d2c9f5d88.

Prior to 4d2c9f5d88, the Compositor used
to force the Options to reload settings when starting compositing.

Unfortunately it was overlooked that Options::animationTimeFactor() can
return an old value when the Options::animationSpeedChanged() signal is
emitted. This change addresses that.
2023-10-20 19:04:30 +00:00
Vlad Zahorodnii
3af30c4250 kcms/screenedges: Fix Overview not being displayed
Scripted and builtin effect metadata formats are no longer compatible.
So KPackageLoader doesn't list builtin effects anymore. To address that,
load builtin effect metadata manually.
2023-10-20 18:54:31 +00:00
l10n daemon script
863a81ba6d 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-10-20 02:07:21 +00:00
Vlad Zahorodnii
509b9e8e3f scripting: Reload SceneEffect configuration when effect is reconfigured
This ensures that the SceneEffect uses new settings when KCM changes
them.
2023-10-19 15:09:47 +00:00
Vlad Zahorodnii
bf602ccd44 kcms/screenedges: Fix listing of effects
Effects have KWin/Effect package type.
2023-10-19 14:55:53 +00:00
Laurent Montel
bc6116c5a7 There's no QVector anymore, QList is the QVector in Qt6 2023-10-19 13:43:53 +00:00
Vlad Zahorodnii
f9163bf6a5 Clear X11 cursor cache when XCB connection changes
We need to clear it because if Xwayland restarts, the future Xwayland
instance may have different cursor ids.
2023-10-19 12:58:58 +00:00
Marco Martin
2eabd17547 Adapt to KSvg api changes
Size/elementSize is a QSizeF now.

Depends on https://invent.kde.org/frameworks/ksvg/-/merge_requests/29.
2023-10-19 11:09:06 +00:00
ivan tkachenko
07dd2a5086
Port implicit default content items to use contentItem: property
See also
https://invent.kde.org/frameworks/kirigami/-/merge_requests/1338
and
https://invent.kde.org/frameworks/kirigami/-/merge_requests/1340
2023-10-19 13:43:41 +03:00
Vlad Zahorodnii
7ae4497d5b Specify scripted effect kcm using X-KDE-ConfigModule
At the moment, if an effect wants to have a configure button in the
desktop effects kcm, it needs to add X-KDE-PluginKeyword field with
its plugin id. This is confusing.

This change ports scripted effects to X-KDE-ConfigModule, which is more
intuitive than X-KDE-PluginKeyword.

kcm_kwin4_genericscriptedconfig is a special config module that loads
config.ui from KPackage. However, an effect can specify a different
config module in the metadata if kcm_kwin4_genericscriptedconfig doesn't
suit their needs.
2023-10-19 07:44:22 +00:00
Vlad Zahorodnii
2c29dfd596 libkwineffects: Make SceneEffect fallback to root context
QuickSceneEffect can also be instantiated by C++, for example that's
the case with the overview effect. In that case, qmlContext() is not
going to return a valid context because the effect has not been created
by a QQmlEngine. In that case, use the root context as the parent
context.
2023-10-19 07:32:38 +00:00