Commit graph

25221 commits

Author SHA1 Message Date
Xaver Hugl
3820224767 backends/drm: remove "unrecognized enums" warnings
They don't serve any purpose
2023-07-28 21:07:22 +02:00
Nate Graham
fb6edd72e8 plugins/desktopchangeos: Port away from PlasmaExtras.Heading
The Kirigami version is a drop-in replacement. See
https://invent.kde.org/plasma/plasma-workspace/-/issues/75.
2023-07-28 10:18:50 -06:00
Nate Graham
6a25deed28 Revert "Port to upstream QML components where possible"
This reverts commit fd04fe04c0.

This change wasn't technically wrong, but presents an awkward developer
API until the point where we can port *all* PlasmaComponents to their
upstream QQC2 versions, and as such, it was premature.
2023-07-28 10:17:58 -06:00
Nate Graham
fd04fe04c0 Port to upstream QML components where possible
Basically:
- PlasmaExtras.Heading -> Kirigami.Heading
- PlasmaComponents3.Label -> QQC2.label

We can do this because these components only existed in the past to use
special Plasma colors, but no visual styling. And the color stuff is
obsolete because Kirigami colors work correctly in Plasma now.

Everything was tested with a dark Plasma theme and a light color scheme
to ensure no regressions.
2023-07-28 12:58:20 +00:00
l10n daemon script
a2df0707a9 GIT_SILENT Sync po/docbooks with svn 2023-07-28 02:24:46 +00:00
Vlad Zahorodnii
50bc9bb1f1 scene,wayland: Make tracking of the buffer source box less error prone
At the moment, the SurfaceItem needs to track individual properties that
may contribute to the buffer source box. That's error prone.

To fix that, this change makes the SurfaceInterface indicate when the
source box has changed and the SurfaceItem should sync its source box,
discard quads, etc.
2023-07-27 10:55:14 +00:00
Xaver Hugl
7d02bc17d6 backends/drm: rework how atomic commits are tracked
Pending buffers for drm planes and crtcs are no longer tracked in the planes
and crtcs themselves, but instead in a DrmCommit object that is used as
the user data for the pageflip handler. This way multiple commits can be
pending at the same time without causing conflicts, and the handling of
pending buffers is simplified as well.
2023-07-27 12:30:19 +02:00
Xaver Hugl
fcf24d98bf plugins/backgroundcontrast: use the same texture format as the main framebuffer
With color management, the main framebuffer has values over 1. As the effect used GL_RGBA8 for its
fbos, all values in them got clamped to 1, making the result look much darker than it should be. To
fix that, this commit changes it to use the same format as the main framebuffer, ensuring that the
range of values that can be stored is the same
2023-07-27 09:15:39 +00:00
l10n daemon script
47c415c119 GIT_SILENT Sync po/docbooks with svn 2023-07-27 02:16:20 +00:00
Xaver Hugl
90425f46db input: create shape cursor source before using it
BUG: 472358
2023-07-26 20:42:47 +00:00
Xaver Hugl
87444f6ce3 backends/drm: offload atomic commits to a separate thread
This separate thread submits commits as late as possible, so that until
immediately before vblank the cursor position can still be updated, reducing
its latency and opening the door for more optimizations.
2023-07-26 13:44:36 +02:00
Vlad Zahorodnii
febdee08b9 wayland: Fix SurfaceInterface::bufferSourceBox() when the viewport source rect is unset
Vscode starts with a valid source rect but it resets it eventually by
calling wp_viewport.set_source(-1, -1, -1, -1).

On the other hand, `current.viewport.sourceGeometryIsSet` would be true
if that happens.

SurfaceInterface::bufferSourceBox() should use the buffer size when the
source rect has been unset otherwise the damage handling code will be
confused and it's likely that the scene won't issue repaint requests.
2023-07-26 10:52:11 +00:00
Vlad Zahorodnii
762254c354 qpa: Port BackingStore to shared memory graphics buffer allocator
At the moment, graphics buffers coming from wayland and internal windows
use different code paths to update textures. However, they don't have
to.

If the internal windows are ported to GraphicsBuffer, it will be
possible to unify SurfacePixmapInternal and SurfacePixmapWayland to make
pixmap logic a bit simpler.
2023-07-26 07:29:27 +00:00
Vlad Zahorodnii
84149945f6 core: Keep shared memory graphics buffer memory map persistent
This simplifies the logic a bit if a graphics buffer is mapped both by
the SurfacePixmap and QPA.
2023-07-26 07:29:27 +00:00
l10n daemon script
bd7a802d01 GIT_SILENT Sync po/docbooks with svn 2023-07-26 02:19:37 +00:00
Xaver Hugl
d3fed712f0 platformsupport/opengl: support implicit modifiers even with explicit modifiers
This is needed to make the combination of explicit modifier OpenGL + implicit modifier drm
backend work
2023-07-25 16:08:38 +00:00
Vlad Zahorodnii
29229c5aff scene: Fix syncing buffer source box with 100% scale
The buffer source box is synchronized when the surface-to-buffer matrix
changes. However, when using 100% scaling, it's likely that the
surface-to-buffer matrix will be identity and therefore no corresponding
signal to indicate the change will be emitted.

To fix that, we need to update the buffer source box also when the
buffer size changes.
2023-07-25 14:28:01 +03:00
Vlad Zahorodnii
9a2355339c core: Rework OutputTransform type
In some cases, it's desired to know what the inverse transform of a
given output transform is. It's possible to make it work by providing
helper functions, but we tend to avoid doing so.

This change converts the OutputTransform from an enum to a class so it's
possible to have both data + methods in the same type. Unfortunately,
unlike Rust, C++ provides no way to attach methods to enums, classes and
structs is the only way to go.
2023-07-25 12:09:19 +03:00
Vlad Zahorodnii
637e3a6389 core: Move Output::Transform enum to KWin namespace
Being in the KWin namespace has a couple of advantages: the enum can be
forward declared, and the transform can be replaced with a slightly more
complex but useful type.
2023-07-25 12:09:01 +03:00
Vlad Zahorodnii
9e898c0e68 scene: Expand surface damage if the surface is scaled
If the surface item's contents is scaled, i.e. its scale factor doesn't
match the output's scale, GL_LINEAR will be applied to smooth the
contents. The unfortunate thing is that it's possible some of the
changed pixels will bleed to the neighbor ones.

In order to handle that scenario better, this change makes the
SurfaceItem expand the damage if there's scale factor mismatch.

bufferSourceBox and bufferTransform properties were introduced to detect
if the surface contents is going to be scaled. bufferSourceBox covers
both crop transform from wp_viewport and scale factor from wl_surface.
bufferTransform is same as wl_surface's buffer transform property.
2023-07-25 12:09:01 +03:00
Vlad Zahorodnii
b98ffaf785 wayland: Introduce SurfaceInterface::bufferSourceBox()
The bufferSourceBox provides a way to get the source region of the
attached buffer. It can be used to compute the effective scale factor
when using wp_viewport.
2023-07-25 12:09:01 +03:00
Vlad Zahorodnii
bad25bd5c7 Revert "scene: Pad damage if scale factor is fractional"
This reverts commit 56f6bab0c3.
2023-07-25 12:09:00 +03:00
l10n daemon script
7363ac6a94 GIT_SILENT Sync po/docbooks with svn 2023-07-25 02:18:15 +00:00
David Edmundson
35adcfe36a delete platform cursor before Application
We want the platform cursor to have roughly the same lifespan as the
application.

By using QObject parent mechanism, this gets deleted after the
Application destructor in the QObject destructor.

This causes an issue that removing an event filter (used by the X11
cursor) calls into the application singleton which is no longer valid.

BUG: 465970
2023-07-24 14:52:38 +00:00
l10n daemon script
44b06a7baf GIT_SILENT Sync po/docbooks with svn 2023-07-24 09:57:37 +00:00
l10n daemon script
239266c13e 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-07-24 09:49:25 +00:00
l10n daemon script
b6e820bb93 GIT_SILENT Sync po/docbooks with svn 2023-07-22 02:28:15 +00:00
l10n daemon script
de07471c48 GIT_SILENT Sync po/docbooks with svn 2023-07-21 02:41:25 +00:00
Luca Weiss
21420a8671 backends/drm: add missing sys/types.h include
This include is needed for the type dev_t used in this file. Issue seen
when compiling with musl libc on Alpine / postmarketOS.
2023-07-20 10:54:18 +00:00
l10n daemon script
07eafe3b0b GIT_SILENT Sync po/docbooks with svn 2023-07-20 02:33:36 +00:00
Vlad Zahorodnii
aae599d989 Add Xaver Hugl as maintainer
Xaver has been doing really amazing work and he's very active in kwin.
2023-07-19 09:38:25 +00:00
l10n daemon script
302085f63a GIT_SILENT Sync po/docbooks with svn 2023-07-19 03:55:45 +00:00
Laurent Montel
8c51619c1e Remove extra ; 2023-07-18 11:51:09 +00:00
Vlad Zahorodnii
0ccce49fa2 Remove unused fields
Detected by clang.
2023-07-18 11:15:50 +00:00
Alexander Lohnau
33e32f293b Remove X-KWin-Exclude-Listing metadata flag
We only have one KWin script making use of this and that one is shown
regardless. The issue with this flag is that it will hide scripts from
the user without a possibility to see them.

For effects, we have quite a few internal ones and a possibility to show
even hidden ones. But we can not reuse this logic for the scripts.

BUG: 458572
FIXED-IN: 6.0
2023-07-18 08:51:48 +00:00
Xiao YaoBing
1502fa9ab1 prevent the primaryGpu is a usb device in multi-gpu scenes
if usb device is the primaryGpu, the device unplug kwin_wayland exit

`   } else if (device->action() == QStringLiteral("remove")) {
            DrmGpu *gpu = findGpu(device->devNum());
            if (gpu) {
                if (primaryGpu() == gpu) {
                    qCCritical(KWIN_DRM) << "Primary gpu has been removed! Quitting...";
                    QCoreApplication::exit(1);
                    return;
                } else {
                    gpu->setRemoved();
                    updateOutputs();
                }
           }`
2023-07-18 08:44:09 +00:00
l10n daemon script
6df5b0297d GIT_SILENT Sync po/docbooks with svn 2023-07-18 02:28:18 +00:00
Allan Sandfeld Jensen
08d5dc27d0 Fix build with Debian/Ubuntu
Support older pkg-config naming of libdisplay-info
2023-07-17 11:20:29 +03:00
Xaver Hugl
4cb665dd08 platformsupport/scenes/opengl: fix simpledrm
With simpledrm, only linear modifiers are supported, but with llvmpipe, only
implicit modifiers are supported. As it's still possible to allocate linear
buffers without modififer support by using GBM_BO_USE_LINEAR, this commit fixes
that problem by adding linear modififers to the supported list.
2023-07-17 09:34:04 +02:00
Bhushan Shah
5eec4cdb52 cmake: use add_feature_info for libdisplayinfo
That allows cmake to print proper output when dependency is not found.
2023-07-16 07:30:26 +00:00
l10n daemon script
969de1421f GIT_SILENT Sync po/docbooks with svn 2023-07-16 02:33:02 +00:00
l10n daemon script
1db9259bf9 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-07-16 02:28:09 +00:00
Laurent Montel
b823747c3b Add explicit moc includes to sources for moc-covered headers
* speeds up incremental builds as changes to a header will not always
  need the full mocs_compilation.cpp for all the target's headers rebuild,
  while having a moc file sourced into a source file only adds minor
  extra costs, due to small own code and the used headers usually
  already covered by the source file, being for the same class/struct
* seems to not slow down clean builds, due to empty mocs_compilation.cpp
  resulting in those quickly processed, while the minor extra cost of the
  sourced moc files does not outweigh that in summary.
  Measured times actually improved by some percent points.
  (ideally CMake would just skip empty mocs_compilation.cpp & its object
  file one day)
* enables compiler to see all methods of a class in same compilation unit
  to do some sanity checks
* potentially more inlining in general, due to more in the compilation unit
* allows to keep using more forward declarations in the header, as with the
  moc code being sourced into the cpp file there definitions can be ensured
  and often are already for the needs of the normal class methods
2023-07-15 08:40:49 +00:00
l10n daemon script
ad1c820c21 GIT_SILENT Sync po/docbooks with svn 2023-07-14 02:38:10 +00:00
l10n daemon script
bf50cc2b67 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-07-14 02:33:35 +00:00
Laurent Montel
3e31b6fdf2 We depend against qt6 2023-07-13 09:27:53 +02:00
l10n daemon script
c7640e31d2 GIT_SILENT Sync po/docbooks with svn 2023-07-13 02:29:16 +00:00
Vlad Zahorodnii
6cd56d5192 wayland: Implement cursor-shape-v1
References: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/194
2023-07-12 11:22:11 +03:00
David Edmundson
9f18d5fdfc backends/drm: Mark DMA bufs as mirrored when exporting textures
When streaming direct scan out we take the layers texture directly.
When setting the contentTransform we discard the mirrorY transform that
we know is set on DMA bufs. This results in recording being upside-down.
2023-07-12 06:33:05 +00:00
Vlad Zahorodnii
147b862d7f core: Add GraphicsBufferRef
It's a helper to make GraphicsBuffer refcounting less error prone.
2023-07-11 11:55:53 +00:00