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.
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.
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
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.
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.
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.
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
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.
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
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
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
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.
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>
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>
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>
QSize::isEmpty() will return true if either dimension is 0. On the other
hand, given the current language in the spec, it seems like the client
is allowed to set size constraints per dimension.
BUG: 488260
Output frames can outlive the output they were created for, so the render loop
might also be deleted by the time the output frame is destroyed or presented
BUG: 487701
It caused bugs and doesn't seem to work anymore, with no complaints about it
not working or an obvious reason for it to exist, so it almost certainly
isn't needed at all.
When the slow update timer fires, it's going to pass m_next.first as the
current time in order to calculate the next transition timings. After
the timings have been calculated, the slow update timer will be started
with an interval of "todayNow.msecsTo(m_next.first)". Since todayNow
is a reference to m_next.first, the time diff will be 0, which will
throw off the night light manager. To fix that, make a copy of m_next.first
and then pass the copy as the current date time to resetSlowUpdateTimers().
BUG: 487901
Instead, move the outline below the window, so that the visual order of things stays the
same. This also fixes a visual glitch, where the outline is visible for a moment after
maximization, and is above the no-longer-elevated window
BUG: 436466
BUG: 354741