Commit graph

26090 commits

Author SHA1 Message Date
Vlad Zahorodnii
8086707d1c Revert "tabbox: Show window switcher only when there are two or more windows"
This reverts commit b31baaf0cd.

It's still a good idea to show the task switcher even if there's only
one window in order to provide the user feedback about their action.
Since the task switcher is not shown when there's only one window, it
can be confusing and lead to thinking that the task switcher is broken.
It also fixes a regression which prevents alt-tabbing to the only
remaining minimized window.

BUG: 480940
CCBUG: 419408
2024-02-06 15:59:14 +00:00
Vlad Zahorodnii
2556378dfa Fix X11Window wrapper window geometry
This amends 66a491bda6.

There are a few more cases that had been overlooked in the original patch.
2024-02-06 12:13:54 +00:00
l10n daemon script
9c0947ae15 GIT_SILENT Sync po/docbooks with svn 2024-02-06 01:37:43 +00:00
Xaver Hugl
3d21e41bc9 backends/drm: add workaround for an amdgpu adaptive sync cursor bug
See https://gitlab.freedesktop.org/drm/amd/-/issues/3034 for details
2024-02-05 23:00:46 +00:00
Xaver Hugl
14749e91e9 backends/drm: try to handle page flips timing out
While this should really never happen in the first place, if the kernel still accepts
atomic commits, this is better than the screen(s) freezing and never recovering.

BUG: 480895
2024-02-05 23:51:14 +01:00
Xaver Hugl
1c8bd1be62 backends/drm: use explicit sync where possible
Instead of calling glFinish, which blocks until it's done and has high CPU
usage on NVidia, use EGL_ANDROID_native_fence_fd to get an explicit sync
fd, which the commit thread automatically waits on before committing the
buffer to KMS.

CCBUG: 452219
2024-02-05 22:46:04 +01:00
Alexander Wilms
3118ba5982 Task Switcher KCM: Change Include "Show Desktop" icon to Include "Show Desktop" entry
Not all task switchers use icons, so "entry" is more fitting.
2024-02-05 21:01:34 +02:00
Vlad Zahorodnii
e7d6e8b217 kcms/options: Hide "active mouse screen" option
In the late Plasma 5 times we agreed that it would be better to drop
"active mouse screen" option and stick with last interacted screen
approach instead. However, it was forgotten and nobody has pursued this
goal, so let's hide the option in the system settings ui at least.

The option is not completely removed because some parts of kwin would
need adjustments.
2024-02-05 20:23:50 +02:00
Vlad Zahorodnii
8f7f97148c plugins/desktopchangeosd: Fix previous desktop indicator
BUG: 480630
2024-02-05 17:17:20 +00:00
Vlad Zahorodnii
63c1363ca1 Fix syncing Xwayland::Scale config option
The new scale value is written but it's not flushed to the disk so
when kcm_fonts_init and kcm_style_init run, they use the old scale
value.

CCBUG: 480792
2024-02-05 16:51:34 +00:00
Xaver Hugl
41aeecbb2a scene/surfaceitem: prevent division by zero
If the steady_clock's resolution is very limited, now - m_lastDamage might be zero,
so enforce a minimum time of 10us (or 100'000 fps)
2024-02-05 16:32:04 +00:00
Vlad Zahorodnii
e97b6032c2 effect: Allow ref'ing normal windows
It can be used to simplify state tracking in some effects. The
restriction exists because there used to be separation between normal
and closed windows (Toplevel and Deleted), and one could reference
only Deleted windows. So it was easier just to forbid referencing still
alive windows.
2024-02-05 15:06:13 +00:00
Vlad Zahorodnii
0c03e7ccfc plugins/slidingpopups: Always ref window when sliding it offscreen
Imagine the following case:

- the window is hidden, slideOut() is called but no deleted reference is
  created because the window is not deleted
- the window is closed, slideOut() won't be called because the window is
  hidden and SlidingPopupsEffect::slotWindowClosed() ignores closed windows
  that are already hidden
- the window is deleted in meanwhile
- the sliding popups effects attempt to delete m_animations[w] entry,
  but since "w" is a dangling pointer at this point, visibleRef is going
  to access released memory

To fix that, make slideOut() always ref the window.
2024-02-05 15:06:13 +00:00
Vlad Zahorodnii
69f344a439 plugins/screenshot: Cache screenshot attributes
When a QPromise reports results, it's not necessary that the
QFutureWatcher is going to report it immediately. That can happen at
some point in the future, which is okay according to the QFuture api
contract.

Due to that, we cannot assume that the stored Output and EffectWindow
objects pointers are valid when the QFutureWatcher::finished is emitted.
2024-02-05 16:24:48 +02:00
Vlad Zahorodnii
50fae55821 Revert "systemd: Set up a watchdog"
kwin_wayland has become unstable. Sometimes it works fine, sometimes it
is randomly killed. Things are quite bad after kwin_wayland --replace.

This reverts commit 71ade59f4b.
2024-02-05 12:54:47 +02:00
Xaver Hugl
6e4b5839ce Revert "opengl/openglcontext: require support for RGBA16F framebuffers"
This reverts commit a89d1f8058. Apparently lima does not
support the extension :|
2024-02-05 10:11:26 +00:00
Kai Uwe Broulik
68f1684031 killer: Initialize Xdg Importer in its constructor
Avoids having to do asynchronous code further down.
2024-02-05 10:04:12 +00:00
Vlad Zahorodnii
fec39141b5 Decouple updateLayout() from updateRootInfo()
It makes code more intuitive, updating X11 specific stuff should not be
needed to update the grid layout. Another advantage that this change
brings is that it should be possible to decouple X11 bits from the
virtual desktop manager completely, might be useful for running multiple
xwayland instances.
2024-02-05 11:52:36 +02:00
Vlad Zahorodnii
8b29f07dbe Make NETRootInfo initialization reasonable
The documentation of NETRootInfo::activate() says that it should be
called after creating the NETRootInfo object to read properties.

However, it's called in two places: VirtualDesktopManager::setRows()
and Workspace::initializeX11(). At quick glance, there's no justifying
reason to call activate() in setRows(), it doesn't fit the purpose
of setRows().

This change re-arranges NETRootInfo initialization code so it makes
more sense.
2024-02-05 09:45:22 +00:00
Vlad Zahorodnii
993f110d59 Don't overwrite current virtual desktop when restarting Xwayland 2024-02-05 09:36:57 +00:00
Aleix Pol Gonzalez
71ade59f4b systemd: Set up a watchdog
Allows to notify systemd whether kwin is still running and possibly
restart the service if it stops responding.

Use Type=notify-reload to watch the kwin service. This will make it so
we receive SIGHUP rather than SIGTERM on the wrapper which we can handle
gracefully and stop the kwin process and restart as expected.

https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
2024-02-05 09:25:08 +00:00
Vlad Zahorodnii
aac5d562fb Drop "<N>" window caption suffix
The current implementation of the `<N>` suffix is still buggy and its
benefits are doubtful. One could argue that visual aids such as window
thumbnails or highlighting the windows are better. On its own, these
numbers don't have strong connections to the windows and can change on
a whim.
2024-02-05 11:10:53 +02:00
Vlad Zahorodnii
3f2b49be5d Stop emitting windowShown signal when XdgToplevelWindow is unminimized
Minimized state has no connection to the hidden state.
2024-02-05 08:44:14 +00:00
Vlad Zahorodnii
66a491bda6 wayland: Remove extra space around the wrapper window in X11 windows
This way no extra buffer space is going to be wasted for a decoration
that isn't there, and it might be nicer for fractional scaling as kwin
won't need to deal with border size voodoo cases.
2024-02-05 08:30:40 +00:00
l10n daemon script
ba37d18ab9 GIT_SILENT Sync po/docbooks with svn 2024-02-05 01:32:52 +00:00
l10n daemon script
909d83419c GIT_SILENT Sync po/docbooks with svn 2024-02-04 01:20:54 +00:00
l10n daemon script
94e1d6de3e GIT_SILENT Sync po/docbooks with svn 2024-02-03 01:23:52 +00:00
l10n daemon script
7c9fb68b14 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-03 01:15:33 +00:00
Vlad Zahorodnii
cc2e6fc96c Add fallback cursor shape for "default" shape
Some cursor themes don't have "default" shape, so fallback to "left_ptr"
with such themes.

BUG: 477476
2024-02-02 17:17:38 +02:00
David Redondo
ee782c8a91 Update to merged version of xdg-toplevel-drag 2024-02-02 14:44:23 +01:00
David Redondo
4d0cd42aef Revert "Use qt prefix variant of toplevel drag protocol"
The protocol has been merged upstream and Qt is now using it.

This reverts commit 216a268a43.
2024-02-02 14:44:23 +01:00
Niccolò Venerandi
79a61deb25 Register touch action to activate Overview instead of toggling it
This is because the Overview will activate itself at the end of a 1:1 gesture,
and a toggle action might actually deactivate it rather than activate it.
2024-02-02 14:42:06 +01:00
Vlad Zahorodnii
e58451fc01 wayland: Truncate virtual desktop names
Virtual desktop names are user defined strings so they can exceed
the maximum size of a wayland message size.

BUG: 480614
2024-02-02 12:03:33 +02:00
l10n daemon script
92f4a95bb5 GIT_SILENT Sync po/docbooks with svn 2024-02-02 01:19:44 +00:00
Vlad Zahorodnii
5896bab86f Activate next window when an X11 window is minimized
It matches the behavior of XdgToplevelWindow.

BUG: 479388
2024-02-02 02:01:39 +01:00
Xaver Hugl
880ce92fb2 xwayland/xwaylandlauncher: don't enable WAYLAND_DEBUG with KWIN_XWAYLAND_DEBUG=0 2024-02-02 02:01:13 +01:00
Vlad Zahorodnii
c733e7a7b6 backends/virtual: Fix OutputFrame 2024-02-02 02:00:51 +01:00
Xaver Hugl
c2749e3acf x11window: explicitly resize when the Xwayland scale changes
With how Xwayland scaling works, KWin assumes the window already uses the
new coordinate system - but that doesn't happen until Xwayland and the client
know about the new size as well.

BUG: 480642
2024-02-02 02:00:27 +01:00
Vlad Zahorodnii
93b9fdd391 effect: Fix initialization of QEvent::isAccepted() in cloned events in OffscreenQuickView
QEvent::isAccepted() is initialized to true by default.

BUG: 480538
2024-02-02 02:00:07 +01:00
Xaver Hugl
67b1a88466 autotests/integration: re-enable lid closed output changes test
KWin is handling the lid switch now
2024-02-02 01:59:36 +01:00
Xaver Hugl
cc72778d5e plugins/nightcolor: clamp preview color temperature to be somewhat sane
BUG: 480700
2024-02-02 01:59:06 +01:00
Yifan Zhu
ae7fb3885b inputmethod&plugins/buttonrebinds: use new KKeyServer API
To correctly handle Qt::Key_Calculator corresponding to both
XF86Calculator and XF86Calculater.
2024-02-01 23:11:32 +00:00
Vlad Zahorodnii
795b619704 Take surface idle inhibitors into account only after window is added to the workspace
This helps to reduce having N sources for the same information.
2024-02-01 10:49:39 +02:00
Marco Martin
19970bd639 plugins/wobblywindows: Use snapping when the window isn't moving
disable pixel snapping when the window is moving with some velocity/acceleration,
reenable it when is (alsmost) stopped
2024-02-01 10:47:45 +02:00
Jay Paul
5ae170f1d6 plugins/screencast: set frame timer to one shot
BUG: 469777
2024-02-01 10:27:15 +02:00
Xaver Hugl
896a57d3be opengl/glshader: make uniform enums type safe 2024-01-31 13:24:48 +01:00
Xaver Hugl
a649be64db backends/drm: use the correct uniform type 2024-01-31 13:24:48 +01:00
Xaver Hugl
6db05aaef1 backends/drm: merge all commits and try again if atomic commits fail
The failure might be from the commit reordering going wrong in some way.
The total accumulated state might still work even if an individual commit
does not though, so before considering the whole frame lost, merge all the
commits and try again
2024-01-31 13:24:24 +01:00
Xaver Hugl
9c0085f5a9 colorspace: make sdr colorimetry not be about rec.2020 anymore
This was just done because of the wrong assumption that displays needed that
to show the full native gamut. That turned out to be an amdgpu bug though; with
that fixed, most of the 0-100% range is wildly oversaturated.
To make the slider more intuitive, this changes the sdr gamut wideness to instead
interpolate to the native display primaries as indicated by the EDID.
2024-01-31 13:23:03 +01:00
Xaver Hugl
8d44ece874 input: increase raise timeout for drag and drop to 1s
This should be long enough to not happen accidentally, but short enough to not be
annoying and discoverable.

BUG: 480511
2024-01-31 10:41:03 +02:00