Commit graph

26362 commits

Author SHA1 Message Date
Xaver Hugl
d1bc39a6ea backends/drm: don't set gamma with legacy unless really necessary
It seems to have a pretty large performance impact
2024-03-07 01:50:43 +01:00
Xaver Hugl
568f9fb666 backends/drm: ignore ctm support on legacy
BUG: 482143
2024-03-07 01:50:20 +01:00
Xaver Hugl
4a42829841 backends/drm: move tracking of legacy direct scanout presentation to DrmPipeline
The behavior between direct scanout and normal presentation being different is an
implementation detail of DrmPipeline, the output layers shouldn't need to care
2024-03-06 21:42:26 +01:00
Aleix Pol
1d57c9a5af effects: Use chrono to specify the animation times
Makes both the API and its uses explicit in terms of what unit the times
are on.
2024-03-06 10:19:55 +00:00
Vlad Zahorodnii
f82542790c plugins/shakecursor: Enable by default
Multi monitor setups with 4K screens are not uncommon and one of the
annoyances associated with such setups is that you lose the track
of the cursor sometimes. It's natural to shake the cursor in such
occasions.

This change enables the shake cursor effect to improve the desktop
experience. One potential risk associated with doing so is that the cursor
can be magnified in some undesired situations. It is true. But we took a
great precaution of that and added some heuristics to avoid triggering the
effect in such cases given all the data we have available.
2024-03-05 21:32:35 +00:00
Vlad Zahorodnii
dcd20922d9 plugins/shakedetector: Optimize ShakeDetector
Only store one history item for movement in the same direction.
With this optimization I measure m_history.size() <= 15 for all kinds of
movements, including back and forth, and circular.
2024-03-05 18:30:51 +00:00
Vlad Zahorodnii
0bc60023f5 plugins/shakecursor: Prefer operator[] over at()
Bounds checks are redundant. Plus kwin is built with exceptions disabled.
2024-03-05 17:38:14 +00:00
Vlad Zahorodnii
2ad896c71d plugins/shakecursor: Make the cursor big enough upon the first shake
The current behavior is that the cursor size follows how hard or fast
the cursor is shaken. While this looks fancy, given the purpose of this
plugin, it should be possible to magnify the cursor as easy as possible
without interfering or false triggering.

This change implements a sort of a compromise. When the cursor is shaken
for the first time, the cursor is magnified by some certain scale factor.
Then every next shake magnifies the cursor further by a smaller amount.
2024-03-05 18:34:30 +02:00
Vlad Zahorodnii
8736e44e1a effect: Fix EffectWindow::contentsRect()
It should specify the client rect inside the frame.

2556378dfa incorrectly assumed that the
buffer geometry includes the decoration.

BUG: 482294
2024-03-05 13:34:35 +00:00
Vlad Zahorodnii
bfd755aee9 Fix confined pointer being able to escape the surface
When using fractional scaling, an xwayland window's client geometry can
have some fractional part. When that's the case, .toRect() can shrink the
client geometry or extruding the decoration borders inside the surface.

On the other hand, the pointer is going to be confined as long as the
wl_surface is focused. If the focus jumps to the decoration, the pointer
constraint is going to be broken. Unfortunately, the focus can shift to
the decoration even though the wl_surface is still focused because of the
pesky .toRect().

BUG: 482448
CCBUG: 477124
2024-03-05 13:23:59 +00:00
Vlad Zahorodnii
0c8b3251e5 examples: Fix License metadata 2024-03-05 11:02:37 +00:00
l10n daemon script
2b8b53a105 GIT_SILENT Sync po/docbooks with svn 2024-03-05 01:20:02 +00:00
l10n daemon script
a33fe84f57 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-03-05 01:14:33 +00:00
Dominique Hummel
d0a6bd3404 effects/windowview: use correct enum value for PointerDevice
BUG: 482191
2024-03-04 23:14:55 +00:00
Ser Freeman
43e5f17547 Window: Rearrange handleInteractiveMoveResize
Calculate the next geometry without actually moving a window.
This prevents one of the visual issues when restoring a maximized
window by dragging.
2024-03-04 14:57:59 +00:00
Xaver Hugl
599020d8da backends/drm: don't work around pageflips timing out
It doesn't seem to (always) work, and it has caused at least one crash. If the workaround
is needed, it'll have to be implemented in a different way
2024-03-04 13:44:35 +00:00
Xaver Hugl
1b10dde569 opengl: assume a minimum of 2ms of render time
When GPUs are barely loaded, render times can spike randomly, likely because it goes
to a lower power state and has to ramp up again when KWin renders. To ensure this
doesn't make KWin drop frames, assume rendering always takes at least 2 milliseconds
2024-03-04 13:07:15 +00:00
Xaver Hugl
da80dd4c84 backends/drm: fix vblank calculation
Due to some misinterpretation of mode timings, the old method calculated vsync, not vblank,
so the resulting duration was much shorter, which caused frame drops on some systems.

BUG: 482064
2024-03-04 13:34:16 +01:00
Vlad Zahorodnii
9e77e5038f wayland: Fix a crash in DrmLeaseDeviceV1Interface::setDrmMaster()
The case when a resource is destroyed before kwin becomes the drm master
again is not handled. It can leave dangling pointers in m_pendingFds.
2024-03-04 10:59:40 +00:00
Xaver Hugl
3b28788592 wayland/surface: don't update preferred color description unless it changed
This avoids clients doing unnecessary work
2024-03-03 18:10:26 +00:00
David Edmundson
918ac8b27e xwayland: Use correct key for key release events
When a key is pressed the string that should be used in the key event
changes depending on the xkb updated state for composed keys.

The key itself should be not be affected.
2024-03-03 12:41:15 +00:00
David Edmundson
b650f55d60 xwayland: Add unit test for XWayland key tracking 2024-03-03 12:41:15 +00:00
David Edmundson
2025bf4c6b xwayland: Send to xwayland even when no window is focussed
In the codepath to keep xwayland notified of key presses we have to
check the focussed window is not already an xwayland client. To avoid a
null dereference a guard is added that the focussed window is not null,
however the current code incorrectly returns early intead of skipping
just the relevant check.

BUG: 478705
2024-03-03 12:41:15 +00:00
Sam James
53a61dfac0 Fix ODR violation with MouseClick plugin
```
/var/tmp/portage/kde-plasma/kwin-6.0.49.9999/work/kwin-6.0.49.9999/src/input_event.h:21:7: error: type ‘struct MouseEvent’ violates the C++ One Definition Rule [-Werror=odr]
   21 | class MouseEvent : public QMouseEvent
      |       ^
/var/tmp/portage/kde-plasma/kwin-6.0.49.9999/work/kwin-6.0.49.9999/src/plugins/mouseclick/mouseclick.h:27:7: note: a type with different bases is defined in another translation unit
   27 | class MouseEvent
      |       ^
lto1: some warnings being treated as errors
```

Bug: https://bugs.gentoo.org/921558
Signed-off-by: Sam James <sam@gentoo.org>
2024-03-03 10:46:03 +00:00
l10n daemon script
956390005b GIT_SILENT Sync po/docbooks with svn 2024-03-03 01:26:45 +00:00
l10n daemon script
282d221ee1 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-03-03 01:16:28 +00:00
l10n daemon script
96139b8af5 GIT_SILENT Sync po/docbooks with svn 2024-03-02 01:21:33 +00:00
l10n daemon script
fdb8d49946 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-03-02 01:13:21 +00:00
Vlad Zahorodnii
2491fb1b2b Ignore size hints when maximizing X11 windows
This is to help to fix maximized xwayland windows not covering the whole
work area. Size hints are obeyed only when restoring the window.

According to the net wm spec, the window manager should not obey size
hints when maximizing a window and some other window managers already ignore
them when maximizing windows.

CCBUG: 459373
2024-03-01 14:50:38 +00:00
Vlad Zahorodnii
47317a9fc7 examples/quick-effect: Revamp CMakeLists.txt 2024-03-01 14:31:42 +00:00
Vlad Zahorodnii
f0b3964c1a examples: Add quick script example 2024-03-01 14:31:42 +00:00
Akseli Lahtinen
181ce590a9 plugins/overview: Adds a border around hovered and selected desktop in desktopGrid
Currently desktop grid view is missing the selection rectangle when hovered over a desktop.
This adds the selection rectangle on hover, since it used to be there before three-state design.

Currently selected desktop has thinner and different colored border.


![image](/uploads/ad1f2f7acbe602fb7b9479ce859026b7/image.png)

![image](/uploads/9fa50bac4b81958da0b8926f8d2518ba/image.png)

![image](/uploads/3e46c1f5a740c40bbf18a5d887f31d39/image.png)

BUG:481812
2024-03-01 12:05:14 +00:00
l10n daemon script
f6813258ce GIT_SILENT Sync po/docbooks with svn 2024-03-01 01:39:10 +00:00
l10n daemon script
49852cc096 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-03-01 01:15:05 +00:00
Vlad Zahorodnii
0dc3f4906f opengl: Harden GLRenderTimeQuery against opengl providing bad timestamps
The end render timestamp can be slightly in the past before the start
render timestamp. This results in negative render times, which can make
kwin wait way more than just one vblank interval before starting the
next frame.

It appears that there is no way to detect if the gpu has performed a
disjoint operation in OpenGL. It's available only in GLES. As a way
around, this change makes the GLRenderTimeQuery insert two probes: one
queries gl timestamps when starting rendering and ending rendering;
another one just queries std::steady_clock before and after painting.
This hardens the GLRenderTimeQuery against OpenGL providing nonsensical
results sometimes.

BUG: 481721
2024-02-29 17:58:17 +00:00
Vlad Zahorodnii
79b7545840 backends/x11: Make SwapEventFilter report presentation feedback to OutputFrame 2024-02-29 16:46:05 +02:00
Vlad Zahorodnii
64dc01c640 effect: Drop WindowPaintData::screen
It's unused.
2024-02-29 13:33:52 +00:00
Marco Martin
86ede0ecf2 Remove invalid tabbox configs from defaults
We know that org.kde.breeze.desktop is invalid as LayoutName for the
tabbox, it will break the default button in the tabbox kcm.
Also the DesktopListLayout and DesktopLayout aren't valid anymore

BUG:481640
2024-02-29 11:14:31 +00:00
Fushan Wen
d377b5cdab plugins/outputlocator: show physical size in output locator
Make sure the effect shows the same sizes as the KScreen KCM.
2024-02-29 09:29:51 +00:00
l10n daemon script
bd88801de4 GIT_SILENT Sync po/docbooks with svn 2024-02-29 01:22:07 +00:00
Shubham Arora
e89bd802a2 kwin/rules: update placeholder text and add icon 2024-02-28 21:58:15 +00:00
Shubham Arora
52349491af kcm/rules: move kcm actions to top 2024-02-28 21:58:15 +00:00
Aleix Pol Gonzalez
bf1ce85474 Make it possible to build KWin without libxcb
Now that we have Wayland around, there's a whole branch of dependencies
that shouldn't be necessary anymore.
This allows to build KWin without all of it, allowing us to have a much
more compact alignment for cases where all the legacy software isn't
necessary anymore.

Bundle KWindowSystem X11-specific headers into it too, since it's part
of the same process.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
2024-02-28 16:03:50 +00:00
Aleix Pol Gonzalez
94121c2a42 Unify the format for #include "config.h" 2024-02-28 16:03:50 +00:00
Nate Graham
26a7af5e5f {kcms,plugins}: Use real ellipsis character for user-facing translated strings
This is better for screen readers.
2024-02-28 08:58:37 -07:00
Vlad Zahorodnii
e84d5bb666 examples: Add binary plugin example 2024-02-28 15:38:05 +00:00
Vlad Zahorodnii
38fae969a9 examples/quick-effect: Clean up metadata 2024-02-28 15:27:50 +00:00
Jin Liu
7d7344a983 plugins: add a "hidecursor" effect
This hides the mouse cursor on inactivity or keypress (configurable in the KCM).

BUG: 465119
2024-02-28 11:23:21 +00:00
l10n daemon script
494daab3d5 GIT_SILENT Sync po/docbooks with svn 2024-02-28 01:20:33 +00:00
l10n daemon script
6004ffe228 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-02-28 01:14:13 +00:00