Bug 356132 - Starting KDE causes with power widget causes screen brightness to go to 0
Summary: Starting KDE causes with power widget causes screen brightness to go to 0
Status: RESOLVED WORKSFORME
Alias: None
Product: plasmashell
Classification: Plasma
Component: Battery Monitor (show other bugs)
Version: master
Platform: Kubuntu Linux
: NOR normal
Target Milestone: 1.0
Assignee: Kai Uwe Broulik
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2015-11-30 22:55 UTC by Charles H
Modified: 2018-10-27 02:15 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Set a defalt value for slider; not tested (529 bytes, patch)
2015-11-30 23:02 UTC, Charles H
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Charles H 2015-11-30 22:55:49 UTC
Adding the Battery Monitor widget to my plasma desktop causes the screen brightness to drop to 0 when first logging in; this is a huge problem because this particular laptop turns off the screen at 0. It would be helpful if it kept the last setting, used the value specified in the power management settings, or set it a non-zero value (such as 1).

Reproducible: Always

Steps to Reproduce:
1. Add widget to desktop
2. Log out
3. Log back in

Actual Results:  
The screen was blank (literally turned off); work around is to guess at where the slider to adjust brightness is, or to plug and unplug the charger.

Expected Results:  
The battery monitor should have kept the brightness it was at the last time KDE was quit.

Laptop: ASUS ZENBOOK UX303LN
Comment 1 Charles H 2015-11-30 23:02:40 UTC
Created attachment 95829 [details]
Set a defalt value for slider; not tested

I'm having trouble compiling the widget for testing; please test this, but I believe this solution will work based on the documentation here (http://api.kde.org/4.x-api/kde-runtime-apidocs/plasma/declarativeimports/plasmacomponents/html/classSlider.html)
Comment 2 David Edmundson 2015-12-04 00:36:10 UTC
That patch doesn't make a lot of sense.

but the user of BrightnessItem (PopupDialog.qml) *also* sets a value:

        BrightnessItem {
            id: brightnessSlider
            value: batterymonitor.screenBrightness
            ...
       }

so you'd set the value of 1, then this would override it before you've started doing anything.

Currently we set it to undefined which isn't very good code tbh, but it won't do anything as we only connect the valueChanged signal on the slider after everything is loaded. We then call updateBrightness in Logic.js that updates the slider's initial value.

That initial value comes from powerdevil, I think you want to be looking there and this slider is a red herring.
I think you're looking very much in the wrong place; the slider won't do
Comment 3 David Edmundson 2015-12-04 01:03:40 UTC
Did you try it without the widget, what happens?

if you (from a terminal)
kquitapp5 plasmashell
plasmashell

does it reset?
Comment 4 Charles H 2015-12-07 17:30:49 UTC
I'll try that as soon as I can David, thanks (left the laptop with the issue at home, I'll be back and have time Thursday night).
Comment 5 Peter Wu 2016-06-04 18:32:33 UTC
This was not fun debugging, jumping from kdeinit5/powerdevil via dbus to plasmashell to a widget. Question: have you expanded the battery monitor widget? That seems to trigger the bad condition in plasma-workspace 5.6.4.

Can you try this patch: https://git.reviewboard.kde.org/r/128098/ (and check also if the analysis is sane)
Comment 6 Andrew Crouthamel 2018-09-26 22:12:50 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days, the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please set the bug status as REPORTED so that the KDE team knows that the bug is ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 7 Andrew Crouthamel 2018-10-27 02:15:01 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!