Commit graph

6013 commits

Author SHA1 Message Date
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
Aki Sakurai
aa57e9130b Fix misgenerated QHoverEvent
https://doc.qt.io/qt-6/qhoverevent.html#oldPos

https://doc.qt.io/qt-6/qhoverevent-obsolete.html#pos

oldPos: On QEvent::HoverEnter events, this position will always be QPoint(-1, -1).

pos: On QEvent::HoverLeave events, this position will always be QPoint(-1, -1).

On the same app, such as Wayland-enabled VS Code, the misgeneration causes the cursor to move to the origin when moving the cursor away from the server side decoration.
2023-10-19 07:17:28 +00:00
Joshua Goins
e398289287 Add QKeySequence to VirtualDesktopManager::addAction overload
There are four usages of this overload, two of them are for the
intentionally disabled "Switch to Next/Previous Desktop" actions and the
rest are for "Switch One Desktop to X" actions. Due to the order they
were added, an empty keybind was set as the default and the actual
keybind is never enabled.

Now there's a QKeySequence argument to this overload, so an unexpected
empty keybind is never added. The two usages of addAction that depend on
this empty keybind behavior now pass in an empty QKeySequence.

BUG: 475748
2023-10-19 06:45:56 +00:00
Vlad Zahorodnii
be88c8ec49 libkwineffects: Drop OffscreenQuickView::repaintNeeded connection in SceneEffect
It's no longer needed since views are not updated in the post paint
stage anymore.
2023-10-19 06:22:48 +00:00
Vlad Zahorodnii
066492ef1d libkwineffects: Make dirty view tracking more robust in SceneEffect
It's possible that a view can request a repaint again in update(). If
that happens, we don't want to overwrite the dirty state after update().
2023-10-19 06:22:48 +00:00
Vlad Zahorodnii
3817fc096f libkwineffects: Add QuickSceneView.rootItem property
The root item property can be useful if a QML effect needs to invoke
some function for particular screen delegate.
2023-10-18 16:03:20 +00:00
Vlad Zahorodnii
d7345a77ce libkwineffects: Expose QuickSceneEffect::{viewForScreen,viewAt} to QML 2023-10-18 16:03:20 +00:00
Vlad Zahorodnii
264ebe6377 scripting: Add qml effect bindings
This allows creating third party qtquick scene effects without linking
to libkwineffects and thus rebuilding the effect every kwin release.
2023-10-18 16:03:20 +00:00
Vlad Zahorodnii
793a0e72bf scripting: Add gesture handlers 2023-10-18 16:03:20 +00:00
ivan tkachenko
264b054c5c
kcms/screenedges: Fix buttons overlap on a too narrow vertical screen
BUG: 475579
2023-10-18 18:11:19 +03:00
ivan tkachenko
6c67b73b7d
kcms/screenedges: Slightly refactor monitor size calculation
It doesn't need width when it's going to be scaled with KeepAspectRatio
to some other rectangle anyway, so using constant 1.0 makes it clearer.
2023-10-18 18:11:19 +03:00
ivan tkachenko
c5d692843f
kcms/screenedges: Remove commented out dead code 2023-10-18 18:11:19 +03:00
Dashon Wells
b0d8979178 plugins/overview: Make Window Filtering Optional
This commit makes window filtering optional by providing a checkbox
in Desktop Effects > Overview > Overview Configuration KCM. The
referenced bug report describes a bunch of the reasons why people
wanted this option.

BUG: 460710
FIXED-IN: 6.0
2023-10-18 14:27:56 +00:00
Marco Martin
e67847d43f Use itemChange instead of a connect to windowChanged
with itemChange watching SceneChange is more efficient than connecting
to the windowChanged signal, also this won't arrive during teardown,
aoiding the "destructor already ran" assert.
2023-10-18 14:39:58 +02:00
David Redondo
c0cc162ba6 plugins/windowsystem: Adapt to KWindowEffectsPrivate API change 2023-10-18 11:28:36 +00:00
Aleix Pol Gonzalez
c899cd07f8 xwayland: Do not set scale to 0
It would be the case upon lid close which would make KWin crash. Also
adds an assert so in case it happened again we would be able to catch it
easily. It gets applied asynchronously so it needs to be chased down.
2023-10-18 06:11:27 +00:00
Laurent Montel
2a14a4e398 Use std::as_const here 2023-10-18 06:54:47 +02:00
Xaver Hugl
d91534303e libkwineffects/glshader: set the correct maximum brightness
The maximum frame average brightness can be significantly lower than the actual
maximum brightness of the screen
2023-10-17 09:32:47 +00:00
Xaver Hugl
2fa80c6a3e libkwineffects/colorspace: rename maxHdrBrightness
The name doesn't really reflect what it's actually about, which is the maximum
average brightness the display can sustain without dimming
2023-10-17 09:32:47 +00:00
Quinten Kock
94b74cff96 plugins/slide: add special case for instant animations
In springmotion.cpp for the slide plugin, there are issues when
animations are disabled, namely a black screen flicker.

The flicker is caused by float under/overflow (div-by-0 -> infinity).

This commit fixes that by special-casing an infinite spring constant,
so that the animation immediately jumps to the anchor.

BUG: 472901
2023-10-16 17:07:11 +00:00
Alexander Lohnau
30600a064b Make X-KDE-Ordering in plugin metadata a proper int value
This makes the intention more clear and avoids unneeded string -> int conversion at runtime
2023-10-16 16:12:43 +00:00
Alexander Lohnau
76d93f7053 Remove empty X-KDE-ParentApp from plugin metadata 2023-10-16 16:12:43 +00:00
Alexander Lohnau
a75bc19ce5 Remove empty website from plugin metadata 2023-10-16 16:12:43 +00:00
Alexander Lohnau
48b11337a9 Remove Version from plugin metadata
The plugins are shipped as part of KWin. Thus having a version separate from the KWin version specified doesn't make sense
2023-10-16 16:12:43 +00:00
Alexander Lohnau
27863b09ae Remove X-Plasma-MainScript from KPackage plugins 2023-10-16 16:12:43 +00:00
Alexander Lohnau
43174a9771 Remove X-Plasma-MainScript from C++ codepaths 2023-10-16 16:12:43 +00:00
Alexander Lohnau
bf713d3892 plugins/kpackage: Remove definition of X-Plasma-MainScript definitions 2023-10-16 16:12:43 +00:00
Nicolas Fella
39fe6cd286 Remove window type from internal window and window system plugin
This is only set from KWindowSystem::setType(), which is unused on Wayland
2023-10-16 14:41:53 +00:00
Vlad Zahorodnii
87d29c60ea plugins/stickykeys: Remove Id field from metadata
The Id field is obsolete in KF6. The filename of the so is used as the
plugin id.
2023-10-16 12:48:54 +00:00
Mike Noe
4de5235402 plugins/private/Windowheap: Fix param injection error
Also, remove import versions
2023-10-16 07:58:19 -04:00
l10n daemon script
6c9f55190e 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-16 02:07:23 +00:00
Nicolas Fella
8ee1720047 Adapt to KWindowSystem dropping raiseWindow() 2023-10-14 19:43:58 +02:00
Nicolas Fella
62d91ea95d Adapt to KWindowSystem dropping lowerWindow() 2023-10-14 17:21:04 +00:00
Xaver Hugl
25728c1240 backends/drm: give the commit threads names
That makes them easier to identify in backtraces
2023-10-14 12:05:41 +00:00
Xaver Hugl
f8012f580b plugins/colorpicker: convert picked color to sRGB
The API doesn't have any colorspace data, so we need to make sure we're
sending sRGB

BUG: 387757
2023-10-14 11:55:18 +00:00
Nate Graham
acf7da91cc kcms/desktop: port away from Kirigami.DelegateRecycler
It was removed for KF6. Instead, set reuseItems: true, which is the
upstream-friendly way to do the same thing.

BUG: 475544
2023-10-13 14:02:01 -06:00
Nate Graham
8cf3ad8d3b kcms/screenedges: Move into "Mouse & Touchpad" group
Part of https://invent.kde.org/plasma/systemsettings/-/issues/15.
2023-10-13 12:12:08 -06:00
Mike Noe
455747354a overview/qml: Fix parameter injection errors 2023-10-11 16:26:18 -04:00
Xaver Hugl
1f82d81558 improve support for mirroring output transforms
CCBUG: 447792
2023-10-11 12:37:48 +00:00
Xaver Hugl
aaffd459ce backends/drm: add more nullptr checks for m_surface
BUG: 475380
2023-10-11 10:42:45 +00:00
l10n daemon script
8840193cd7 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-11 02:34:51 +00:00
Mike Noe
cc584c87ff overview/qml: Fix typo with Kirigami.Units; remove import versions 2023-10-10 10:59:48 -04:00
l10n daemon script
6d2adb3039 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-10 02:14:35 +00:00
Vlad Zahorodnii
88583b8eed Revert "waylandserver: fix race condition"
This reverts commit 03d0a226fb.

ClientConnection object is no longer destroyed with delay after merging
5246d3924f.
2023-10-09 11:08:43 +00:00
Vlad Zahorodnii
787d3a3ba4 wayland: Fix SurfaceState forward declaration
It's a struct and clang is not happy about using class.
2023-10-09 11:11:23 +03:00
Vlad Zahorodnii
6974f54149 Move EffectWindowImpl ownership to WindowItem
EffectWindowImpl affects rather the WindowItem, so move its ownership to
it. This encapsulates compositing setup so it's effectively same as
creating a window item, except some annoyances on X11.
2023-10-09 07:50:05 +00:00
Nicolas Fella
f7045cbf96 Remove unused constants 2023-10-09 07:37:41 +00:00
Vlad Zahorodnii
5246d3924f wayland: Destroy ClientConnection immediately
With QObject::deleteLater(), the client object can unexpectedly outlive
the expected lifetime as in 03d0a226fb.
2023-10-09 06:32:14 +00:00
l10n daemon script
387388be5d 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-09 02:13:40 +00:00
Fushan Wen
b80741d531
plugins: add colorblindness correction effect
Colorblindness correction shader with adjustable intensity. Can correct for:

- Protanopia (Greatly reduced reds)
- Deuteranopia (Greatly reduced greens)
- Tritanopia (Greatly reduced blues)

FEATURE: 474470
FIXED-IN: 6.0
2023-10-06 21:01:51 +08:00
Vlad Zahorodnii
8d3b4a21c8 wayland: Properly update subsurfaces in cached transaction
Cached transaction will be merged with parent transaction when the
parent surface is committed, it's not included in the transaction graph.
2023-10-06 12:47:42 +00:00
Vlad Zahorodnii
7d56aa3687 Merge wayland tests with other tests
This makes wayland tests organization consistent with other kwin tests.
2023-10-06 11:21:00 +00:00
Nicolas Fella
d57c66872c Port to new KService::property API 2023-10-06 07:56:53 +00:00
Vlad Zahorodnii
9e10394db1 Move window specific signals from EffectsHandler to EffectWindow
This makes the api of EffectWindow more similar to the api of Window. It
also makes more sense to keep such signals in EffectWindow. In the future,
the effect window can be dropped in favor of the window.
2023-10-06 07:05:37 +00:00
Xaver Hugl
03d0a226fb waylandserver: fix race condition
When the xwayland connection gets destroyed, it doesn't get deleted immediately. If the
xwayland scale changes in between WaylandServer::destroyXWaylandConnection and the actual
destruction of the connection, KWin would crash
2023-10-05 21:32:55 +02:00
Xaver Hugl
2eb72d0820 main: directly set Xwayland scale, instead of starting a KCM to do the same 2023-10-05 20:29:04 +02:00
Xaver Hugl
3654b76ec2 split output rotation setting from rotation applied because of auto rotation 2023-10-05 20:29:04 +02:00
Xaver Hugl
ae84480fbf outputconfigurationstore: add new config system
Instead of an external service (like KScreen) storing and restoring output configurations,
with this commit KWin takes over that responsibility. This allows it to, among other things,
generate appropriate configs for new sets of outputs immediately, and take KWin-internal information
about outputs into account when generating them.

CCBUG: 474021
CCBUG: 469653
CCBUG: 466342
CCBUG: 470863
CCBUG: 466556
BUG: 466208
BUG: 455082
BUG: 457430
2023-10-05 20:29:04 +02:00
Nicolas Fella
47edb14425 Adapt to KService::property API change 2023-10-05 13:44:48 +00:00
l10n daemon script
0f587bbcdd 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-03 02:06:58 +00:00
Nate Graham
e74baf8b6f Implement Plasma 6 settings re-org
Part of https://invent.kde.org/plasma/systemsettings/-/issues/15; see
that Issue for details.
2023-10-02 15:10:05 +00:00
Alexander Lohnau
8f626f2c9e plugins/kdecorations: Add explicit QFileInfo/QCoreApplication includes
GIT_SILENT
2023-10-01 17:52:28 +02:00
Alexander Lohnau
a12e0b8e7f kcms: Add explicit includes for transient KAbstractConfigModule headers
Needed after https://invent.kde.org/frameworks/kcmutils/-/merge_requests/174
2023-10-01 17:30:17 +02:00
l10n daemon script
7579d0f569 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-01 02:22:52 +00:00
Vlad Zahorodnii
0b21c53d44 Move resource_cast helper to shared utils/ directory 2023-09-30 08:09:34 +00:00
Vlad Zahorodnii
e0074d6078 Move wayland utils to shared utils directory 2023-09-30 08:09:34 +00:00
Mihail Milev
48849d4c48 keyboard_layout: Add shortcut to toggle last-used keyboard layout
This is a companion to
c01b583e53
that enables the above functionality on Wayland. For Xorg, the
functionality is implemented in plasma-desktop in the above commit.
2023-09-29 19:37:36 +00:00
Fushan Wen
a16506c665
WindowHeapDelegate: restore anchors.horizontalCenter
It's still needed, otherwise the text is not center aligned with the
thumbnail.
2023-09-29 20:17:47 +08:00
Vlad Zahorodnii
c342d57116 Handle null input devices in WheelEvent
The X11 backend calls some pointer input redirection code without
providing a valid input device.
2023-09-29 12:05:16 +00:00
Fushan Wen
9ef65cbe03
WindowHeapDelegate: fix a binding loop warning
It doesn't make sense to use Math.min when the label is always placed at
the bottom center of the thumbnail item.
2023-09-29 19:41:27 +08:00
Fushan Wen
51c517f2b8
plugins/desktopchangeosd: hide osd when Overview effect is active 2023-09-29 18:37:48 +08:00
Fushan Wen
5fc009d64a
scripting: add isEffectActive to query effect active state 2023-09-29 18:37:48 +08:00
Fushan Wen
c974bf0b04
plugins/desktopchangeosd: make Loader become the root item
This saves another quick item.
2023-09-29 18:37:48 +08:00
David Edmundson
4b1a90b32a Implement axis relative direction
This is useful for the few cases where wheel events are not for
scrolling. For example adjusting the volume in the tray.

In this case having the metadata that the delta is backwards is
important. From a kwin POV it's just proxying the libinput
isNaturalScroll setting to clients.

Tested against "qtbase/examples/widgets/widgets/mousebuttons" with
modified Qt and changing the setting in the UI.

Not mergable until upstream lands.
Relevant link:
https://gitlab.freedesktop.org/whot/wayland/-/merge_requests/1 /
https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/183

CCBUG: 442789
2023-09-29 13:18:30 +03:00
Xaver Hugl
ae09600481 platformsupport/scenes/opengl: add a factory function for EglSwapchainSlot
This makes it more obvious that creating slots can fail, and makes it simpler to add
checks for that
2023-09-28 23:27:37 +00:00
Aki Sakurai
0f1da589eb fix segfault in EglGbmBackend::textureForOutput 2023-09-28 23:52:52 +08:00
Xaver Hugl
d33c6b5409 backends/drm: don't crash if the surface is nullptr
CCBUG: 474987
2023-09-28 15:47:45 +02:00
Xaver Hugl
1e6f46eb0c scene/imageitem: don't crash if uploading a texture fails
BUG: 474952
2023-09-28 12:59:53 +02:00
Nicolas Fella
684595dab7 tabbox: Simplify loading switcher from KPackage
Let KPackage to the hard work
2023-09-28 08:15:54 +00:00
Xaver Hugl
d6bc5d9b14 platformsupport/scenes/opengl: don't crash when importing a texture fails
CCBUG: 474933
2023-09-27 17:31:12 +00:00
Xaver Hugl
88ab958f4d backends/drm: fix surface destruction
With value semantics, the destructor can be called more often than actually
desired, so this commit ports the DrmEglLayerSurface to use unique pointers to
store surface data instead
2023-09-27 17:17:54 +00:00
Xaver Hugl
b266b08145 outputconfigurationstore: don't select generated modes as the default
They're not guaranteed to work, so choosing them as the default mode can
result in a display that doesn't light up or only shows garbage

BUG: 474915
2023-09-27 17:38:25 +02:00
Xaver Hugl
a4dedb64f6 backends/drm: handle multiple OpenGl contexts more correctly
In order to destroy resources from a context on the secondary GPU, that
context needs to be current. We also want to destroy the context once it's
no longer used, if the GPU is unplugged etc, so this commit uses shared
and weak pointers to manage the lifetime of the contexts
2023-09-27 14:42:13 +00:00
ivan tkachenko
ed0974b8cb
kcms/screenedges: Drop unused functions 2023-09-27 16:30:05 +03:00
Xaver Hugl
482a1f0fb5 backends/drm: don't wake displays up when outputs get temporarily removed
When some displays go to sleep, that can be wrongly detected as a temporary
hotunplug by the driver. In order to not wrongly wake up the system with
such a display, detect that scenario and set the 'new' output to dpms off
again.

BUG: 452553
BUG: 379474
2023-09-27 00:02:42 +02:00
Xaver Hugl
99244efa3b backends: move dpms input filter handling to Workspace 2023-09-26 16:39:28 +00:00
Xaver Hugl
66cef35c64 compositor_wayland: ignore placeholder outputs
Placeholder outputs don't have renderloops or output layers. If they're
not ignored, KWin crashes
2023-09-26 17:49:29 +02:00
Xaver Hugl
4b49ca7751 backends/drm: fix frame scheduling with pageflip timestamps in the future 2023-09-25 13:37:10 +02:00
Niccolò Venerandi
028dd552cf Merge desktop grid and overview together with a new three-state design
Merges the desktop grid and overview effects together in a new three-state one;
you can switch between them with a certain shortcut or gesture, and you can also
still access either the desktop grid or overview directly.

Default shortcuts are also updated to be Meta+G for Grid, Meta+W for Overview,
Meta+Tab to switch between the three states and Meta+Shift+Tab to cycle in the
opposite direction.

BUG: 474044
BUG: 460661
BUG: 460774
BUG: 456572
BUG: 449601
BUG: 450262
BUG: 449801
BUG: 461510
BUG: 463886
BUG: 459754
BUG: 459749
BUG: 459748
BUG: 459467
FIXED-IN: 6.0
2023-09-25 11:14:37 +00:00
Vlad Zahorodnii
1d6ac05a8c autotests: Make testServerSideDecoration test more robust
The test fails sometimes with "Tried to add event to destroyed queue".
It does so because the event queue is not destroyed last. See also
33827bbdbe for more details.
2023-09-25 10:46:32 +03:00
Vlad Zahorodnii
ff9a6cd3fa Port away from KWayland's server-decoration-palette implementation 2023-09-25 06:42:02 +00:00
Vlad Zahorodnii
dc6dba231d Port away from KWayland's server-decoration implementation 2023-09-25 06:42:02 +00:00
Vlad Zahorodnii
7c43f56665 Drop scene initialization functions
They are not needed anymore since the scenes are created when workspace
exists.
2023-09-22 14:06:24 +00:00
Vlad Zahorodnii
fc148cb668 Split X11 and Wayland specific compositor initialization code paths
With the current vision for how output backends work, the compositor
should take up more responsibilities. There are a few good reasons: some
things just don't make sense to be in backends, to allow sharing code
across backends easier, etc. On the other hand, we have X11, with its
own ways of doing things which are not always compatible with what we
want to do on Wayland.

The goal of this patch is to start splitting the compositor into
platform specific counterparts, with potentially moving X11 compositing
in kwin_x11. The main benefit of this is that we will be able to
push forward with wayland things more freely. Ideally it would be great
if we could make kwin_x11 have its own low level compositing code paths
that are nicely encapsulated in that executable and don't leak into
libkwin abstractions.

The biggest drawback of this approach is that there is going to be some
code duplication between x11 and wayland compositing code paths. But I
expect it to be the case only for a short term until we start landing
more abstractions in kwin_wayland, e.g. render devices, proper output
layer support, etc.
2023-09-22 14:06:24 +00:00
Vlad Zahorodnii
6029a68433 backends/fakeinput: Implement fake-input v5 2023-09-22 12:48:18 +00:00
Vlad Zahorodnii
c29238f51a Don't save old screen sizes in Workspace::initializeX11()
It's done when initializing Workspace::outputs().
2023-09-22 11:17:39 +00:00
Vlad Zahorodnii
d6e94163f5 backends/fakeinput: Implement fake input protocol in backend
The interface is redundant now since there's an abstract input backend
abstraction.
2023-09-22 11:08:26 +03:00
Vlad Zahorodnii
0d2a66f054 Don't call setShowingDesktop() in Workspace::initializeX11()
No idea why it's called there, but we don't want to break showing
desktop mode if Xwayland starts for some reason.
2023-09-22 05:29:41 +00:00
Vlad Zahorodnii
6d8cdef33e x11: Drop support for private colormaps
According to 4b686a204250b4416fce79fa55b8a89c5193de38 in kde-workspace,
the support for private colormaps was mainly useful to 8bit displays,
which are relic of time now.
2023-09-21 11:58:41 +00:00
Vlad Zahorodnii
8d70b1cbe1 Drop X11Compositor::isOverlayWindowVisible()
It's used once and OverlayWindow::isVisible() can be used instead.
2023-09-20 17:18:30 +03:00
Vlad Zahorodnii
9a5e51eb32 Move "Suspend Compositing" shortcut to X11 compositor
Toggling compositing is specific only to X11 so move the corresponding
shortcut to the X11 compositor implementation.
2023-09-20 16:13:08 +03:00
Vlad Zahorodnii
15ed4f393e wayland: Simplify startup of compositor
At the moment, the wayland compositor has to handle the case of having
no workspace. This should be unnecessary and it creates a pesky cycling
dependency between Workspace and Compositor.

Given that the Workspace acts more like a container and kwin starts
accepting client connections after starting compositing, it's possible
to create the Workspace earlier and simplify the start() function a bit.
2023-09-20 12:50:15 +00:00
Vlad Zahorodnii
de905d09f4 Remove unused atoms.h include 2023-09-20 12:15:08 +00:00
Vlad Zahorodnii
2a0d5f5e1d Drop compositing suspension dbus api
The main motivation behind this change is to encapsulate X11 compositor
implementation to the point that it can be moved from libkwin to
kwin_x11.

There are two options: either get rid of suspend and resume requests, or
add suspend and resume virtual functions in the Compositor. The apps
must definitely not rely on the dbus api, they must use the X11 api.
Compositing suspension api works only on X11 and it's quite obscure,
it's not used by any other KDE component.

So this patch goes for the most simplest option: dropping the requests.
2023-09-20 12:15:08 +00:00
Vlad Zahorodnii
b7f55534bc Simplify Window::setReadyForPainting()
The windowShown() signal can be emitted regardless of compositing
status. Not sure why this if statement exists, perhaps a premature
optimization.
2023-09-20 11:56:02 +00:00
Vlad Zahorodnii
a702bba88c Remove X11 leftover in wayland compositor
Amends 72aad0881d

This connect() was overlooked in 72aad.
2023-09-20 10:34:20 +03:00
Vlad Zahorodnii
0880fec9c7 Make Window::updateShadow() agnostic about compositing status
The Shadow no longer owns the texture, so it can be loaded while
compositing is off.

This changes removes the compositing status check to simplify code.
2023-09-20 05:23:05 +00:00
Vlad Zahorodnii
f633bd1ff4 Create X11Compositor in main_x11.cpp
This makes X11Compositor initialization similar to the initialization of
the wayland compositor.
2023-09-19 15:28:09 +00:00
Vlad Zahorodnii
dba29ece4b Add X11 composite window property in Application
This allows checking if the given override redirect is the composite
overlay window without resorting to platform specific implementation of
Compositor.
2023-09-19 15:28:09 +00:00
Vlad Zahorodnii
c9547071ea Rework blocking compositing on X11
Currently, the Workspace is responsible for rerouting
X11Window::blockingCompositingChanged to
X11Compositor::updateClientCompositingBlocking(). It has a few issues:
if the client is initially blocking compositing, it's not going to work
as expected. The second issue is that it creates a coupling between
platform specific compositor implementation and generic Workspace. It's
a blocker for moving X11Compositor to kwin_x11 executable, etc.
2023-09-19 15:28:09 +00:00
Vlad Zahorodnii
24a88b035c Don't reconfigure effects in Compositor::reinitialize()
If start() fails, the effects pointer will be null.
2023-09-19 15:16:01 +00:00
Vlad Zahorodnii
b555157e8d Don't reparse kwinrc in Compositor::reinitialize()
The compositing options are no longer loaded in Compositor::start(), but
when kwin starts or the Workspace is reconfigured.
2023-09-19 15:16:01 +00:00
Xaver Hugl
f43e45c984 backends/drm: work around llvmpipe implicit sync not working
implicit sync doesn't work properly with glFlush + KMS and llvmpipe doesn't support
EGL_ANDROID_native_fence_sync either, so we need to wait for rendering to complete
in a blocking fashion.
2023-09-19 15:07:45 +00:00
Vlad Zahorodnii
72aad0881d xwayland: Initialize X11 compositing in Xwayland
If somebody else claims the compositing selection, we definitely do not
want to stop compositing. It will also help with encapsulating
X11-specific code and splitting it out in the future.
2023-09-19 14:36:09 +00:00
Xaver Hugl
f223362ddf scene/cursordelegate_opengl: fix projection matrix with rotated screens 2023-09-19 13:41:00 +02:00
Xaver Hugl
90b2aa25e0 compositor: fix the hardware cursor with rotated screens 2023-09-19 11:01:48 +00:00
Xaver Hugl
9e65b12178 renderlayer: also schedule a repaint when hiding the layer 2023-09-19 11:01:48 +00:00
l10n daemon script
6a1e86961a 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-09-19 02:14:27 +00:00
Vlad Zahorodnii
4d2c9f5d88 Refactor compositing config loading
Config loading is split in two groups: loading compositing config and
loading the rest. They are loaded separately at different times. Some
options are loaded in the Options constructor, some are loaded when compositing
starts, some are loaded when the Workspace is created. It's not easy to
keep track of what loads what and when.

This change simplifies option handling by loading all options in bulk
and decouples Options from OutputBackend and GLPlatform to ensure that
it can safely load options before kwin is fully operational.
2023-09-18 13:40:33 +00:00
Vlad Zahorodnii
ca0a2229cc Drop unused QHostInfo includes 2023-09-18 06:49:36 +00:00
l10n daemon script
046acfd939 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-09-18 02:17:51 +00:00
Nicolas Fella
6c7ac8391a Use keyword signature for target_link_libraries call 2023-09-16 22:20:45 +02:00
Fushan Wen
4716f91b9a
plugins/startupfeedback: use inplace QImage::convertTo
to reuse internal buffers
2023-09-16 22:04:29 +08:00
Vlad Zahorodnii
de36fe82e8 wayland: Integrate KWaylandServer classes into KWin namespace 2023-09-15 16:31:15 +03:00
Vlad Zahorodnii
6ac4012827 wayland: FakeInputDevice -> FakeInputDeviceInterface
This is to avoid conflicting with KWin::FakeInputDevice
2023-09-15 16:31:15 +03:00
Vlad Zahorodnii
43eceba9ce wayland: Rename Cursor to PointerSurfaceCursor 2023-09-15 16:31:15 +03:00
Vlad Zahorodnii
541fd45a25 wayland: Add missing moc include 2023-09-15 13:13:43 +00:00
Vlad Zahorodnii
8bf2318800 wayland: Drop "_interface" from filenames
The cpp files in the wayland directory are named after protocol names.
"_interface" does not contribute anything new.
2023-09-15 13:13:43 +00:00
David Redondo
eb9130ac64 Use QProcessEnvironment::InheritFromParent on X11
Before 885e9acb6e
Application::processStartupEnvironment() returned
QProcessEnvironment::systemEnvironment() which means the current
environment of KWin when this function was called. By setting
InheritFromParent we can replicate this behavior.
This fixes KWin starting processes on X11.
2023-09-14 12:30:45 +00:00
David Redondo
216a268a43 Use qt prefix variant of toplevel drag protocol
As this is what Qt now implements
2023-09-13 15:30:17 +00:00
David Redondo
b336691b3e Implement xdg-toplevel-drag 2023-09-13 15:30:17 +00:00
David Redondo
01a1aaf99e Also send drop when it was not accepted
This enables applications to distinguish
- successful drop
- drop onto client that didn't accept
- cancelled drag
2023-09-13 15:30:17 +00:00
Marco Martin
3a95c20279 Fix touch on PointerHandlers
The events we forward to the offscreen QML view are with our own
QPointingDevice instance, which has a devicetype of touch but a null pointerType.

In Qt5 this was enough, but pointerhandlers in qt6 refuse events with an undefined
pointertype, so we have to explicitly set it to finger

BUG:473541
2023-09-13 13:25:57 +00:00
Xaver Hugl
36513123f3 backends/drm: always check for a test buffer before presentation
Otherwise atomic tests might fail unnecessarily
2023-09-13 13:57:30 +02:00
Xaver Hugl
87cee87aff backends/drm: fail presentation if there's no buffer for it yet
BUG: 474483
2023-09-13 13:37:53 +02:00
l10n daemon script
051705e5fa 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-09-13 02:21:48 +00:00
Ismael Asensio
989c00e887 screenedge: Fix dragging windows between VDs
Add the missing condition to allow moving windows between
VDs by dragging.

Amends 861105248d
2023-09-12 20:44:32 +02:00
Xaver Hugl
57fae99f33 backends/drm: check activePending instead of active for when applying a new gamma ramp is allowed
The crtc may not be set yet in some cases

BUG: 471562
2023-09-12 14:34:59 +00:00
Vlad Zahorodnii
08836ba471 wayland: Port to OutputTransform::map(QSize) 2023-09-12 14:21:19 +00:00
Vlad Zahorodnii
7887f7c38b wayland: Remove some properties from public XdgPositioner api
Most of these properties have no use after introducing placement().
2023-09-12 16:53:05 +03:00
Vlad Zahorodnii
df8ddb609b wayland: Keep transaction entries for deleted surfaces
If a transaction entry is removed, the graphics buffer reference will
be dropped and it's possible that the TransactionDmaBufLocker is going
to be destroyed as well.

If that happens, the transaction may remain in the locked state.
2023-09-12 13:09:43 +00:00
Vlad Zahorodnii
693fa8a968 wayland: Properly clear transaction list in TransactionDmaBufLocker
Transaction::unlock() can destroy buffer reference and thus also destroy
TransactionDmaBufLocker.
2023-09-12 13:09:43 +00:00
Vlad Zahorodnii
00c12aa766 wayland: Desynchronize transactions of the same client
At the moment transactions from the same client are applied in the
commit order even if the trasactions affect unrelated surfaces.

This patch desynchronizes transactions affecting unrelated surfaces.

With this, if a client updates two surfaces (as an example, Firefox with
two windows) and one of its surfaces takes longer to render, the other
surface is not going to be slowed down.

Another nice thing is that it removes client from Transaction, which
might be potentially useful to the Workspace for coordinated resize or
something.
2023-09-12 13:09:43 +00:00
Vlad Zahorodnii
4b6c83be12 wayland: Move unconstraining logic to XdgPositioner
This makes unconstraining code more reusable (in case of applet popups
use xdg-positioner too), and in general, it makes sense for better
encapsulation.
2023-09-12 12:54:15 +00:00
Xaver Hugl
23238b175a backends/drm: fix the hardware cursor with atomic modesetting + no modifier support
Unless we have explicit information of the opposite, buffers for the cursor need to be linear
2023-09-12 13:41:49 +02:00
Xaver Hugl
14f6103373 backends/drm: don't signal commit failure for the cursor
RenderLoop isn't built to handle that yet
2023-09-11 18:25:01 +02:00
Fushan Wen
dded168d93 thumbnail_grid: use MouseArea as delegate root 2023-09-11 15:59:49 +00:00
Fushan Wen
463c18f9fa thumbnail_grid: allow screen reader to announce window name when pressing Alt+Tab
CCBUG: 472643
2023-09-11 15:59:49 +00:00
Vlad Zahorodnii
dbad45d052 wayland: Introduce transactions
Transactions provide a way to apply new surface state to multiple
surfaces atomically.

A transaction can be locked. In which case, it's not going to be applied
until all locks are dropped. For example, this can be used to delay
applying new surface state until the committed buffers become idle.
2023-09-11 15:47:45 +00:00
Vlad Zahorodnii
79a0bc3f80 utils: Add static FileDescriptor::isReadable() overload 2023-09-11 15:47:45 +00:00
Vlad Zahorodnii
58904a358f wayland: Fix copying subsurface order state
When merging surface state to a fresh state container, subsurface order
state may be lost because subsurfaceOrderChanged can be false.
2023-09-11 15:47:45 +00:00
Vlad Zahorodnii
305847625f Revert "wayland: Property propagate modifier SurfaceState fields"
This reverts commit a101bc3628.
2023-09-11 15:47:45 +00:00
Vlad Zahorodnii
41e5409b23 wayland: Move frame callback destructor to SurfaceState destructor 2023-09-11 15:47:45 +00:00
Xaver Hugl
4c397a9526 backends/drm: split commits for the cursor and primary plane
And reorder and merge atomic commits where possible to ensure the cursor always
stays smooth

BUG: 472663
2023-09-11 13:02:40 +00:00
Vlad Zahorodnii
2e42d7193d wayland: Assign tablet cursor surface role 2023-09-11 15:11:55 +03:00
Vlad Zahorodnii
51e8cfc41b wayland: Refactor SurfaceRole
After introducing SurfaceExtension, SurfaceRole has lost its commit()
function. It serves informative purpose now only.

Shell surface implementations don't have to inherit from SurfaceRole.

By making SurfaceRole act more like a value type, it's possible to fix
role handling in wl_pointer.set_cursor.
2023-09-11 15:11:52 +03:00
Vlad Zahorodnii
36a548ad9f Disable Xinerama specific workarounds for layer shell windows
They should not be needed for layer shell windows and in fact can break
some cases where things are expected to work properly.
2023-09-11 06:19:21 +00:00
Xaver Hugl
32ae9dd7d1 libkwineffects: rename major and minor methods
There's "major" and "minor" defines that can get implicitly included, for
example with musl libc. To prevent that from breaking compilation, rename
the methods
2023-09-09 14:44:53 +00:00
Fushan Wen
f0c8a0c482
plugins/qpa: implement platform accessibility
This allows screen readers to read window titles in a tabbox.

BUG: 472643
FIXED-IN: 5.27.9
2023-09-09 21:31:08 +08:00
Ser Freeman
1236e3e83b effects/maximize: Set oldGeometry only on windowMaximizedStateAboutToChange
Since there is now exist the signal right before maximize, use it to
set oldGeometry instead of storing previous values every time with
windowFrameGeometryChanged.

This fixes the effect under Wayland.
2023-09-08 07:17:27 +00:00
Vlad Zahorodnii
6dd6e176e3 Move X11Compositor and WaylandCompositor in their own files 2023-09-08 09:49:40 +03:00
Vlad Zahorodnii
14ab38b596 composite.h -> compositor.h 2023-09-08 09:48:59 +03:00
Xaver Hugl
9dd236c87b plugins/qpa: use a surfaceless context for offscreen surfaces
According to Qt documentation, offscreen surfaces aren't actually for rendering,
so using a surffaceless context is ok
2023-09-07 21:13:16 +02:00
Xaver Hugl
c0e44378ca libkwineffects: move render time query check to OpenGlContext 2023-09-07 21:13:16 +02:00
Xaver Hugl
e401f3ff11 libkwineffects: drop gallium detection
It's not used anywhere
2023-09-07 21:13:16 +02:00
Xaver Hugl
6d35a27f90 libkwineffects: drop checks for GLSL and NPOT
Instead, creating contexts that miss these features should fail directly,
making KWin fall back to software rendering.
While this commit also drops workarounds for broken drivers that do software
emulation for features we need, such workarounds belong into these drivers and
the user can still manually turn off compositing if needed.
2023-09-07 21:13:16 +02:00
Xaver Hugl
0a58bd04d5 libkwineffects: don't query OpenGL extensions twice 2023-09-07 21:13:16 +02:00
Xaver Hugl
ed02051a4a libkwineffects: move x server version query to xcb utils 2023-09-07 21:13:16 +02:00
Xaver Hugl
05a389c3b3 libkwineffects: move version to string functions to the Version class 2023-09-07 21:13:16 +02:00
Xaver Hugl
a5df88b0de libkwineffects: move linux kernel version query out of GLPlatform
It has nothing to do with OpenGL
2023-09-07 21:13:15 +02:00
Xaver Hugl
e0c7878357 libkwineffects: move version into its own files 2023-09-07 21:11:11 +02:00
Xaver Hugl
5ce02c6811 libkwineffects: drop limited glsl detection
It's not actually used anywhere
2023-09-07 16:41:22 +02:00
Xaver Hugl
451947b282 backends/x11/standalone: extract glx context into a separate class
This commit also drops most of the code around checks for direct rendering. If
direct rendering isn't supported, creating the OpenGL context will now simply fail,
achieving the same effect
2023-09-07 16:41:22 +02:00
Xaver Hugl
f2dd1b3471 libkwineffects: align variable naming to the rest of KWin 2023-09-07 16:41:22 +02:00
Xaver Hugl
27f90476b4 libkwineffects: rename kwingl* files to gl* 2023-09-07 16:41:22 +02:00
Vlad Zahorodnii
a51277f88a wayland: Remove QPointer from public SurfaceInterface api
QPointer is not meant for return values. There are also performance
considerations to avoid returning QPointer.
2023-09-07 14:14:40 +03:00
Vlad Zahorodnii
dcadf24e64 wayland: Introduce surface state locking capabilities
In certain cases it can be useful to delay applying a surface commit. As
an example, the compositor may wait until the committed graphics buffer
is ready for reading to avoid stalling its graphics pipeline.

This change introduces basic surface state locking capabilities and
ports some surface extensions to new helpers to manage associated state.
2023-09-06 13:58:59 +00:00
Vlad Zahorodnii
60251bc1e4 wayland: Properly track subsurface position in parent surface state
It's a prerequisite for allowing to delay applying surface state.
2023-09-06 13:58:59 +00:00
Vlad Zahorodnii
25825f3970 wayland: Move subsurface stack in its own struct 2023-09-06 13:58:59 +00:00
Vlad Zahorodnii
a101bc3628 wayland: Property propagate modifier SurfaceState fields
Currently, committed fields are contiguously accumulated. With this, it
will be possible to see what fields have been committed when the
committed() signal is emitted.
2023-09-06 13:58:59 +00:00
Vlad Zahorodnii
5fbdd0decc wayland: Refactor xdg-shell handling
It would be nice if xdg-surface and xdg-surface role state are in a
single object so it's easier to stash them. This change refactors
xdg-shell handling to allow that.

xdg-surface state now belongs to xdg-toplevel or xdg-popup state.
2023-09-06 13:58:59 +00:00
Vlad Zahorodnii
1e255265c3 wayland: Post protocol error if popup parent has no surface role 2023-09-06 09:24:21 +00:00
Kai Uwe Broulik
dc2965efad scene: Set preferred output scale for DND icon
Otherwise the icon will have a scale of 1, leading to blurry
drag pixmaps on Wayland.
2023-09-05 18:41:29 +00:00
Nate Graham
8727fcb752 Remove versioning from PlasmaCore module imports
It's unneeded in Qt6 and can cause subtle issues.
2023-09-05 09:33:14 -06:00
Xaver Hugl
76c3e57bef backends/drm: allow cursor updates to be done independently of the scene
This way the scene doesn't get rendered when you move the cursor
2023-09-05 14:36:55 +00:00
Xaver Hugl
e9d3d228bb libkwineffects/kwinglutils: always enable error message printing
It makes no sense to lock that behind an env var. If there's errors those
should always be printed so that we know about them without further investigation
2023-09-05 13:23:36 +00:00
Xaver Hugl
69187e86ab libkwineffects/glvertexbuffer: remove color handling
It's a remnant of OpenGL 1 times. If some piece of code wants a specific
color, it should set the uniform of the used shader itself
2023-09-05 13:23:36 +00:00
Xaver Hugl
43cbd2834c libkwineffects/glvertexbuffer: don't crash if mapping fails 2023-09-05 13:23:36 +00:00
Xaver Hugl
ab3e517d8a libkwineffects/glvertexbuffer: simplify setAttribLayout 2023-09-05 13:23:36 +00:00
Xaver Hugl
617f3b9000 libkwineffects/glvertexbuffer: add a better helper for uploading vertices 2023-09-05 13:23:36 +00:00
Xaver Hugl
cbe8d21f07 libkwineffects: split kwinglutils into multiple files
A single 2000+ line file isn't great to work with
2023-09-05 13:23:36 +00:00
Xaver Hugl
43b9dc7eee libkwineffects/kwinglutils: use std::bitset instead of a custom implementation 2023-09-05 13:23:36 +00:00
Xaver Hugl
e5f9e54944 libkwineffects/kwinglutils: simplify index buffer implementation 2023-09-05 13:23:36 +00:00
Kai Uwe Broulik
23bbc75b12 plugins/{blur,contrast}: Take into account window opacity
Fixes excessive blur/contrast behind a semi-transparent window.
2023-09-04 17:53:32 +02:00
Aleix Pol Gonzalez
3d2a3de07e wayland: Release all keys upon keyboard leaving
Biggest most annoying symptom was that the window was rendered unusable
after alt+tab, but any other combination is also problematic.
2023-09-04 10:24:53 +00:00
Mikhail Vinogradov
82be16df29 Try to refresh textInput active focus status 2023-09-04 08:45:43 +00:00
Kai Uwe Broulik
861105248d screenedge: Don't trigger when a mouse button is pressed
Avoids accidentally triggering an edge when dragging a scroll bar or
text selection all the way to the screen edge.

Special case for moving windows, as you want to be able to drag
a window to an edge to switch virtual desktops.
2023-09-04 08:30:01 +00:00
Vlad Zahorodnii
8470ee03dc Drop Compositor::scheduleRepaint()
Its the only user is the standalone X11 backend, but it can use
RenderLoop.
2023-09-04 07:10:44 +00:00
Vlad Zahorodnii
79cb5fc6e2 backends/x11: Port away from Compositor::scheduleRepaint()
Compositor::scheduleRepaint() needs some knowledge of the composited
layers, which would be great to get rid of to split wayland and x11
compositing bits.
2023-09-04 07:10:44 +00:00
Alexander Lohnau
91f027be51 Specify KPackageStructure instead of KPackageType in knsrc files
The latter is removed in KF6

CCBUG: 474026
2023-09-01 20:20:07 +00:00
Kai Uwe Broulik
dadd7bb545 debug_console: Support KWin::Window* property type
Display the window caption and class name (safe for the icon) like is done
with the windows themselves.

Eases debugging properties, such as "transientFor".
2023-09-01 18:52:03 +00:00