Commit graph

23847 commits

Author SHA1 Message Date
Nate Graham
7a4c2a5caa kcmkwin/xwayland: put radio buttons in a FormLayout
This is the typical way we do this. The result looks the same in a
width-constrained window, but uses the more common FormLayout
appearance for big windows.
2022-12-15 15:07:04 -07:00
Vlad Zahorodnii
07a022de5b Use glGetTexImage() in GLTexture::toImage()
glGetTextureImage() requires OpenGL 4.5+. glGetTexImage() is available
since OpenGL 2.0.
2022-12-15 21:03:18 +00:00
Harald Sitter
8f36c0f66f buttonrebinds: some stylistic polish
- obey rule of 5
- always initialize variables at declaration
- don't be needlessly explicit about things
- prefer std::array over c arrays
- don't else if after return
2022-12-15 20:06:20 +00:00
Vlad Zahorodnii
bf48c3b80d scene: Remove dnd icon hack
Currently, kwin blits the dnd icon onto the cursor image. This doesn't
work on mobile because the cursor is usually hidden there.

As a short term solution, put the dnd icon in the Scene. In the future,
it needs to be put in its own render layer.
2022-12-15 19:19:37 +00:00
Vlad Zahorodnii
2d71eb720b backends/wayland: Allocate buffers with GBM_USE_SCANOUT too
It most likely doesn't matter in real life as many compositors don't use
direct scanout for windowed surfaces, but it won't hurt.
2022-12-15 17:53:07 +00:00
Vlad Zahorodnii
a14998b790 backends/wayland: Port away from gbm_bo_create_with_modifiers2()
gbm_bo_create_with_modifiers2() is quite new and there are still distros
that ship 21.2 and older.
2022-12-15 17:53:07 +00:00
Aleix Pol
fc2447071e Xwayland: Allow users to optionally let Xwayland eavesdrop on certain modes
It's somewhat popular for voice communication applications to support
Push-to-Talk. This means that the process itself expects to get all of
the system input. This behaviour albeit sound does not work on Wayland
systems.

This commit adds an option to let legacy X11 applications that assume
they will be getting all information to do so until these apps are
properly ported to the XDP GlobalShortcuts.
2022-12-15 16:35:37 +00:00
Aleix Pol
245859637f kwaylandserver: avoid creating unnecessary containers just to iterate 2022-12-15 16:35:37 +00:00
Xaver Hugl
096351cff7 wayland/outputmanagement: ignore non-desktop outputs
Otherwise, applying all output configurations fails when you have a VR
headset connected
2022-12-15 13:58:58 +00:00
Arjen Hiemstra
63ba8e0eaf scenes/opengl: Use hardware clipping for clearing the background
Right now, when `paintBackground()` is called to clear the background,
we use custom geometry and render that when the damage region isn't
infinite. Rather than using geometry, we can instead use `glScissor()`
to set the area that needs to be cleared and then use `glClear()` to
clear it.

In addition, if we have only one rect in the damage region and that rect
matches the render target rect, we can completely skip all that setup
and use `glClear()` directly.
2022-12-15 12:12:32 +00:00
Vlad Zahorodnii
f8fb0feab8 scene: Decouple SurfaceItem from Window
The main motivation is to allow SurfaceItem used to be to present non
window contents.
2022-12-15 11:15:21 +00:00
Vlad Zahorodnii
93f053b514 Remove QRegion argument in Window::damaged() signal
In most places, it's actually not needed and we actually provide wrong
damage region at the moment anyway. In long term, it would be great to
drop the Window::damaged signal.
2022-12-15 11:15:21 +00:00
Philipp Sieweck
b095f51035 window: Fix potential freeze during resize
The loop in `Window::handleInteractiveMoveResize` "bruteforces" the
value for `nextMoveResizeGeom` such that the area of
`nextMoveResizeGeom` contains at least `requiredPixels`. In each loop
iteration, one or more attributes (left, right, top, bottom) of
`nextMoveResizeGeom` are selected to be moved +/-1.0 towards the value of
`currentMoveResizeGeom`. The loop terminates if either the area of
`nextMoveResizeGeom` is large enough or `nextMoveResizeGeom ==
currentMoveResizeGeom`.

The problem is that the variables compared and adjusted here are floating
point variables, and their difference may not be a whole number. Using
+/-1.0 adjustments can make the loop oscillate indefinitely around the
target value.

This commit ensures loop termination by using `qFuzzyCompare` to compare
floating point values and correctly handles the cases where adjustments
smaller than 1.0 are needed to reach the target value.
2022-12-15 10:10:56 +00:00
Xaver Hugl
0efb8d01db wayland: implement output order interface
Only thing missing is the kscreen integration bit, but that can't be done before kscreen actually stores the output order somewhere.

Depends on https://invent.kde.org/libraries/plasma-wayland-protocols/-/merge_requests/52
2022-12-15 10:08:36 +00:00
Vlad Zahorodnii
d740fca68c backends/x11: Port to SHM
The main motivation behind this change is to let kwin use the PRESENT
extension to present output contents when using QPainter backend, so we
get PresentCompleteNotify events.

Besides that, we could potentially make X11 windowed backend forward
wl_shm_buffers to Xorg.
2022-12-15 08:09:22 +00:00
Vlad Zahorodnii
ae4c3c1a65 backends/x11: Use PRESENT extension to get notified about frame completion
Currently, we use a timer to get notified when a frame is presented, but
there's a better way using PRESENT extension's PresentCompleteNotify events.

Note that we implicitly rely on the fact that EGL implementation uses
the PRESENT extension to present pixmaps, which is usually the case.
QPainter backend needs some adjustments.
2022-12-15 08:09:22 +00:00
l10n daemon script
e88a9e511a GIT_SILENT Sync po/docbooks with svn 2022-12-15 02:22:28 +00:00
Harald Sitter
80ef6295b7 wayland: offer opt out from permission checks
we need this because our paths in CI contexts are mutable and as such
the regular permission logic must not be applied
2022-12-14 21:56:46 +00:00
Thenujan Sandramohan
b34a5a4b4b kcmkwin/kwindesktop: Make new virtual desktops have numbered names
BUG: 410366
FIXED-IN: 5.27
2022-12-14 21:24:21 +00:00
Vlad Zahorodnii
5555ed2836 scene: Fix a typo in WindowItem::updateShadowItem()
Hopefully it's going to fix warnings about bad reference item in
Item::stackBefore().
2022-12-14 18:15:52 +00:00
Xaver Hugl
2a6e3b7ad8 core/outputconfiguration: use std::weak_ptr for storing the mode
Otherwise an unplugged output can cause use-after-free problems on OutputChangeSet
destruction
2022-12-14 15:33:02 +01:00
Xaver Hugl
3c2f0e626b workspace: match KScreen when computing the hash without an edid 2022-12-14 11:04:58 +00:00
Xaver Hugl
892393ffa1 workspace: handle duplicate output hashes correctly
Some outputs have the same EDID, which results in two connected outputs
having the same hash. To find out which config values need to be used,
also check the connector name.
2022-12-14 11:04:58 +00:00
Vlad Zahorodnii
77570c0667 backends/{x11,wayland}: Avoid painting null cursor image
GLTexture(QImage()) may construct an invalid texture, which is going to
make GLTexture::bind() and other requests fail.
2022-12-14 09:03:05 +00:00
l10n daemon script
89613d8673 GIT_SILENT Sync po/docbooks with svn 2022-12-14 03:01:11 +00:00
l10n daemon script
e47bb69afe GIT_SILENT Sync po/docbooks with svn 2022-12-13 02:36:23 +00:00
David Edmundson
c4b134da8d Implement wp-fractional-scale-v1
This allows clients to provide buffers at native resolutions when
fractional scaling is used.

Virtual backend is adjusted to support scales as floats
2022-12-12 12:16:18 +00:00
l10n daemon script
361828dfbe GIT_SILENT Sync po/docbooks with svn 2022-12-12 02:31:23 +00:00
l10n daemon script
14b48796ee SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2022-12-12 01:56:33 +00:00
Xaver Hugl
ffad2dd7ad backends/drm: don't break crtc<->plane connections
The kernel rejects such commits without the crtc being completely turned
off first.

BUG: 462214
2022-12-11 15:01:28 +00:00
l10n daemon script
5fae6517ae GIT_SILENT Sync po/docbooks with svn 2022-12-11 02:20:45 +00:00
l10n daemon script
f2bca662da SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2022-12-11 01:54:54 +00:00
Ismael Asensio
e8545fdb37 kcms/rules: Notify when a window does not provide a class
Some applications do not provide a window class according to
the spec (WM_CLASS on X11, appId on Wayland), so KWin cannot
"detect" this property.

In those cases, notify the user that this is a bug within the
application (so it is not confused for a KWin misbehavior)
and also prevent setting a wrong description.

BUG: 462644
FIXED-IN: 5.27
2022-12-10 23:24:50 +01:00
Ismael Asensio
bee2c65918 kcms/rules: Use Kirigami.Dialog for error messages 2022-12-10 23:24:50 +01:00
Ismael Asensio
1d5b3a3c89 kcms/rules: Set a title for error messages 2022-12-10 23:24:50 +01:00
Xaver Hugl
d8dc46856e effects/blendchanges: ignore fullscreen windows
Fullscreen windows are most likely games or videos, where the blend effect is an
annoyance that freezes the screen for a moment when a accent color change is triggered
in the background.
2022-12-10 16:28:43 +01:00
Vlad Zahorodnii
555c208b87 backends/x11: Drop X11WindowedBackend::window() 2022-12-10 12:22:58 +00:00
Vlad Zahorodnii
a10193ab4d backends/x11: Drop X11WindowedBackend::windowForScreen() 2022-12-10 12:22:58 +00:00
Vlad Zahorodnii
bb83d66508 backends/x11: Move some method implementations to cpp files 2022-12-10 12:22:58 +00:00
Vlad Zahorodnii
39607a7457 backends/x11: Drop unused X11WindowedBackend::sizeChanged signal 2022-12-10 12:22:58 +00:00
l10n daemon script
02eeb54dd6 GIT_SILENT Sync po/docbooks with svn 2022-12-10 02:05:05 +00:00
l10n daemon script
fedadf706a SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2022-12-10 01:48:43 +00:00
Xaver Hugl
20b94c9025 wayland/outputmanagement: reject configurations if outputs change
The meaning of the request is questionable after an output gets added
or removed, and it's an easy way to prevent dangling pointers.

BUG: 460953
2022-12-10 00:39:19 +01:00
Vlad Zahorodnii
e37fd13bb3 backends/wayland: Remove more unused stuff 2022-12-09 20:01:38 +02:00
Vlad Zahorodnii
182026a4bd backends/wayland: Use linux-dmabuf directly
The main motivation behind this change is to get rid of the dependency
on EGLSurface so the order in which output layers are presented or
updated doesn't matter.

At the moment, if both the cursor and the primary layers are updated
within same frame, the read and draw surfaces in present() will be wrong
for the primary layer.

With fbos, the read and draw surfaces won't matter.
2022-12-09 15:23:27 +02:00
David Redondo
cb9ffbcd01 Remove selectionCleared and sendClearSelection from datadevice and friends
Having both selectionChanged and selectionCleared as well as
sendSelection and sendClearSelection complicates things. API users
have to connect to both signals, internally the methods have logic
to call themselves but in the end do the same as the protocols only
know send_selection.
2022-12-09 10:34:08 +01:00
l10n daemon script
dbcbba5fac GIT_SILENT Sync po/docbooks with svn 2022-12-09 02:05:09 +00:00
Natalie Clarius
0053c782a1 quick tiling: find target output by direction 2022-12-08 18:59:44 +00:00
Natalie Clarius
67c558286f useractions: add shortcuts for {switch to/window to} screen {direction}
BUG: 453038
2022-12-08 18:59:44 +00:00
Natalie Clarius
084b88522c workspace: get output in direction relative from reference
BUG: 451286
BUG: 453038
2022-12-08 18:59:44 +00:00