Commit graph

26956 commits

Author SHA1 Message Date
Vlad Zahorodnii
a1443cb43e cmake: Move find_package() around to keep them all close 2024-06-17 05:09:13 +00:00
Vlad Zahorodnii
2d4bbe917c cmake: Group option()s 2024-06-17 05:09:13 +00:00
l10n daemon script
8c067c77f4 GIT_SILENT Sync po/docbooks with svn 2024-06-17 01:31:03 +00:00
Nate Graham
68b7448847 plugins/showpaint: set default shortcut
This effects is off by default, which means to instruct someone how to
use it for debugging purposes, you need to both tell them to enable it,
and then also teach them how to assign a shortcut for it.

Since it's off by default, there's no harm in setting a shortcut, which
simplifies the enablement instructions. I've chosen Meta+Ctrl+Alt+P,
which uses so many modifiers that it won't conflict with anything.
2024-06-16 11:01:40 -06:00
Xaver Hugl
178d49093c backends/drm: don't do direct scanout when HDR brightness isn't 1
Otherwise the brightness multiplier doesn't get applied
2024-06-16 17:11:43 +02:00
l10n daemon script
979ac5bd50 GIT_SILENT Sync po/docbooks with svn 2024-06-16 01:27:32 +00:00
Vlad Zahorodnii
29a5541ccf wayland: Reset dnd state when the target surface is about to be destroyed
Use the SurfaceInterface::aboutToBeDestroyed() for the consistency sake
with other code that performs cleanup when the wl_surface is destroyed.
2024-06-15 15:11:53 +00:00
Vlad Zahorodnii
e1192a6934 plugins/nightlight: Drop NightLightManager::self()
It's unused.
2024-06-15 12:06:06 +03:00
Vlad Zahorodnii
d00d00c7fc plugins/nightlight: Tidy header include directives 2024-06-15 12:03:39 +03:00
Vlad Zahorodnii
6b4ef4170c plugins/nightlight: Shuffle some code
Keep things that are related spatially close, in this case, the
initialization of the timer that will start the next transition.
2024-06-15 11:37:26 +03:00
Vlad Zahorodnii
d595b8f8aa plugins/nightlight: Rename FALLBACK_SLOW_UPDATE_TIME 2024-06-15 07:58:15 +00:00
Vlad Zahorodnii
55dc891190 plugins/nightlight: Store transition duration in milliseconds
This allows us to make the code that computes transition timings more
cleaner, and other time constants are in milliseconds, so it makes sense
to make m_transitionDuration store milliseconds too.
2024-06-15 07:58:15 +00:00
l10n daemon script
5c6e51d75e GIT_SILENT Sync po/docbooks with svn 2024-06-15 01:28:00 +00:00
l10n daemon script
927fb42abc 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-06-15 01:19:16 +00:00
Vlad Zahorodnii
3461d5bc3a plugins/nightlight: Unobfuscate code that reads geocoordinates
The current code is unreadable:

- it creates a lambda that captures two local variables for latitude and longitude
- then it copies values from the config to those local variables
- calls the lambda
- and finally copies the data from the local variables to the NightLightManager fields

That code can be simplified by simply calling checkLocation() directly
and using an if statement.
2024-06-15 01:29:59 +03:00
Vlad Zahorodnii
e5528e9317 plugins/nightlight: Rename variables and functions to adhere to the KDE coding conventions
The variables and functions should be fully spelled out, with temporary
variables being an exception.
2024-06-14 18:24:06 +03:00
Vlad Zahorodnii
786b3ffbae plugins/nightlight: Guard against invalid timings in the config
Morning and evening timings should be ordered correctly. When computing
the daylight duration, that ternary operator should not be needed and it
hides other bugs.
2024-06-14 18:00:53 +03:00
Vlad Zahorodnii
07f266e7c7 plugins/nightlight: Remove premature optimization in updateTransitionTimings()
There are a couple of reasons why it's worth removing it:

- it's error prone. If one forgets to pass correct "force" flag, night
  light will break
- it contributes some complexity
- updateTransitionTimings() is not called in any hot path and the code
  that calculates the position of the Sun is not resource intensive
2024-06-14 14:26:35 +00:00
Vlad Zahorodnii
5fe9e9c756 plugins/screencast: Check compositing type
Screencasting only works with OpenGL compositing at the moment.
2024-06-14 12:50:46 +00:00
Vlad Zahorodnii
8256f8e14c Reorder some function calls in X11Window::updateServerGeometry()
The main motivation is to improve code aesthetics. The relative
order in which various window properties are configured shouldn't
matter.
2024-06-14 12:37:56 +00:00
Vlad Zahorodnii
5d03d58dc1 Drop X11Window::resizeDecoration()
We can call updateInputWindow() directly.
2024-06-14 12:37:56 +00:00
Vlad Zahorodnii
a7c4175099 Don't call triggerDecorationRepaint() when resizing an X11Window
Wayland windows have no such code path and they have been good so far.
If the borders change, KDecoration will trigger a repaint.
2024-06-14 12:37:56 +00:00
Vlad Zahorodnii
fef2bfb93f plugins/nightlight: Make Night Light more robust to QTimer firing slightly earlier
Currently, resetSlowUpdateTimers() will start a timer that will pass
m_next.first as the current time to resetSlowUpdateTimers(). This kind
of works, but there are more code paths where updateTransitionTimings()
can be called.

This change hardens updateTransitionTimings() against the current time
being very close to the start of the next transition by introducing a
time fudge factor.

If we are currently 1 second away from the start of the next transition,
then it is assumed that that transition has been reached, and we need
to calculate the timings of a transition after that.
2024-06-14 12:06:34 +00:00
Vlad Zahorodnii
ad98069618 Make Window::closeWindow() noop if the window is already closed
The surface handle can be dropped by that time. Also, there is no point
to ask the client to close the window again if it's already closed.
2024-06-14 11:16:41 +00:00
Vlad Zahorodnii
ec86640f44 plugins/nightlight: Tidy temperature lerp code
This change simplifies the color temperature interpolation code by doing
the following:

- compute a progress value so 0 corresponds to target1, i.e. the beginning
  of the transition, and 1 corresponds to target2, the end of the
  transition, instead of vice versa
- and use std::lerp() function

Rounding to a multiple of ten is not needed, it is for nicer digits in
the applet, but if the applet really cares about it, it could perform
such rounding on its own. In the night light manager, it's better to avoid
rounding the interpolated values because that can result in the final
temperature getting outside of the [target1, target2] interval.
2024-06-14 07:22:03 +00:00
David Redondo
c2141dc4ef Also wake up screens on tablet interactions
BUG:451359
FIXED-IN:6.1.1
2024-06-14 06:54:42 +00:00
Vlad Zahorodnii
f46174453d plugins/nightlight: Ensure the target temperature remains within reasonable bounds
The interpolated temperature can get out of the bounds of [target1, target2]
if the current time is slightly earlier than m_prev.first, which can be
unexpected. This change addresses that by adding a relevant guard.
2024-06-13 15:58:01 +03:00
Vlad Zahorodnii
21a45c2700 Avoid sending X11 sync request if new logical geometry doesn't change the device geometry
There are two mechanisms to throttle ConfigureNotify events during
interactive resize:

- either using XSync
- or by a dummy QTimer

The QTimer approach is pretty straightforward: the wm configures the
window, blocks the interactive resize operation and arms a timer to
unblock it some time later in the future.

With the xsync approach, the wm sends an xsync request, makes a
call to XConfigureWindow(), and blocks interactive resize until
the xsync request is acked by the client. When the client sees the
ConfigureNotify event, it is going to repaint and ack the xsync request.
When the xsync request is acked, the wm will apply new geometry and
unblock interactive resize.

After the scaling changes, the logical geometry can have some fractional
part, which gets rounded when configuring the X windows. Due to that,
it's possible to encounter the case where the logical geometry changes,
but the native/device geometry does not due to std::round(). In that
case, the wm should not send an xsync request because the client won't
ack it because the device geometry has not changed.

BUG: 488223
2024-06-13 08:34:30 +00:00
Vlad Zahorodnii
4db2742e96 autotests: Add a missing mock definition of Xcb::toXNative(QRectF) 2024-06-13 08:34:30 +00:00
l10n daemon script
312f88872b GIT_SILENT Sync po/docbooks with svn 2024-06-13 01:25:35 +00:00
Xaver Hugl
ad6700dd88 workspace: initialize the output config store earlier
It needs to be created before the outputs are queried the first time,
as that uses the config store
2024-06-12 19:32:36 +02:00
Xaver Hugl
6543ab3caa workspace: only load output configs on Wayland
They don't need to be loaded, or on exit saved again on X11

BUG: 488229
2024-06-12 17:46:31 +02:00
Vlad Zahorodnii
c2ca1cc33d wayland: Remove unnecessary wl_surface resource check
The lifetime of SurfaceInterface matches the lifetime of the corresponding
wl_resource.
2024-06-12 13:43:00 +00:00
Vlad Zahorodnii
8fb3348600 wayland: Clean up action matching connections when the target dnd surface dies 2024-06-12 13:43:00 +00:00
Vlad Zahorodnii
877d220bfe wayland: Fix a crash in dnd action matching
In order to match dnd actions, we need both a data source and a data
offer. If the preferred actions of either change, then a new dnd
must be chosen.

The code that sets up the monitoring of the preferred actions of the
data offer sets the correct receiver context object (data source).

But the code that sets up the monitoring of the preferred actions of
the data source uses the data source as the receiver context object,
however we would like to break the matchOffers connection when either
the data source or the data offer is destroyed.
2024-06-12 13:43:00 +00:00
Vlad Zahorodnii
f37c15b0a2 Enable drkonqi
Enable dr konqi for kwin so sentry crash reports are more useful.
2024-06-12 12:45:47 +00:00
Vlad Zahorodnii
6be238e622 Fix registering touch screen edge actions after the screen edge has been reserved
After the screen edge is reserved, the touch screen gestures will be
registered or unregistered when the Edge::activatesForTouchGesture()
signal is emitted.

On the other hand, Edge::reserveTouch() lacks code to emit that signal,
which results in touch screen gesture not working if the same screen
edge is reserved both for pointer and touch input.

BUG: 451349
2024-06-12 12:33:52 +00:00
Xaver Hugl
35a7e30952 backends/drm: set scaling mode to full aspect with generated modes on internal displays
While the scaling mode has caused some issues with external displays, we've had several
reports that using "unify outputs" has caused the internal display to no longer show
anything, as it changes to an unsupported mode. This sets the scaling mode so that the
driver handles the scaling internally, instead of leaving it up to the panel, and it only
does so on internal displays with generated modes, to minimize the risk of further breakage.

BUG: 488111
2024-06-12 11:50:57 +00:00
Jie Liu
131c5399b3 x11window: enable startSystemMove/Resize which is triggered from touch events
Signed-off-by: Jie Liu <liujie01@kylinos.cn>
2024-06-12 02:19:02 +00:00
l10n daemon script
d65bc400e9 GIT_SILENT Sync po/docbooks with svn 2024-06-12 01:31:01 +00:00
l10n daemon script
1c3b4cc548 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-06-12 01:19:49 +00:00
David Edmundson
d6360cc4ce effects: Drop morphing popups effect
The effect does not work very well for two main reasons:
Some clients will make a new popup rather than move an existing one, so
whether it does anything is highly unpredictable as a user.

Popups can be of massively different sizes with different amounts of
text. This means the text in the smaller popup gets resized which
doesn't look like a natural in-between state of the two popups. This
defeats the objective of looking smoother.

On top of that, it's rather glitchy.
This effect was purely visual, no functionality changes.

BUG: 473411
BUG: 466638
BUG: 416048
BUG: 461501
BUG: 466637
2024-06-11 19:58:50 +00:00
Vlad Zahorodnii
64b02cf464 plugins/screencast: Preserve modifier order
The SPA_FORMAT_VIDEO_modifier property has the following format:

    preferred_value,alternative1,alternative2,...

The preferred value is usually the same as the first alternative value.
It can also happen that the modifier list the compositor has supplied is
not good either and it contains duplicate entries, specifically
`DRM_FORMAT_MOD_INVALID` to indicate that modifier-less buffers are
supported.

In order to deal with that, the screencast plugin removes the
duplicates by sorting the modifier list and then using std::unique().

That is not good, there is no written rule that the order of the
modifiers passed to the graphics buffer allocator matters but it
typically does, some drivers in mesa assume that the modifiers are
sorted in the preference order. The graphics buffer allocator might be
also very lazy and just look at the first supplied modifier instead of
wisely choosing the best modifier.

This change makes the ScreenCastStream remove the duplicate modifiers
in a more conservative fashion preserving the relative order of the
modifiers. It also removes an extra `{DRM_FORMAT_MOD_INVALID}` because
this kind of thing should be dictated by the render backend.
2024-06-11 10:39:19 +03:00
l10n daemon script
6c69f0a4d1 GIT_SILENT Sync po/docbooks with svn 2024-06-11 01:32:20 +00:00
Aleix Pol Gonzalez
f9b9149ba4 plugins/showfps: Allow showfps to work without kirigami and quickcharts
showfps is a handy plugin when deploying to a new platform because it
will render something that says "I am here".
Since both kirigami and quickcharts are quite high level, we add a
variant that just depends on QtQuick and shows the fps which is what we
promise anyway.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
2024-06-10 17:32:28 +02:00
Aleix Pol Gonzalez
b202ecf711 aaaa 2024-06-10 17:32:28 +02:00
Aleix Pol Gonzalez
3c857a3375 scripting: Do not crash when calling workspace.clientArea() without an output
Just set a default one, one way less a script can crash kwin.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
2024-06-10 17:23:43 +02:00
Aleix Pol Gonzalez
68d1e2f42a wayland: Log an entry when an unsupported buffer was submitted
It's fine to be conservative about what kind of buffers we support, but
failing silently only makes it hard on such cases.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
2024-06-10 17:23:43 +02:00
Aleix Pol Gonzalez
70231f2431 backends/drm: Complain when we are issuing an invalid drm property
The alternative is silent failures and KWin rendering nothing. The
kernel will only be telling us that something went wrong which makes it
hard to debug.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
2024-06-10 17:23:42 +02:00
Vlad Zahorodnii
cd2d5b07d5 Prevent potentially adding closed windows to the attention chain
CCBUG: 486693
2024-06-10 16:21:16 +03:00