[Differential] [Updated] D2330: [xrandr backend] fall back to preferred mode, fix crash
dvratil (Daniel Vrátil)
noreply at phabricator.kde.org
Tue Aug 2 07:29:45 UTC 2016
dvratil added a comment.
I wonder how it happens that we try to enable an output without having the mode set. The KDED module should always pick the best resolution (or falling back to preferred mode) when it's enabling an output.
While this fix makes sense in as a crash-guard, I'd also look into why KDED is failing to set the mode in the first place.
INLINE COMMENTS
> xrandrconfig.cpp:519
> + if (!kscreenOutput->currentMode()) {
> + modeId = kscreenOutput->preferredModeId().toInt();
> + }
I wonder if it might be safer to query the preferred mode from corresponding `XRandROutput` rather than trusting user-provided `KScreen::Output` here?
> xrandrconfig.cpp:561
> + if (!kscreenOutput->currentMode()) {
> + modeId = kscreenOutput->preferredModeId().toInt();
> + }
In `changeOutput()` we only change position, mode or rotation of an already-enabled output. I would argue that if the mode is missing in the `kscreenOutput` here (for any reason) it would make more sense to interpret it as "no change" and use `xOutput->currentMode()->id()` and only if `xOutput->currentMode()` is null then fall back to preferred mode (although that already hints that something weird is going on).
REPOSITORY
rLIBKSCREEN KScreen Library
REVISION DETAIL
https://phabricator.kde.org/D2330
EMAIL PREFERENCES
https://phabricator.kde.org/settings/panel/emailpreferences/
To: sebas, dvratil
Cc: graesslin, plasma-devel, #plasma, ali-mohamed, jensreuterberg, abetts, sebas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20160802/09a8e496/attachment-0001.html>
More information about the Plasma-devel
mailing list