Commit graph

7331 commits

Author SHA1 Message Date
David Edmundson
0081ede8f1 x11: Ignore all grab notifications for focus handling
On X11 we get focus in and out events for normal input and when grabs
change. Kwin's concept of the active window should only follow the
normal focus changing.

Testing done:
Run Xfreerdp and move the pointer outside the window, the cursor
decoration should not change. It should still be the active window.
2024-07-30 14:54:16 +00:00
Nicolas Fella
2d23b30cee plugins/keynotifications: Optionally ring system bell when using lock keys
BUG: 464457
2024-07-30 14:16:02 +00:00
Vlad Zahorodnii
bc2c5bf43e Fix checking whether GraphicsBufferView is null
If the graphics buffer view is null, GraphicsBufferView::image() will
point to a valid memory location but the QImage at that address is going
to be null.
2024-07-30 14:02:16 +00:00
Nicolas Fella
b1ac04179d plugins/stickykeys: Ring system bell when modifiers are used
BUG: 464456
2024-07-30 15:19:35 +02:00
Nicolas Fella
80b5910594 Add visual bell effect
This effect is used to implement the visual bell accessibility feature.

It allows to implement it on Wayland and significantly improve it on X11,
where it's currently rather broken.

It offers two modes:
- Inverting the colors (code is based off the invert effect)
- Flashing a solid color
2024-07-30 15:19:35 +02:00
Michael Weghorn
14a10b3b4b Add Window.captionNormal property
Make the window caption without suffix available in
the scripting API by adding a `captionNormal` property.

Update the doc for the `caption` property to mention that
`captionNormal` can be used to get the caption without
added suffix, instead of suggesting to call a getter with
a bool param that was dropped in

    commit f0652970f4
    Date:   Sun Aug 20 09:35:15 2017 +0200

        Drop boolean parameter from AbstractClient::caption
2024-07-30 12:04:56 +00:00
Nate Graham
f015b73a48 Loosen minimum screen size detection code for output scale calculation
We return early for screens with physical height reported as ≤ 0mm.

However some extremely dumb screens report a value for their height
greater than zero but absurdly small, causing the scale calculator to
go ballistic. Theoretically this could happen for widths, too.

Let's loosen the detection to flag a physical screen size as invalid if
either its width or height is less than 3mm. There is no screen that
can possibly make sense to exist at this physical size given the angular
resolution of the human eyeball. And if for some reason it does, 100%
scale is fine for it.

BUG: 490777
FIXED-IN: 6.2.0
2024-07-30 03:16:01 +00:00
l10n daemon script
d41e0ca127 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"
2024-07-30 01:24:58 +00:00
Joshua Goins
34c2a36000 ButtonRebindsFilter: Support keyboard modifiers with mouse buttons
This is needed to better support emitting mouse button events when
pressing tablet buttons. It's common in many art programs that an action
is tied to a mouse button + a modifier, such as panning the canvas. So
being able to send keyboard modifiers in tandem with mouse buttons is
very useful when rebinding.

Tests are added for this new feature.

CCBUG: 469232
2024-07-29 15:46:44 +00:00
Xaver Hugl
d01e20b6a9 activation: don't add the active window to should_get_focus list
The matching X11 focusIn event will never arrive, and so the window is stuck
in the list and messes with activation until it's no longer the active window
and then active later again

BUG: 484155
2024-07-29 11:15:21 +00:00
Xaver Hugl
457b3a47ff core/renderloop: don't move the target presentation timestamp back when rescheduling
Re-doing the frame scheduling for an already scheduled composite cycle was meant to
adjust to small timing changes in the presentation timestamp, but if the expected
compositing time was close to vblank, it could happen that this would instead move
the target presentation timestamp and effectively drop a frame.

To fix that, this commit makes the presentation timestamp be adjusted only to be more
accurate, but still target the same vblank interval.

BUG: 488843
2024-07-26 12:59:47 +00:00
Xaver Hugl
d0f0481860 core/renderloop: fix triple buffering hysteresis
The way it was implemented it only changed the target pageflip, but not the time at which
KWin would start compositing, which could make it skip scheduling a frame for each second
vblank and drop the refresh rate to half of what it should be that way

CCBUG: 488843
2024-07-26 12:59:47 +00:00
Xaver Hugl
d12a93f9fb scene/itemrenderer_opengl: reset OpenGL state for YUV conversion back to RGB
Otherwise, effects or other OpenGL code that doesn't explicitly set those will get
wrong results
2024-07-26 10:59:31 +00:00
Nicolas Fella
e3ad1fa04f plugins/stickykeys: Disable when two keys are pressed
BUG: 464453
2024-07-25 14:22:17 +02:00
David Edmundson
374d859493 xwayland: Only update keyboard modifers for XWayland's keys
KeyboardInterface is a multiplexer, it has a global state to kwin
that forwards events the single focussed window.

XWayland also forwards events to clients, but uses the keyboard interface.
It has some overloads that take a specific client, this was used for key events
but not modifiers.

The end result was not only that XWayland could miss a modifier update, but
also that wayland clients would get modifier updates out of order.
Key events must come first.

BUG: 490270
2024-07-24 15:57:21 +00:00
David Edmundson
b0a5918db9 effects/logout Avoid caching animation duration
This is problematic as then we do not catch changes to animation speed
settings, it also doesn't make the code more readable when it's
only used in one place.

BUG: 490703
2024-07-24 15:09:45 +00:00
Harald Sitter
ab579ad549 killer: write application-not-responding metadata and ABRT the process
this allows the crash handling infrastructure to detect ANR cases and
handle them separately from regular crashes
2024-07-24 13:04:49 +00:00
Vlad Zahorodnii
a83cd5bf2f Simplify Placement::placeMaximizing()
Window::maximize() maximizes the window regardless of size constraints.
If the window can't be maximized, just fallback to the default (centered)
placement policy.
2024-07-24 06:23:28 +00:00
Xaver Hugl
d548ade3a6 placement: keep the titlebar in the screen with centered placement
...even if the window is larger than the screen.

BUG: 489500
2024-07-23 16:02:51 +02:00
Xaver Hugl
0e25405151 placement: don't overwrite scheduled position change in cascadeIfCovering
As it used the frame geometry, the check for covering windows was sometimes wrong,
and additionally overwrite changes to the window position Placement had made before,
which could end up with the window origin wrongly not being put inside of the screen
in some cases.

CCBUG: 489500
2024-07-23 16:02:51 +02:00
Vlad Zahorodnii
02fbeeae78 Make Workspace::desktopResized() reassign outputs of uninitialized windows
If an output is deleted, the Workspace::desktopResized() is going to
re-assign windows to the new outputs. It is done so so the workspace
re-arrangement procedure is deterministic and has concrete order.

However, with the current Window lifecycle management, it's possible
to encounter the follwing case:

- xdg_toplevel gets created on output A
- xdg_toplevel initial state is committed
- output A is removed
- a wl_buffer is attached to the xdg_toplevel, which results in a
  geometry change and an output change
- Window::setMoveResizeOutput() is called, but the previous output
  is a dangling pointer

CCBUG: 489632
2024-07-23 13:46:06 +00:00
Devin Lin
b87096cb27 screenedge: Increase touch border from 3px to 8px
We are currently using the touch border to activate the task switcher, but it's almost impossible to activate on a phone screen. We used to use 8px (invisible panel) when the task switcher was implemented in plasmashell, I think that can work here.
2024-07-23 13:16:45 +00:00
David Edmundson
6943fab2c1 wayland: Avoid klipper loop with existing but empty clipboards
In default settings if the clipboard or selection is empty klipper will try to
replace it with cached data.

To avoid an occurring race condition if a client deletes and then recreates a
selection kwin will deny klipper if another mimedata is present at the time
it tried to replace an empty clipboard.

Klipper also considers the presence of a valid mime data without any offers
to be an empty clipboard, whereas kwin did not.

If a super weird client set the clipboard to a valid entry with no offers,
klipper would get into an infinite loop of trying to set it's own selection
for it to be continually denied with no other valid offer from klipper's perspective
ever received.

BUG: 469644
2024-07-23 12:50:06 +00:00
Xaver Hugl
32b117dbd8 core/renderbackend: remove unused parent object
As the render backend is always stored in a unique pointer, using a Qt parent
might even cause crashes
2024-07-23 12:29:24 +00:00
Nicolas Fella
32c696b45e Expose input device group on DBus
This is useful to combine tablet pen and pad devices into one logical device
2024-07-23 13:33:41 +02:00
David Redondo
e0202c7531 Include span
This is needed on some compilers like g++ 11.
2024-07-23 07:34:57 +00:00
Vlad Zahorodnii
2ec45f33d1 backends/drm: Fix a crash in DrmGpu::releaseBuffers()
Currently, the code assumes that the primary and the cursor layers are
always present. However, it's not guaranteed if the render backend cannot
be recreated. Specifically:

- the Compositor destroys the EglGbmBackend. The egl gbm backend, in its
  turn, resets the primary and the cursor layers to null
- the Compositor tries to create the EglGbmBackend but that fails so it
  is destroyed. EglGbmBackend::~EglGbmBackend() calls DrmGpu::releaseBuffers(),
  but it hits an unexpected null primary layer.

Normally, the primary and the cursor layers would be created when the
Compositor successfully creates the WorkspaceScene. Since the RenderBackend
fails to initialize, the WorkspaceScene is not created and the DrmGpu
doesn't recreate the layers.
2024-07-23 06:22:20 +00:00
Joshua Goins
59699402ad ButtonRebindsFilter: Set cursor position when rebinding tablet events
Since the tablet cursor and the mouse cursor is tracked separately,
rebinding a tablet button to a mouse click is sort of wonky. For
example, if you assign it to Right Click and attempt to open a context
menu it will appear to open in the wrong place.

So before we send the mouse button event, set the mouse position to
the tablet cursor position. A test is added to ensure this functionality
works as intended and doesn't regress.
2024-07-23 01:36:33 +00:00
l10n daemon script
0af007b462 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"
2024-07-23 01:20:56 +00:00
Ismael Asensio
ac5c175ade kcms/rules: Some QML clean-ups
- Remove unnecessary bindings to enabled: Properties that are not
  enabled are not shown in the list anyway, and it fixes QML warnings:

  RuleItemDelegate.qml:16:5: Unable to assign [undefined] to bool
  RuleItemDelegate.qml:93:17: Unable to assign [undefined] to bool

- Remove unnecessary colorSet
- Port away from javascript `var`
- Remove outdated comment
2024-07-22 12:46:29 +02:00
Ismael Asensio
0bd722e84b kcms/rules: Add a placeholder for properties filter
The list to add properties can be empty because no entry matches
the filter text or if all the properties have been already added.

Show a placeholder instead of leaving the view just empty
2024-07-22 12:46:29 +02:00
Ismael Asensio
9098fd4910 kcms/rules: Make the "Add Property" button non-toggleable
Changing the text and meaning of the button unexpectedly for a
regular operation is not consistent with any other place, and
disregarded by the HIG.

The sheet can be closed by tapping outside of it, or throught
the close button in its titlebar, as usual elsewhere.
2024-07-22 12:46:29 +02:00
Ismael Asensio
893bffd572 kcms/rules: Reuse items on the property selection ListView
This makes scrolling the list view much more responsive as there
is no need to create new delegates

BUG: 449275
FIXED-IN: 6.2
2024-07-22 12:46:29 +02:00
Ismael Asensio
90dbeef1d6 kcms/rules: Increase the default dialog size
This KCM is usually called via the application menu, which uses
kcmshell, so it doesn't benefit from the SystemSettings minimum size.

Slightly increse its height, so there is more space for properties
in the list views, either to configure them or to add them, so it
feels less cramped.
2024-07-22 12:46:29 +02:00
Vlad Zahorodnii
ac80307eba wayland: Make XdgPopupWindow also destroy Window
Arguably, the compositor doesn't need to wait any longer after dismissing
the popup because it knows that the popup has been closed.

BUG: 490097
2024-07-19 20:49:01 +00:00
Xaver Hugl
eddced099d backends/drm: don't unset degamma in prepareAtomicModeset
We're now using and, if necessary, un-setting the property in prepareAtomicPresentation

BUG: 490517
2024-07-19 21:39:33 +02:00
Xaver Hugl
2340470a9a backends/drm: add support for drm plane size hints
On a lot of hardware, using bigger plane sizes than necessary means wasting power.
This is specifically problematic with the cursor plane, where we so far only had a
single fixed size hint through drm caps, even though the hardware often could use
a smaller cursor size.
This adds support for the per-plane SIZE_HINTS property, which allows us to pick a
smaller cursor size when the cursor image fits into it, and should save some power
that way.
2024-07-19 13:40:44 +02:00
Vlad Zahorodnii
2296f1ac3b utils: Load Xcursor cursors on demand
Usually, only a small subset of cursors would be used, for example the
default shape, the pointer shape, the text shape, etc.

Another reason why this change makes the KXcursorTheme load cursors on
demand is to prepare the cursor loading machinery to SVG cursors.
2024-07-19 06:02:11 +00:00
Vlad Zahorodnii
a10c322f7a wayland: Ignore plasma shell reposition requests during interactive move resize
Both kwin and plasma have different placement strategies during interactive
move resize. That can result in the window flipping between two positions.

In order to prevent that, this change makes kwin placement take precedence
over the window position specified using the plasmashell protocol. This can
be considered as a workaround.

BUG: 481829
2024-07-18 17:02:52 +00:00
Xaver Hugl
49f656a3d9 xdgshellwindow: guard against sending negative configure bounds
It's unlikely to happen, but if it were to happen, it would cause crashes
2024-07-18 15:48:17 +00:00
Xaver Hugl
099a1cc31f backends/drm: limit max_bpc to 8 by default with docks
There's generally a lot of problems with higher than 8bpc in docking stations,
especially when multiple monitors are involved. Until these problems are hopefully
eventually fixed on the driver side, limit the bpc to 8 with docks by default
2024-07-18 15:28:32 +00:00
Harald Sitter
ae336e464e wayland: implement plasmawindowmanagement v18 2024-07-18 15:07:57 +00:00
Xaver Hugl
a6e429f348 wayland/xxcolormanagement: set the correct mastering display info in the color description 2024-07-18 16:11:14 +02:00
Xaver Hugl
1d3e3faf7b wayland: update xx color management to version 4 2024-07-18 16:11:13 +02:00
Xaver Hugl
01d9393e80 xdgshellwindow: never request clients to resize to a negative size
Doing that can cause clients to crash

BUG: 489983
2024-07-18 15:41:02 +02:00
Xaver Hugl
c3d202b0d2 compositor_wayland: count rendering time for all steps of compositing
Otherwise, prePaintPass, postPaintPass and possible future overhead like overlay
plane matching aren't accounted for, which can cause frames to be dropped.

CCBUG: 488782
2024-07-18 13:25:16 +00:00
Vlad Zahorodnii
7b486e215d Avoid sending excessive synthetic ConfigureNotify events
While they are harmless, they can result in the client repainting more
than needed and resulting in the opposite edge "bouncing" when resizing
the window.
2024-07-18 12:17:18 +00:00
Vlad Zahorodnii
8f144460d7 Initialize X11Window::m_client geometry
Initialize X11Window::m_client geometry with a proper value so, later, the
X11Window::configure() function can properly determine whether the client
window is resized.
2024-07-18 12:17:18 +00:00
Xaver Hugl
75075fdb89 backends/drm: combine matrix operations in the right order
Matrix multiplication is right to left, so the operations have to be added
in the reverse order from the list
2024-07-18 12:02:35 +00:00
Xaver Hugl
cd1b70ef05 backends/x11/standalone: fix night light 2024-07-18 13:38:58 +02:00
Vlad Zahorodnii
ddfb26fc8e utils: Provide size hints in native pixels
This is mainly to make the Xcb utils api consistent.
2024-07-18 13:39:11 +03:00
Vlad Zahorodnii
95f56399b8 utils: Make Xcb::WindowGeometry return native geometry 2024-07-18 13:38:09 +03:00
David Redondo
ccde653ac2 plugins/eis: Ignore duplicate key and buttons events
Some clients (like xdotool) can send multiple events for the same
key. In some instances the number of presses and releases can even
be mismatched leading to stuck keys. While we clean up pressed keys
when the client vanishes, this doesnt help when it doesnt immediately
disconnect (for example Xwayland keeps client connections live
longer than the actual x client to reuse them).
Also fixes a copy paste mistake where key presses where also written
to buttons.
2024-07-18 10:17:31 +00:00
Jakob Petsovits
6ca6308ccd wayland: Use brightness range 1..max for internal displays
This avoids regressing compared to PowerDevil in 6.1 which also
protected against setting internal display brightness to 0.

CCBUG: 430439
CCBUG: 483490
2024-07-18 07:13:27 +00:00
Bruno Filipe
998be47ac1 backends/libinput: Ignore redundant events for pointer buttons and keyboard keys when pressed/released on multiple devices
BUG: 486034
2024-07-18 06:56:18 +00:00
Xaver Hugl
6b42e59677 colors/colordevice: remove brightness factor
It's completely unused. If brightness modification is desired for night light
for example, it should be tied in with the actual brightness controls for outputs
instead
2024-07-17 16:08:18 +00:00
Xaver Hugl
cb830957aa core: remove unused colorlut class 2024-07-17 16:08:18 +00:00
Xaver Hugl
0260c2e9cd backends/drm,x11/standalone: apply night light in linear space
It's more correct and, as long as you have a programmable LUT, also not less efficient
2024-07-17 16:08:18 +00:00
Xaver Hugl
a86a914f70 backends/drm: allow offloading more complex color pipelines to legacy modesetting
This is done by combining multiple transfer functions and multipliers into one LUT.
2024-07-17 16:08:18 +00:00
Xaver Hugl
e2c8f25d31 backends/drm: combine color operations more aggressively than ColorPipeline does
With programmable LUTs, consecutive transfer functions, inverse transfer functions and
multipliers can all be combined into one LUT. This allows offloading operations in more
situations and makes the operations more efficient too, as potentially fewer LUTs have
to be programmed
2024-07-17 16:08:18 +00:00
Xaver Hugl
3f2f3cb020 core/colorpipeline: add evaluate method to calculate colorpipeline results on the CPU
This is useful for autotests and some other special cases where we need to calculate
the result of a color pipeline on the CPU. Long term, this should replace
ColorDescription::mapTo
2024-07-17 16:08:18 +00:00
Xaver Hugl
4b91ac8cca core/output: remove unused setGammaRamp method 2024-07-17 16:08:18 +00:00
Vlad Zahorodnii
7a472fcab2 backends/x11: Fix crash that happens when toggling compositing
When the GLX or the EGL backend is destroyed, it is going to reset the
RenderLoop state, including the number of frames in flight. It does so
because of the historical reasons. At the time, there was no output frame
object to track the lifecycle of a frame.

After introducing the OutputFrame and hooking it into the RenderLoop,
the pending frame count will be reset automatically in RenderLoop when
the GLX or the EGL backend is destroyed. But we forgot to remove
the invalidate() function calls. So, when the GLX backend goes down, it
resets the pending frame count to zero and then it destroys the pending
OutputFrame object, which would result in decreasing the pending frame
count by 1 and triggering an assert in the RenderLoopPrivate::notifyFrameDropped()
function.

Since there is the OutputFrame helper now, the invalidate() function
can be dropped. Technically, the invalidate function did more than just
reset pendingFrameCount to 0, for example also stop the compositeTime.
But that should be fairly harmless new behavior.
2024-07-17 12:19:21 +00:00
Nicolas Fella
19bf66c42a plugins/stickykeys: Unlatch modifiers when locking
The state should be either latched or locked, not both
2024-07-17 13:13:40 +02:00
Xaver Hugl
0672313c20 core/renderloop: add some hysteresis to triple buffering
Switching to triple buffering requires dropping a frame, so if we constantly
switch back and forth between double and triple buffering, that can cause
very visible performance issues

CCBUG: 488843
2024-07-16 14:21:47 +00:00
Vlad Zahorodnii
5921be95d3 utils: Fix gaining realtime scheduling with musl
sched_setscheduler() is implemented as a stub in musl that does
nothing because Linux provides no way to set scheduling parameters
per process.

Use pthread_setschedparam() to change the scheduling parameters of
the threads instead.

BUG: 487996
2024-07-16 12:56:04 +00:00
Nicolas Fella
de9eb16527 Show notification when modifier keys are used
If the relevant accessibility setting is enabled

BUG: 395559
2024-07-16 12:27:57 +00:00
Nicolas Fella
0419c9a3b1 [plugins/stickykeys] Show notification when keys are locked
If the relevant setting is enabled

CCBUG: 395559
2024-07-16 12:27:57 +00:00
David Edmundson
4ae33be104 wayland: D&D compositior side action negotiation
Wayland specification is that the compositor chooses the actions based
on keyboard modifiers rather than the application initiating the drag
being told the modifiers.
2024-07-16 10:26:30 +00:00
Neal Gompa
915d103128 cmake: Allow not building kwin_x11
Some distributions do not wish to build the KWin X11 backend as
they do not use it, even though they wish to maintain X11 support
for Xwayland when using KWin as a Wayland compositor.

Allow this choice by splitting the build flag and setting it up to
forcibly disable building the backend when building X11 code is
switched off.
2024-07-16 06:47:43 +00:00
Vlad Zahorodnii
7575de4b02 Port Window::updateInteractiveMoveResize() away from input()->keyboardModifiers()
Since 12c12b3af1, input()->keyboardModifiers()
doesn't work on X. Modifiers need to be pulled from input events.
2024-07-15 15:08:11 +00:00
David Redondo
56f99cb6f4 Fix debug console indices
These were off by one because the surface tab was removed.
Insetad of numbers look up the indices of the widgets so its
less prone to break in the future.
2024-07-15 13:26:05 +00:00
Vlad Zahorodnii
80a86034d0 Remove modifier_only_shortcuts.cpp
Amends c05a26f5c4.
2024-07-15 13:08:47 +00:00
Vlad Zahorodnii
4bf9a208c9 Revert "Handle null input devices in WheelEvent"
This reverts commit c342d57116.
2024-07-15 12:55:28 +00:00
Vlad Zahorodnii
a23ebe12ac Drop leftover infrastructure for modifier only shortcuts 2024-07-15 12:55:28 +00:00
Vlad Zahorodnii
12c12b3af1 Skip processing key and pointer event spies on X
These were needed for the modifier only shortcuts event spy, which has
been dropped recently.
2024-07-15 12:55:28 +00:00
Vlad Zahorodnii
2adf962467 plugins/nightlight: Relax custom times constraints
Apparently the night light kcm allows to set the custom times so the
evening is earlier than the morning to handle extreme cases close to
the North and the South pole.

NightLightManager::updateTransitionTimings() should require no changes.

BUG: 489366
2024-07-15 12:16:50 +00:00
Xaver Hugl
d3bb8ceaae wayland: update to xx color management v3
There's no change in features yet, they'll be added by future commits
2024-07-15 12:05:20 +00:00
Xaver Hugl
a1a0616dc0 workspace: don't access waylandServer on X11 2024-07-15 13:51:53 +02:00
Vlad Zahorodnii
07b31460ce wayland: Simplify XdgPopupWindow::sendRoleConfigure()
Use the precomputed relative placement rather than compute it again.
2024-07-15 07:41:43 +00:00
Vlad Zahorodnii
09e0345ccc wayland: Dismiss XdgPopupWindow when the parent window is closed
XdgPopupWindow can't exist on its own.

BUG: 472013
2024-07-15 07:41:43 +00:00
Patrik Fábián
b84a6af8d3 backends/drm: Pass the correct arguments to encodingToNits in the ICC shader 2024-07-14 16:22:14 +00:00
Weng Xuetian
a16d98f4eb
Input method window should not break showing desktop
With recent change of using show desktop with plasma's edit mode,
wayland input method becomes unusable when trying to type in the search
box of widget explorer. This is because the input method window will
currently break showing desktop under wayland.

Under X11, an input method window is traditionally implemented as an
override redirect window. Under Wayland, the window should be treated
similarily, but now we have a special type for input method window.

BUG: 489057
FIXED-IN: 6.1
2024-07-13 23:35:29 -07:00
Xaver Hugl
3c87b7476e backends/drm: always expose brightness control
This allows the user to change the brightness level of content even if there's no
actual underlying "backlight" device. This is the case with many internal OLED
screens for example.

BUG: 413451
2024-07-14 00:03:28 +00:00
Xaver Hugl
faba2b6286 wayland: add support for controlling brightness devices exposed by powerdevil
This way, KWin can set the brightness on internal panels or external monitors with
DDC/CI support, without being exposed to the mess that is actually directly setting
the brightness.

This also adds a capability flag for brightness control to the output management
protocol. Powerdevil will expose a brightness slider for each output and change the
brightness setting of the output accordingly. KWin in turn changes the brightness
levels of the actual brightness device, or of a multiplier in compositing accordingly.
2024-07-14 00:03:28 +00:00
Joshua Goins
09003d03bc ButtonRebindsFilter: Support disabled buttons
It's sometimes wanted that you disable certain buttons on the device,
such as an annoyingly place side button on a drawing tablet. This now
makes it possible to do so by putting "Disabled" in the config. The
rebind filter will then ensure the events are stopped and none are
emitted.
2024-07-12 22:57:22 +00:00
David Edmundson
5b17454aa5 eis: Change default logging category to warning
This makes it consistent with other debug categories

BUG: 489957
2024-07-12 13:39:12 +01:00
l10n daemon script
7891ee6c41 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"
2024-07-12 01:19:11 +00:00
Xaver Hugl
de8bd8f126 plugins/fadingpopups: don't block direct scanout
The effect only modifies the opacity of individual windows that
WorkspaceScene::scanoutCandidate will reject anyways, so there's no reason
for it to block direct scanout.
Once a more proper solution for blocking direct scanout on individual items
is in place, this can be removed again

BUG: 487780
2024-07-11 16:54:25 +02:00
Vlad Zahorodnii
9240d75e51 plugins/screencast: Don't download texture data if target size and texture size mismatch
If glGetTexImage() gets called, it can write beyond the bounds of the
target size. In long term, it would be nice to relax this check.

CCBUG: 489764
2024-07-11 09:49:26 +00:00
Vlad Zahorodnii
a6743fd2f5 plugins/screencast: Allocate offscreen texture in WindowScreenCastSource::render(QImage) as big as the memfd buffer
textureSize() can temporarily mismatch the target buffer size. It can be
a problem if glGetTexImage() gets called. glGetTexImage() assumes that
the provided buffer is as big as the texture. If it's not, it will write
data outside the bounds of the buffer.

BUG: 489764
2024-07-11 09:49:26 +00:00
Nicolas Fella
6f410383fc Foward modifiers after disabling sticky keys
When disabling sticky keys while a key is latched or locked we unlatch the key, but don't tell the client until the next key event

Call forwardModifiers to tell the client immediately
2024-07-10 10:32:49 +00:00
Nicolas Fella
463d77ec18 Fix sticky keys for AltGr
We map AltGr to Qt::GroupSwitchModifier, but then ignore it

Instead map it to Mod5, which for some reason xkbcommon doesn't expose a define for

Also, since the Qt modifiers enum doesn't map nicely to XKB modifiers introduce our own enum to avoid confusion

CCBUG: 444335
2024-07-10 09:35:31 +00:00
Vlad Zahorodnii
18535ea959 Track xwayland buffer scale in X11Window
It can happen that when the xwayland scale factor changes, the logical geometry
will remain the same, but the x windows still need to reconfigured to update the
native geometry.

In order to address that, this change makes X11Window track the buffer scale
so if the logical geometry is the same, the x windows will be still reconfigured
with the new xwayland scale.
2024-07-10 07:54:15 +00:00
Vlad Zahorodnii
3f7b26cd9a Use the same logic to configure window during normal resize and interactive resize
X11Window::doInteractiveResizeSync() configures the x windows but it only
does a half of the things that should be done. The rest of it is assumed
to be performed by X11Window::updateServerGeometry() when XSync request is
acked later. The current state is not ideal and error prone.

This change makes X11Window::moveResizeInternal() and X11Window::doInteractiveResizeSync()
share the same code to configure the x windows to simplify the code.

It also drops X11Window::m_last{Frame,Client,Buffer}Geometry to further
simplify the code and make X window geometry tracking even more robust.
2024-07-10 07:54:15 +00:00
Xaver Hugl
706d604305 autotests: add a color pipeline test for identity transformations
If identity transformations aren't properly optimized out, we can have additional
rounding errors and reduced performance. This test ensures that doesn't happen
2024-07-09 20:10:47 +00:00
Xaver Hugl
9f2741af9f core/colorpipeline: make the matrix identity check fuzzy
Otherwise, really small rounding errors can cause the pipeline to be much
more complex than it really needs to be
2024-07-09 19:52:40 +00:00
Alik Aslanyan
3b34e9309b tiling: Don't put maximized windows in tile
After !5532 existing behavior in public scripting API was changed for maximized Windows.
Maximized Windows didn't have a tile on purpose.
This behaviour was changed, as after refactoring separate members for storing QuickTileMode in Window and tile itself were unified
Previously QuickTileMode::Maximize was only set in the Window itself in m_quickTileMode, while tile itself was removed (by setTile(nullptr)).

Current QuickTileMod for current Window isn't part of public scripting API, so it's okay to break it.

This restores compatability with scripts created for KWin 6.0.5 and earlier

BUG: 489463

Signed-off-by: Alik Aslanyan <inline0@pm.me>
2024-07-09 17:24:15 +00:00
Vlad Zahorodnii
230e456ffd plugins/screenshot: Port blitScreenshot() to glReadnPixels()
With glReadnPixels(), it can be guaranteed that the texture data won't
be written beyond the QImage buffer bounds.
2024-07-09 14:16:49 +00:00
l10n daemon script
c835fd76a3 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"
2024-07-08 01:18:27 +00:00
l10n daemon script
ce93b00285 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"
2024-07-06 01:18:59 +00:00
Xaver Hugl
f20ccabe80 backends/drm: do blending in gamma 2.2 space with color management too
This matches what we do without color management, and is more what users and app
developers expect. Going with linear blending before was mostly from it being more
"correct" / how physical blending of light works, but that doesn't really matter
when existing software expects it to behave differently.

BUG: 476868
CCBUG: 479755
2024-07-05 14:52:47 +02:00
Xaver Hugl
5b86dba6bf backends/drm: support arbitrary input transfer functions in the icc shader 2024-07-05 14:52:47 +02:00
Vlad Zahorodnii
50717a2f9a plugins/screencast: Clean up cursor scale tracking
Poll the screen cast scale from the source rather have code on top of
ScreenCastStream and ScreenCastSource that figures out by itself how the
cursor should be scaled. It ensures that the cursor size will be
consistent and it makes the ScreenCastStream initialization code simpler.
2024-07-05 07:08:48 +00:00
Kai Li
e4a272e166 wayland: add error handling for QFile::open failure in org_kde_plasma_window_get_icon
when creating a QDataStream object, if the file has not been successfully opened
before (file.open() fails), the created QDataStream object 'ds' may not function
properly. If you continue to perform the operation 'ds << icon;' in this case,
it may cause kwin to crash. Therefore, it is essential to ensure that the file
has been successfully opened before creating the QDataStream object.

Signed-off-by: likai <likai@kylinos.cn>
2024-07-05 09:33:01 +08:00
Nate Graham
b0970bd6c7 kcms/desktop: make list items conform to HIG
* Use correct deletion icon (this isn't a file).
* Use alternating list backgrounds to help line up the content on the
  left and right.
2024-07-04 11:09:27 -06:00
Xaver Hugl
40f50c9d0f placement: ignore the active output with place under mouse
BUG: 488110
2024-07-04 18:44:14 +02:00
Xaver Hugl
8c97c4dd31 backends/drm: move virtual outputs out of DrmGpu
They're not related to each other in any way
2024-07-04 16:25:14 +00:00
Xaver Hugl
0704319235 backends/drm: use the post-blending color pipeline for direct scanout
This makes direct scanout of SDR content on an HDR screen and vice versa possible,
as well as direct scanout while night color is active or the brightness isn't 100%.
2024-07-04 17:39:33 +02:00
Xaver Hugl
2799c270b4 backends/drm: implement support for post blending color pipelines
This exposes the degamma->ctm->gamma pipeline as a drm color op, which can
be set to a generic color pipeline. The same code can later be adapted to
program the upcoming per-plane color pipeline properties.
2024-07-04 17:39:10 +02:00
Xaver Hugl
5aaab715b0 core: add color pipeline class
This allows encapsulating color operations in a generic way, which can then be used in KMS or shaders.
The class automatically optimizes out unnecessary color operations like identity matrices, and
combines consecutive operations like
- matrix + matrix
- multiplier + multiplier
- matrix + multiplier
- EOTF + inverse EOTF
- relative EOTF + multiplier
to improve efficiency and make KMS offloading easier
2024-07-04 17:39:10 +02:00
Xaver Hugl
de85867675 core: add a TransferFunction class and move transfer function functions in there
This way it's more obvious where to find them, and the class can be extended with more
functionality later, like transfer functions with parameters
2024-07-04 17:19:31 +02:00
Xaver Hugl
372ea85326 bump clang-format to C++ 20
Otherwise it formats some newer C++ features wrong
2024-07-04 16:29:25 +02:00
Vlad Zahorodnii
9ce095dad3 opengl: Add OpenGlContext::glGetnTexImage()
Add glGetnTexImage() to be consistent with other robustness stuff.
2024-07-04 17:12:16 +03:00
Vlad Zahorodnii
74d7c33a97 plugins/screencast: Prefer glReadnPixels() and glGetnTexImage()
They should prevent potentially writing texture data outside the bounds
of the memfd buffer.
2024-07-04 17:11:38 +03:00
Vlad Zahorodnii
b452a5a5fb plugins/screencast: Hide cursor if another window covers screencasted window
BUG: 487294
2024-07-04 13:50:45 +00:00
Vlad Zahorodnii
8cb7e0a26b Simplify X11Window::updateServerGeometry()
There are two shapes that the WM needs to be concerned about: the input
shape and normal shape.

If the client window has custom input shape, the window manager should
synchronize it with all parent windows or ensure that its frame window
has an input shape as big as the client's input shape. The input shape
needs to be updated either when the client changes it or when the
X11Window is resized or its borders have changed. updateInputShape()
accomplishes that.

The normal shape is slightly different. If the window is decorated, the
window manager could ignore the shape set by the client. If the window
is not decorated, it's a good idea for the WM to synchronize client's
shape with the frame window's shape (if there's any). The frame window
shape doesn't need to be updated when it's resized, but if the client
window moves inside the frame window, it needs to be updated.

This change removes too generic updateShape() in the
X11Window::moveResize() code path and replaces it with a more targeted
code to update the shape, so updateServerGeometry() does not emit the
shapeChanged signal and it can be reused in the doInteractiveResizeSync()
function. Note that on wayland, it's unnecessary to synchronize the
shapes because the client window never moves in the frame window but it
is done anyway to minimize the differences between X and Wayland sessions
for easier maintenance.
2024-07-04 11:27:59 +00:00
Akseli Lahtinen
a99e1b6622 WindowHeapDelegate: label topMargin to small, remove height padding
This should help avoiding the window heap delegaet labels drawing on top
of each other in Overview effect.


BUG:489595
2024-07-03 20:33:09 +00:00
l10n daemon script
ec43eb08df 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"
2024-07-03 01:19:51 +00:00
Xaver Hugl
64d70029ec plugins/glide: drop references to closed windows if they're not animated
Otherwise the window might still be referenced from the opening animation, which
can lead to the effect wrongly keeping a reference to the window and staying active.

CCBUG: 485425
2024-07-02 23:52:21 +02:00
Vlad Zahorodnii
465873ecac plugins/screencast: Handle frame rate throttling timer firing a bit earlier
The QTimer can fire a bit earlier than expected. If that happens, don't
try to start it again, but record a frame instead.

CCBUG: 489602
2024-07-02 13:54:58 +00:00
Xaver Hugl
b103decda2 backends/drm: test and apply all mode changes at once
This avoids doing multiple atomic tests with outdated state for when multiple
outputs change simultaneously, and avoids crashing because outputs get used
before they're fully constructed
(https://crash-reports.kde.org/organizations/kde/issues/40960)
2024-07-02 14:59:06 +02:00
Vlad Zahorodnii
84e3ff88c3 Round X window gravity adjustment
Qt applications use Static window gravity by default. This means that if
a window decoration is created, the client window should remain at the same
position in the global coordinate space. To do that, X11Window needs to
move the frame geometry by (-borderLeft(), -borderTop()).

On the other hand, after making X11Window::framePosToClientPos() round
the window borders, the client window can end up being moved more than
expected when applying the gravity adjustment.

This change makes X11Window also round the gravity adjustment so the math
is consistent there and in the framePosToClientPos() function.

BUG: 489016
2024-07-02 11:25:50 +00:00
l10n daemon script
d1bac279de 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"
2024-07-02 01:18:59 +00:00
Marco Martin
9f7e30652c Don't assert on null output
don't blindly access m_tileManagers as it can assert
with out of bounds when output is not valid. This can happen
from scripting side as this function is wrapped in the javascript api.
2024-07-01 11:44:53 +00:00
Erwin Saumweber
d4152fafbd quicktiling: Reset layout when last quicktile ceases to exist
To not preserve invisible splits, last quicktile is differentiated
per split axis.

BUG: 465937
2024-07-01 07:53:06 +00:00
l10n daemon script
8084d995f6 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"
2024-07-01 01:17:12 +00:00
l10n daemon script
d5180fb91e 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"
2024-06-30 01:19:28 +00:00
Kristen McWilliam
42eb6389e2 virtualdesktops: improve readability
Adds whitespace between documented members of the header file.

Currently the members are all bunched together, making it difficult to
read as one flows directly into the next. This change adds a newline
between each member, making it easier to read.
2024-06-29 09:52:36 +00:00
Vlad Zahorodnii
172e26617c kcms/effects: Exclude internal effects
The internal effects implement some of the core plasma functionality, for
example screenshots, but being an effect is rather an implementation detail.

Also we have pivoted towards unloading the desktop effects kcm and moving
effect configuration in more appropriate places.

BUG: 488988
2024-06-29 09:40:43 +00:00
Vlad Zahorodnii
d6bca5bccd Add effects tab in debug console 2024-06-29 09:40:43 +00:00
Aleix Pol Gonzalez
718a0c26c0 backends/windowed: Port X11 Windowed backend away from XLib
It's a dependency that we have been porting away from.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
2024-06-29 09:29:47 +00:00
l10n daemon script
7d81f95592 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"
2024-06-29 01:19:28 +00:00
Xaver Hugl
f1a867ea12 color management: map reference luminance of source and target content to each other
This ensures that different content on the screen matches with the user configured
reference / SDR luminance, and both simplifies SDR<->HDR mapping by removing the need
for special casing that situation and significantly improves the mapping in some cases.
As we don't get any reference luminance values for HDR content (yet), this commit
assumes that HDR content is prepared for the reference luminance of the preferred
color description.
2024-06-28 13:16:02 +00:00
Xaver Hugl
15589c9997 color management: change brightness information names to be shorter and more correct
Brightness is a loose word for how bright we perceive things to be, but the
values we're using are about objective measurements, about luminance instead.
2024-06-28 13:16:02 +00:00
Xaver Hugl
280594354c plugins/qpa: set deprecated functions option correctly
If a context is forward compatible, that means the deprecated functions are not
available, and if the QSurfaceFormat::DeprecatedFunctions option is set, that means
they are available.
Wrongly setting QSurfaceFormat::DeprecatedFunctions thus causes Qt to use OpenGL in
a way the context doesn't actually support.

CCBUG: 486460
2024-06-28 12:50:50 +00:00
Vlad Zahorodnii
a9377db1a9 plugins/kdecoration: Fix MenuButton not accepting button press events
If two mouse areas are stacked on top of each other and a button press
event is sent so one of them accepts it, QMouseEvent::isAccepted() will
still return false. It's a QtQuick bug, see the associated upstream bug
report https://bugreports.qt.io/browse/QTBUG-126733.

On the other hand, given that the MenuButton implements its own input
handling, we can port it away from DecorationButton to mitigate the issue.

BUG: 488993
2024-06-28 12:38:04 +00:00
Xaver Hugl
8f35a9ea8d plugins/colorcorrection: simplify the effect, merge the shader files and support color management 2024-06-28 12:23:48 +00:00
Vlad Zahorodnii
cfe5bf2073 opengl: Reset OpenGlContext::currentContext() if it's destroyed
GlxContext destructor doesn't reset s_currentContext.

BUG: 488830
2024-06-28 11:24:58 +00:00
l10n daemon script
d7ad0083a5 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"
2024-06-28 01:24:07 +00:00
David Edmundson
d2c648f6cc input method: Drop unused member variable
The preedit struct holds values that need to be effectively double
buffered till the preedit string is set. There is no need to store the
text in this struct as it is reset at the end of setPreeditString
2024-06-27 22:05:41 +00:00
Andrew Shark
13b2c43b2b Add Colorblindness Correction effect keywords
This allows to easily reach this effect when searching in system settings.

BUG: 489329
2024-06-27 20:57:48 +00:00
Vlad Zahorodnii
3fd9026a01 Make X11Window::{update,discard}WindowPixmap noop on Wayland
These are relevant only to X11 session.
2024-06-27 20:34:42 +00:00
Vlad Zahorodnii
11d3f27e97 Remove the surfaces tab in the debug console
It's usefulness is doubtful, the current visuals poorly map to the
wayland abstractions, and it's partially incomplete because surface
previews are only shown for surfaces that have wl_shm buffers attached.
Tree hierarchy changes are also handled very poorly.
2024-06-27 20:54:42 +03:00
Xaver Hugl
8314cdf89d window: adhere to window rules in checkWorkspacePosition
BUG: 489117
2024-06-27 11:56:07 +00:00
Xaver Hugl
ad8c947134 plugins/hidecursor: show the cursor on tablet events
BUG: 489009
2024-06-27 12:38:14 +02:00
l10n daemon script
240af64c82 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"
2024-06-27 01:19:12 +00:00
Vlad Zahorodnii
585dd069f7 plugins/hidecursor: Change the defaults
It's more likely that this plugin will be enabled because of hiding
cursor when typing so let's use that by default.

CCBUG: 488971
2024-06-26 22:02:29 +03:00
Vlad Zahorodnii
4c8544c44f plugins/hidecursor: Allow disabling hiding cursor on inactivity
BUG: 488971
2024-06-26 22:02:03 +03:00
Vlad Zahorodnii
a41fac2d75 Switch to Xcb::Window geometry where it makes sense
There are a couple of reasons why it's worthwhile doing:

The first is that it makes the logic in the updateServerGeometry()
function reusable for the interactive code path. As of now, when the
window is being interactively resized, doInteractiveResizeSync() will
issue some xcb_configure_window() calls but then it also implicitly
assumes that updateServerGeometry() will call updateShape() and
updateInputWindow() but skip m_frame.setGeometry() later. That is
confusing, and error prone. For example, if somebody drops
m_lastFrameGeometry in favor of m_frame.geometry() (which is an
absolutely reasonable thing to do btw!!), a regression will be
introduced: things would appear to work at first, but then eventually
bug reports about input working weirdly would start piling up.

The second is hidpi scaling of wayland clients. toXNative(a + b + c)
is not the same as toXNative(a) + toXNative(b) + toXNative(c). By
switching to the device geometry, we leave less space for making an
error.

The third is that lets us clean up some geometry manipulation code.
When dealing with window hierarchies, it's more convenient to have
m_window.position() rather than a dedicated property in the X11Window
class such as wrapperPos().
2024-06-26 17:53:31 +00:00
Vlad Zahorodnii
02d43147b5 utils: Add convenience geometry getters in Xcb::Window 2024-06-26 17:53:31 +00:00
Akseli Lahtinen
07dcede820 WindowHeapDelegate: Label text background
Give label text background color to make it easier to distinct from the background.


BUG:483016
2024-06-26 16:00:54 +00:00
Vlad Zahorodnii
4c86653cd5 utils/xcbutils: Use window geometry in device pixels
If the logical geometry changes, the X11Window still needs to verify
whether the currently applied native geometry differs from it. In order
to do that, the X11Window needs to map the logical geometry to the device
pixels. Given that X11Window already maps the logical pixels to the
device pixels, the Xcb::Window doesn't need to map the geometry again.

Also, the way different coordinate spaces are handled now is inconsistent.
Some things (Xcb::Window) work only with the logical pixels, while other
(e.g. client messages) require the user manually mapping the geometry
between the different coordinate spaces. With this change, it would be
more consistent.

Regarding the porting process, it was performed in a single step because
all the code that changes or reads Xcb::Window geometry is neatly
encapsulated in the X11Window class in a couple of functions.
2024-06-26 18:06:06 +03:00
Xaver Hugl
eb7b04e320 core/colorspace: make max brightness values optional
Zero is already optional, but it's easy to make mistakes that way
2024-06-26 15:41:38 +02:00
Xaver Hugl
bdc24ff8c7 core/colorspace: add mastering display colorimetry
The mastering display colorimetry describes what part of the colorspace
is actually used, which is important when we're sending desired metadata
about a screen using the rec.2020 container colorspace, or when the client
uses an "infinite" / extended colorspace like scRGB
2024-06-26 15:41:38 +02:00
Xaver Hugl
b35edf8d30 plugins/backgroundcontrast,blur: correct support checks
On Xorg, the effects need support for OpenGL blits, but on Wayland, the
screen texture can be used instead
2024-06-26 14:52:38 +02:00
Xaver Hugl
60a483471c opengl/glframebuffer: handle missing support for blits on Wayland
If OpenGL blits aren't supported, we can still copy the area by sampling the
texture for the screen on Wayland

BUG: 484193
2024-06-26 14:52:38 +02:00
Xaver Hugl
0773db0710 opengl: glBufferStorage is not supported on GL ES by default
CCBUG: 484193
2024-06-26 14:52:33 +02:00
Vlad Zahorodnii
9e57469c2f kcms/effects: Remove shake cursor keywords
It's confusing when the Desktop Effects shows up in the search results
while looking for "shake cursor".

BUG: 488850
2024-06-26 09:02:41 +03:00
l10n daemon script
f0fad81963 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"
2024-06-26 01:19:45 +00:00
Vlad Zahorodnii
7590c6d386 wayland: Bump default max buffer size to 1 MiB
This is to prevent disconnecting clients that sometimes struggle with
keeping up with the events that the compositor sends. 1 MiB was eyeballed.

Wayland's wire protocol consists of a stream of messages. Every message
consists of a header (2 words: 1 word for object id, the other word
specifies the message size + event/request opcode) and the arguments.

Considering the compositor sending motion events generated by a mouse
with 1000Hz polling rate, we have

- wl_pointer.motion event size: (4 bytes for serial + 4 bytes for x +
  4 bytes for y + 8 bytes for header) = 20 bytes
- wl_pointer.frame event size: 8 bytes for header

So in total, if the client freezes for a second, the client buffer size
should be at least (20 + 8) * 1000 / 1024 = 27 KiB. 1 MiB corresponds to
the client not processing the motion events for approximately 30 seconds.
2024-06-25 20:19:59 +03:00
Xaver Hugl
5a0ecdba33 opengl/eglcontext: bail out early if we can't use complex shaders
Some old hardware is very limited in the amount of instructions it can support.
In order to not have KWin fail to composite, reject using hardware acceleration
in this case and fall back to llvmpipe or QPainter

BUG: 482868
2024-06-25 13:49:01 +00:00
Xaver Hugl
c5fb21fd8b core/renderloop: assume high render times if the last frame has been a while ago
This helps avoid some frame drops after the GPU may have went into a lower power
state. While this isn't generally noticeable, avoiding this makes noticing and
debugging actually relevant frame drops easier

CCBUG: 488843
2024-06-25 13:07:36 +00:00
Aleix Pol Gonzalez
2601d06f5b Fix !KWIN_BUILD_GLOBALSHORTCUTS builds
Makes it so the GlobalShortucts object gets built and its KGlobalAccelD
parts get disabled.

Addresses the TODO in GestureHandler.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
2024-06-25 11:21:56 +02:00
Aleix Pol Gonzalez
a7470f4b4a core/renderjournal: Make sure we include std::span 2024-06-25 11:13:59 +02:00
Vlad Zahorodnii
44ea9ee959 scripting: Add a temporary workaround to fix build without global shortcuts 2024-06-25 07:29:48 +00:00
Vlad Zahorodnii
059f66af9a scripting: Port gesture handlers to native gesture apis
If a SwipeGesture or a PinchGesture is cancelled, the associated QAction
is going to be triggered. It is against the expectations of the gesture
handlers.

In order to address that, this ports the gesture handlers to the native
gesture apis, which expose whether the gesture has been started or cancelled
better.
2024-06-25 07:29:48 +00:00
Vlad Zahorodnii
c958a75e2b scene: Drop ItemRendererOpenGL::RenderNode::scale
It's unused.
2024-06-25 06:56:56 +00:00
Alik Aslanyan
47ee47dcc8 tiling: Add fallback path for the first Polonium tile
After !5532 a new code path was triggered during Workspace::rearrange call.
When first Polonium window opens on any screen, there is no active tile yet.
This forces geometry calculation in Window::checkWorkspacePosition -> Window::ensureSpecialStateGeometry
To return empty QRect, which depending on the screen arrangement will move window to the other screen.

This confuses Polonium plugin, as it receives wrong outputChanged signal in scripting API.

BUG: 488898
Signed-off-by: Alik Aslanyan <inline0@pm.me>
2024-06-25 05:59:11 +00:00
Vlad Zahorodnii
a97c748d1c plugins/shakecursor: Harden cursor theme loading logic
The currently used cursor theme can be different from the configured one.
For example, if the configured theme cannot be used.

In order to ensure that that case is handled well, this change makes the
shake cursor plugin uses the same cursor theme as PointerInputRedirection.
2024-06-25 05:38:59 +00:00
Vlad Zahorodnii
1384a8d3fd utils: Fix XCURSOR_PATH envvar parsing
The XCURSOR_PATH environment variable can contain "~/.icons". Unfortunately,
QDir does not expand the tilda, we need to do it ourselves.
2024-06-25 05:38:59 +00:00
Vlad Zahorodnii
d6b3baec8f plugins/shakecursor: Include high resolution breeze cursor themes 2024-06-25 05:38:59 +00:00
Vlad Zahorodnii
53221fd43f utils: Allow specifying XCursor theme search paths 2024-06-25 05:38:59 +00:00
Vlad Zahorodnii
28b396f44c plugins/shakecursor: Display default cursor shape
At the moment, the shake cursor respects the current cursor shape. But
there are couple of drawbacks behind doing it: the first is that it's
very likely that the cursor pixmap has low resolution, the second is
the cursor can be hidden client-side.

This change makes the shake cursor plugin load the Xcursor theme with
a high enough size and display the default cursor shape regardless of
what the client has set in order to address the two aforementioned issues.
2024-06-25 05:38:59 +00:00
Vlad Zahorodnii
6a2bc79dae Make FocusChain ignore closed windows
At the moment, the FocusChain has Q_ASSERT()s to prevent inserting closed
windows back into the focus chain. It makes sense on paper. But, there
are code paths that could still hypothetically call FocusChain::update(),
they are harmless except the logic in the FocusChain.

So instead this change makes the FocusChain ignore closed windows, i.e.
take a more defensive approach. There are a few reasons why it's
worthwhile doing: the first is that it would prevent inserting closed
windows back into the focus chain in release builds and potentially even
back into the stack, debugging such crashes is absolutely no fun; the
second is that it would be preferred to avoid sprinkling random
isDeleted() checks in the Window code here and there and thus making
the code harder to follow.
2024-06-25 05:23:40 +00:00
Xaver Hugl
03eb688818 core/renderloop: also log the predicted render time
It can be used to better judge why a frame was dropped
2024-06-24 20:59:14 +02:00
Xaver Hugl
4453ce7eef backends/drm: update output properties after they're created too
Otherwise we might miss some changes that come without a hotplug event,
like adaptive sync becoming available after the output has been initialized

BUG: 486149
2024-06-24 18:47:00 +02:00
Xaver Hugl
3b3c75a8e9 core/renderjournal: remove unnecessary includes 2024-06-24 15:05:32 +00:00
Vlad Zahorodnii
ad4e27f5ef opengl: Remove code that prints gl platform details
It's printed whenever any opengl context is created, which can flood the
logs. On the other hand, this information is also included in the support
information, which we often ask in the bug reports.

BUG: 489000
2024-06-24 15:03:11 +00:00
Xaver Hugl
21a0ae31b7 plugins/screencast: test creating a dmabuf with the real modifier list
The test isn't useful if it tests different parameters than we're actually using
2024-06-24 16:43:09 +03:00
Xaver Hugl
a169114fee core/renderloop: log frame statistics into a file
Data like target vs. actual pageflip time, and render times is often needed for
debugging or optimizing render time predictions, so this commit makes KWin print
that information to a file in the home directory whenever KWIN_LOG_PERFORMANCE_DATA
is set.

CCBUG: 488843
2024-06-24 15:26:18 +02:00
Aleix Pol
0eb02c8b2c plugins/slidingpopups: adopt input panels from when they're added
Now that they will be shown and hidden in the proper state, we can set
up the input panel slide as the window gets added and ignore the
geometry changes that it will have in its lifetime.
2024-06-24 12:48:05 +00:00
Aleix Pol
b1bd3ff630 inputpanelv1window: polish window states
Do not markAsMapped an unpositioned panel, it would confuse the sliding
popups effect and force it to figure out its state in creative ways.
Mark the panel window as hidden as it gets destroyed.
2024-06-24 12:48:05 +00:00
Vlad Zahorodnii
1dbef2d5ed backends/drm: Fix DrmCrtc::queryCurrentMode() accidentally resetting m_crtc to null
Otherwise kwin will likely crash.
2024-06-24 12:32:24 +03:00
Vlad Zahorodnii
944be3d55a Drop WaylandServer initialization flags
These flags affect kwin in general so WaylandServer is not the best place
for them to live in. For such things, we typically add properties in the
Application object, which is what this change does.
2024-06-23 17:53:17 +00:00
Yifan Zhu
c6ac6d3caa scene: install all the headers 2024-06-23 01:59:43 +00:00
l10n daemon script
85badd901d 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"
2024-06-22 01:20:29 +00:00
Vlad Zahorodnii
7eb9f75af2 plugins/glide: Subdivide window quad grid
The way the glide effect works is that it takes 2D geometry and applies
the perspective projection to it on the CPU side. The reason we do it is
that the scene is 2D.

However, this leaves us with the well known problem where a texture
that's mapped to a trapezoid won't be correctly interpolated along the
diagonal.

It can addressed by performing a perspective division in the fragment
shader, but given the way the effect is structured, it's off the table. So
instead subdivide the window grid.

BUG: 488840
2024-06-21 12:46:28 +00:00
Xaver Hugl
b745f83339 x11window: remove unused variable 2024-06-21 12:34:35 +00:00
Xaver Hugl
9293df2681 plugins/zoom: do colorspace conversions between the screen textures
Otherwise colors and especially brightness levels can be quite wrong when
the textures are used on a different screen

BUG: 488839
2024-06-21 14:26:12 +02:00
Vlad Zahorodnii
2fb485d67d plugins/screencast: Unset only cursor id when the cursor is invisible
We are doing half a job of resetting spa_meta_cursor, the actual cursor
content is still left as is. On the other hand, it should plenty enough
to simply reset the cursor id. The clients are expected to call
spa_meta_cursor_is_valid().
2024-06-21 05:54:25 +00:00
Vlad Zahorodnii
16f6473f56 Add closed window guards in X11Window::doSetXYZ() methods
It won't hurt to have them.
2024-06-21 05:35:13 +00:00
l10n daemon script
268d066f4f 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"
2024-06-21 01:18:41 +00:00
Vlad Zahorodnii
9276d28b3d plugins/shakecursor: Ignore animation speed
From the user perspective, shaking cursor is not perceived as an
animation, so let's ignore the global animation speed factor.

BUG: 488813
2024-06-20 22:28:49 +03:00
David Redondo
1a916293dc plugins/eis: Make input capture activation ids unsigned
The portal API is specified with unsigned ids. Let's make them
unsigned all the way through.
2024-06-19 11:49:31 +00:00
Xaver Hugl
92f1fabe5b wayland_server: create a new screen locker connection when the greeter gets restarted
Otherwise, Wayland objects and protocol errors can cause the new instance to not start
2024-06-19 11:09:10 +00:00
Xaver Hugl
b107295c03 windowheap: don't animate the position of windows that get hidden
The target position is zero, so they just move into the top left corner,
which looks weird. With this commit, they just fade away without moving
2024-06-19 10:17:53 +00:00
Vlad Zahorodnii
e316694675 backends/x11: Move the contents of common/ to standalone/
It's used only there.
2024-06-19 08:56:12 +00:00
Vlad Zahorodnii
8a5bae0f86 backends/x11: Port away from XRenderPicture 2024-06-19 08:56:12 +00:00
Vlad Zahorodnii
ad31fd6b18 plugins/nightlight: Fix dbus property types
currentTemperature, targetTemperature, and mode properties have "u" type.
But there is a mismatch between the property types declared in the
Q_PROPERTY macro and the org.freedesktop.DBus.Properties.PropertiesChanged
signal.

This change makes the property types consistent and match the types
declared in the xml file.
2024-06-19 05:29:11 +00:00
Vlad Zahorodnii
1dee66a36c plugins/nightlight: De-duplicate dbus code 2024-06-18 18:14:07 +00:00
David Redondo
1b1af29de9 Sync xwayland eavesdropping default in kwin.kcfg
Amends a136a159f9 which changed the value in the kcfg file that the kcm reads, KWin uses options.kcfg
4f322e24d3 changed the in code default but this will be later overriden when loading the options.
2024-06-18 07:39:22 +00:00
Aleix Pol Gonzalez
559b0cccf5 shm: support textures of 3 bytes-per-color
Adds support for BGR888 and RGB888.
Some clients use it and we just fail to render them, making devs
thinking that kwin is broken.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
2024-06-17 22:24:16 +00:00
Vlad Zahorodnii
7fca508619 Remove code that updates the focus chain in Window::setSkipTaskbar()
skipsTaskbar() doesn't influence whether the window wants input.
2024-06-17 20:04:11 +00:00
Vlad Zahorodnii
0fc6c6800e Get rid of extra string allocations in src/inputmethod.cpp 2024-06-17 19:01:12 +00:00
Xaver Hugl
c761571a43 workspace: don't use an empty list as "don't update"
It's confusing and caused the xwayland scale to not be updated in all situations
where it should be updated
2024-06-17 20:49:52 +02:00
Xaver Hugl
4f5fce8b7a workspace: also update xwayland scale when not changing the output order 2024-06-17 20:41:58 +02:00
Alessandro Astone
170b138026 wayland: Allow configuring locale1 mode from kwinrc
KWin already supports following org.freedesktop.locale1 for the
keyboard keymap, but only by passing a command-line option. This is
typically used in SDDM when running the greeter in kwin_wayland.

We want to use locale1 mode in livesys environments too, so that
environment-agnostic installers can configure the keyboard and also
immediatly apply the same configuration to the running desktop.
When KWin is started through `startplasma` we cannot easily supply
an extra command-line option, so we need to make this configurable
from the external environment, in the form of a KConfig.

The command-line option will keep precedence over the KConfig.
2024-06-17 17:52:29 +00:00
Xaver Hugl
7e2d650c8f plugins/nightlight: remove unnecessary commitGammaRamps 2024-06-17 16:17:24 +00:00
Vlad Zahorodnii
af16c9b243 wayland: Make org_kde_kwin_shadow use GraphicsBufferRef
It makes the graphics buffer referencing less error prone.
2024-06-17 11:48:06 +00:00
Vlad Zahorodnii
1a7c94b692 wayland: Fix buffer ref'ing in org_kde_kwin_shadow.commit
In case the current state and the pending state have the same buffer for
a particular side or a corner, that buffer can be prematurely released
because the buffer in the current state is unreferenced first.

The ref/unref order should be vice versa to ensure that the GraphicsBuffer
is not released prematurely.
2024-06-17 11:48:06 +00:00
Marius P
ba599a2aa0 Prefer en_US, "centre" -> "center" 2024-06-17 05:29:59 +00:00
Nate Graham
68b7448847 plugins/showpaint: set default shortcut
This effects is off by default, which means to instruct someone how to
use it for debugging purposes, you need to both tell them to enable it,
and then also teach them how to assign a shortcut for it.

Since it's off by default, there's no harm in setting a shortcut, which
simplifies the enablement instructions. I've chosen Meta+Ctrl+Alt+P,
which uses so many modifiers that it won't conflict with anything.
2024-06-16 11:01:40 -06:00
Xaver Hugl
178d49093c backends/drm: don't do direct scanout when HDR brightness isn't 1
Otherwise the brightness multiplier doesn't get applied
2024-06-16 17:11:43 +02:00
Vlad Zahorodnii
29a5541ccf wayland: Reset dnd state when the target surface is about to be destroyed
Use the SurfaceInterface::aboutToBeDestroyed() for the consistency sake
with other code that performs cleanup when the wl_surface is destroyed.
2024-06-15 15:11:53 +00:00
Vlad Zahorodnii
e1192a6934 plugins/nightlight: Drop NightLightManager::self()
It's unused.
2024-06-15 12:06:06 +03:00
Vlad Zahorodnii
d00d00c7fc plugins/nightlight: Tidy header include directives 2024-06-15 12:03:39 +03:00
Vlad Zahorodnii
6b4ef4170c plugins/nightlight: Shuffle some code
Keep things that are related spatially close, in this case, the
initialization of the timer that will start the next transition.
2024-06-15 11:37:26 +03:00
Vlad Zahorodnii
d595b8f8aa plugins/nightlight: Rename FALLBACK_SLOW_UPDATE_TIME 2024-06-15 07:58:15 +00:00
Vlad Zahorodnii
55dc891190 plugins/nightlight: Store transition duration in milliseconds
This allows us to make the code that computes transition timings more
cleaner, and other time constants are in milliseconds, so it makes sense
to make m_transitionDuration store milliseconds too.
2024-06-15 07:58:15 +00:00
l10n daemon script
927fb42abc 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"
2024-06-15 01:19:16 +00:00
Vlad Zahorodnii
3461d5bc3a plugins/nightlight: Unobfuscate code that reads geocoordinates
The current code is unreadable:

- it creates a lambda that captures two local variables for latitude and longitude
- then it copies values from the config to those local variables
- calls the lambda
- and finally copies the data from the local variables to the NightLightManager fields

That code can be simplified by simply calling checkLocation() directly
and using an if statement.
2024-06-15 01:29:59 +03:00
Vlad Zahorodnii
e5528e9317 plugins/nightlight: Rename variables and functions to adhere to the KDE coding conventions
The variables and functions should be fully spelled out, with temporary
variables being an exception.
2024-06-14 18:24:06 +03:00
Vlad Zahorodnii
786b3ffbae plugins/nightlight: Guard against invalid timings in the config
Morning and evening timings should be ordered correctly. When computing
the daylight duration, that ternary operator should not be needed and it
hides other bugs.
2024-06-14 18:00:53 +03:00
Vlad Zahorodnii
07f266e7c7 plugins/nightlight: Remove premature optimization in updateTransitionTimings()
There are a couple of reasons why it's worth removing it:

- it's error prone. If one forgets to pass correct "force" flag, night
  light will break
- it contributes some complexity
- updateTransitionTimings() is not called in any hot path and the code
  that calculates the position of the Sun is not resource intensive
2024-06-14 14:26:35 +00:00
Vlad Zahorodnii
5fe9e9c756 plugins/screencast: Check compositing type
Screencasting only works with OpenGL compositing at the moment.
2024-06-14 12:50:46 +00:00
Vlad Zahorodnii
8256f8e14c Reorder some function calls in X11Window::updateServerGeometry()
The main motivation is to improve code aesthetics. The relative
order in which various window properties are configured shouldn't
matter.
2024-06-14 12:37:56 +00:00
Vlad Zahorodnii
5d03d58dc1 Drop X11Window::resizeDecoration()
We can call updateInputWindow() directly.
2024-06-14 12:37:56 +00:00
Vlad Zahorodnii
a7c4175099 Don't call triggerDecorationRepaint() when resizing an X11Window
Wayland windows have no such code path and they have been good so far.
If the borders change, KDecoration will trigger a repaint.
2024-06-14 12:37:56 +00:00
Vlad Zahorodnii
fef2bfb93f plugins/nightlight: Make Night Light more robust to QTimer firing slightly earlier
Currently, resetSlowUpdateTimers() will start a timer that will pass
m_next.first as the current time to resetSlowUpdateTimers(). This kind
of works, but there are more code paths where updateTransitionTimings()
can be called.

This change hardens updateTransitionTimings() against the current time
being very close to the start of the next transition by introducing a
time fudge factor.

If we are currently 1 second away from the start of the next transition,
then it is assumed that that transition has been reached, and we need
to calculate the timings of a transition after that.
2024-06-14 12:06:34 +00:00
Vlad Zahorodnii
ad98069618 Make Window::closeWindow() noop if the window is already closed
The surface handle can be dropped by that time. Also, there is no point
to ask the client to close the window again if it's already closed.
2024-06-14 11:16:41 +00:00
Vlad Zahorodnii
ec86640f44 plugins/nightlight: Tidy temperature lerp code
This change simplifies the color temperature interpolation code by doing
the following:

- compute a progress value so 0 corresponds to target1, i.e. the beginning
  of the transition, and 1 corresponds to target2, the end of the
  transition, instead of vice versa
- and use std::lerp() function

Rounding to a multiple of ten is not needed, it is for nicer digits in
the applet, but if the applet really cares about it, it could perform
such rounding on its own. In the night light manager, it's better to avoid
rounding the interpolated values because that can result in the final
temperature getting outside of the [target1, target2] interval.
2024-06-14 07:22:03 +00:00
David Redondo
c2141dc4ef Also wake up screens on tablet interactions
BUG:451359
FIXED-IN:6.1.1
2024-06-14 06:54:42 +00:00
Vlad Zahorodnii
f46174453d plugins/nightlight: Ensure the target temperature remains within reasonable bounds
The interpolated temperature can get out of the bounds of [target1, target2]
if the current time is slightly earlier than m_prev.first, which can be
unexpected. This change addresses that by adding a relevant guard.
2024-06-13 15:58:01 +03:00
Vlad Zahorodnii
21a45c2700 Avoid sending X11 sync request if new logical geometry doesn't change the device geometry
There are two mechanisms to throttle ConfigureNotify events during
interactive resize:

- either using XSync
- or by a dummy QTimer

The QTimer approach is pretty straightforward: the wm configures the
window, blocks the interactive resize operation and arms a timer to
unblock it some time later in the future.

With the xsync approach, the wm sends an xsync request, makes a
call to XConfigureWindow(), and blocks interactive resize until
the xsync request is acked by the client. When the client sees the
ConfigureNotify event, it is going to repaint and ack the xsync request.
When the xsync request is acked, the wm will apply new geometry and
unblock interactive resize.

After the scaling changes, the logical geometry can have some fractional
part, which gets rounded when configuring the X windows. Due to that,
it's possible to encounter the case where the logical geometry changes,
but the native/device geometry does not due to std::round(). In that
case, the wm should not send an xsync request because the client won't
ack it because the device geometry has not changed.

BUG: 488223
2024-06-13 08:34:30 +00:00
Xaver Hugl
ad6700dd88 workspace: initialize the output config store earlier
It needs to be created before the outputs are queried the first time,
as that uses the config store
2024-06-12 19:32:36 +02:00
Xaver Hugl
6543ab3caa workspace: only load output configs on Wayland
They don't need to be loaded, or on exit saved again on X11

BUG: 488229
2024-06-12 17:46:31 +02:00
Vlad Zahorodnii
c2ca1cc33d wayland: Remove unnecessary wl_surface resource check
The lifetime of SurfaceInterface matches the lifetime of the corresponding
wl_resource.
2024-06-12 13:43:00 +00:00
Vlad Zahorodnii
8fb3348600 wayland: Clean up action matching connections when the target dnd surface dies 2024-06-12 13:43:00 +00:00
Vlad Zahorodnii
877d220bfe wayland: Fix a crash in dnd action matching
In order to match dnd actions, we need both a data source and a data
offer. If the preferred actions of either change, then a new dnd
must be chosen.

The code that sets up the monitoring of the preferred actions of the
data offer sets the correct receiver context object (data source).

But the code that sets up the monitoring of the preferred actions of
the data source uses the data source as the receiver context object,
however we would like to break the matchOffers connection when either
the data source or the data offer is destroyed.
2024-06-12 13:43:00 +00:00
Vlad Zahorodnii
f37c15b0a2 Enable drkonqi
Enable dr konqi for kwin so sentry crash reports are more useful.
2024-06-12 12:45:47 +00:00
Vlad Zahorodnii
6be238e622 Fix registering touch screen edge actions after the screen edge has been reserved
After the screen edge is reserved, the touch screen gestures will be
registered or unregistered when the Edge::activatesForTouchGesture()
signal is emitted.

On the other hand, Edge::reserveTouch() lacks code to emit that signal,
which results in touch screen gesture not working if the same screen
edge is reserved both for pointer and touch input.

BUG: 451349
2024-06-12 12:33:52 +00:00
Xaver Hugl
35a7e30952 backends/drm: set scaling mode to full aspect with generated modes on internal displays
While the scaling mode has caused some issues with external displays, we've had several
reports that using "unify outputs" has caused the internal display to no longer show
anything, as it changes to an unsupported mode. This sets the scaling mode so that the
driver handles the scaling internally, instead of leaving it up to the panel, and it only
does so on internal displays with generated modes, to minimize the risk of further breakage.

BUG: 488111
2024-06-12 11:50:57 +00:00
Jie Liu
131c5399b3 x11window: enable startSystemMove/Resize which is triggered from touch events
Signed-off-by: Jie Liu <liujie01@kylinos.cn>
2024-06-12 02:19:02 +00:00
l10n daemon script
1c3b4cc548 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"
2024-06-12 01:19:49 +00:00
David Edmundson
d6360cc4ce effects: Drop morphing popups effect
The effect does not work very well for two main reasons:
Some clients will make a new popup rather than move an existing one, so
whether it does anything is highly unpredictable as a user.

Popups can be of massively different sizes with different amounts of
text. This means the text in the smaller popup gets resized which
doesn't look like a natural in-between state of the two popups. This
defeats the objective of looking smoother.

On top of that, it's rather glitchy.
This effect was purely visual, no functionality changes.

BUG: 473411
BUG: 466638
BUG: 416048
BUG: 461501
BUG: 466637
2024-06-11 19:58:50 +00:00
Vlad Zahorodnii
64b02cf464 plugins/screencast: Preserve modifier order
The SPA_FORMAT_VIDEO_modifier property has the following format:

    preferred_value,alternative1,alternative2,...

The preferred value is usually the same as the first alternative value.
It can also happen that the modifier list the compositor has supplied is
not good either and it contains duplicate entries, specifically
`DRM_FORMAT_MOD_INVALID` to indicate that modifier-less buffers are
supported.

In order to deal with that, the screencast plugin removes the
duplicates by sorting the modifier list and then using std::unique().

That is not good, there is no written rule that the order of the
modifiers passed to the graphics buffer allocator matters but it
typically does, some drivers in mesa assume that the modifiers are
sorted in the preference order. The graphics buffer allocator might be
also very lazy and just look at the first supplied modifier instead of
wisely choosing the best modifier.

This change makes the ScreenCastStream remove the duplicate modifiers
in a more conservative fashion preserving the relative order of the
modifiers. It also removes an extra `{DRM_FORMAT_MOD_INVALID}` because
this kind of thing should be dictated by the render backend.
2024-06-11 10:39:19 +03:00
Aleix Pol Gonzalez
f9b9149ba4 plugins/showfps: Allow showfps to work without kirigami and quickcharts
showfps is a handy plugin when deploying to a new platform because it
will render something that says "I am here".
Since both kirigami and quickcharts are quite high level, we add a
variant that just depends on QtQuick and shows the fps which is what we
promise anyway.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
2024-06-10 17:32:28 +02:00
Aleix Pol Gonzalez
b202ecf711 aaaa 2024-06-10 17:32:28 +02:00
Aleix Pol Gonzalez
3c857a3375 scripting: Do not crash when calling workspace.clientArea() without an output
Just set a default one, one way less a script can crash kwin.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
2024-06-10 17:23:43 +02:00