Bug 453694 - Typo in LatencyPolicy
Summary: Typo in LatencyPolicy
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Unclassified
Component: compositing (show other bugs)
Version: 5.24.5
Platform: Other Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-12 11:25 UTC by Malte
Modified: 2022-05-30 01:03 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.24.6


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Malte 2022-05-12 11:25:42 UTC
SUMMARY
I think there are some oversights in the implementation of the LatencyPolicy for the compositing:
a) The variable for the lowest setting is set to "LatencyExtremelyLow" here:
     https://invent.kde.org/plasma/kwin/-/blob/master/src/kwin.kcfg#L249
and here:
     https://invent.kde.org/plasma/kwin/-/blob/master/src/kcmkwin/kwincompositing/kwincompositing_setting.kcfg#L57

But the enum and actual switch statement have a typo. It's called "LatencyExteremelyLow" with an additional "e", see:
    https://invent.kde.org/plasma/kwin/-/blob/master/src/renderloop.cpp#L61
and 
    https://invent.kde.org/plasma/kwin/-/blob/master/src/options.h#L49

STEPS TO REPRODUCE
1. Look into the sourcecode

OBSERVED RESULT
There is a typo in two places. (I can't check if this actually leads to the setting not being applied correctly.)

EXPECTED RESULT
Everywhere should be the same correct string: "LatencyExtremelyLow"

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: openSUSE Tumbleweed 20220509
(available in About System)
KDE Plasma Version: 5.24.5
KDE Frameworks Version: 5.93.0
Qt Version: 5.15.2


ADDITIONAL INFORMATION
Another thing I noticed (I can open a seperate issue for that if you like) were the following outputs in my journalctl directly after start/login:
> Mai 12 12:53:18 localhost.localdomain kwin_wayland[3792]: QMetaProperty::read: Unable to handle unregistered datatype 'XwaylandCrashPolicy' for property 'KWin::Options::xwaylandCrashPolicy'
> Mai 12 12:53:18 localhost.localdomain kwin_wayland[3792]: QMetaProperty::read: Unable to handle unregistered datatype 'LatencyPolicy' for property 'KWin::Options::latencyPolicy'
> Mai 12 12:53:18 localhost.localdomain kwin_wayland[3792]: QMetaProperty::read: Unable to handle unregistered datatype 'RenderTimeEstimator' for property 'KWin::Options::renderTimeEstimator'
I think this is caused when the .kwinrc is being read and I can only guess that this is caused by the enums having no "usual" datatypes assigned? Like saying
>     LatencyExteremelyLow = 1,
here https://invent.kde.org/plasma/kwin/-/blob/master/src/options.h#L49
I've also no idea if this prevents the variables in .kwinrc from being read and applied correctly?!
Comment 1 Malte 2022-05-12 12:00:43 UTC
I doublechecked and my additional comment regarding
> kwin_wayland[3792]: QMetaProperty::read: Unable to handle unregistered datatype
seems to be triggered by executing
> qdbus-qt5 org.kde.KWin /KWin supportInformation

The "latencyPolicy" and "renderTimeEstimator" are empty in the supportInformation output...
Comment 2 Nate Graham 2022-05-12 15:09:32 UTC
Good catch. Please feel free to submit s merge request at https://invent.kde.org/plasma/kwin/-/merge_requests to fix this!
Comment 3 Bug Janitor Service 2022-05-29 00:13:41 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/2485
Comment 4 Malte 2022-05-29 19:19:03 UTC
Git commit d8da0c7708bc68b22c733db4dce8dea865546ce6 by Malte Dronskowski.
Committed on 29/05/2022 at 18:07.
Pushed by meven into branch 'master'.

Fix typo in latency policy

The lowest latency setting wasn't applied because the internal 
implementation contained an excess 'e' in comparison to the setting 
exposed to the user

M  +1    -1    src/options.h
M  +1    -1    src/renderloop.cpp

https://invent.kde.org/plasma/kwin/commit/d8da0c7708bc68b22c733db4dce8dea865546ce6
Comment 5 Nate Graham 2022-05-30 00:59:58 UTC
Git commit df699c717bb87e2442e8bd021d09fb27f58cf9f4 by Nate Graham, on behalf of Malte Dronskowski.
Committed on 30/05/2022 at 00:59.
Pushed by ngraham into branch 'Plasma/5.25'.

Fix typo in latency policy

The lowest latency setting wasn't applied because the internal 
implementation contained an excess 'e' in comparison to the setting 
exposed to the user

(cherry picked from commit d8da0c7708bc68b22c733db4dce8dea865546ce6)

M  +1    -1    src/options.h
M  +1    -1    src/renderloop.cpp

https://invent.kde.org/plasma/kwin/commit/df699c717bb87e2442e8bd021d09fb27f58cf9f4
Comment 6 Nate Graham 2022-05-30 01:03:25 UTC
Git commit 47671af37b5c50a594e2a5fe4e9acb50c70734a6 by Nate Graham, on behalf of Malte Dronskowski.
Committed on 30/05/2022 at 01:02.
Pushed by ngraham into branch 'Plasma/5.24'.

Fix typo in latency policy

The lowest latency setting wasn't applied because the internal
implementation contained an excess 'e' in comparison to the setting
exposed to the user
(cherry picked from commit d8da0c7708bc68b22c733db4dce8dea865546ce6)

M  +1    -1    src/options.h
M  +1    -1    src/renderloop.cpp

https://invent.kde.org/plasma/kwin/commit/47671af37b5c50a594e2a5fe4e9acb50c70734a6