mate-desktop / mate-power-manager

Power management tool for the MATE desktop
https://mate-desktop.org
GNU General Public License v2.0
59 stars 51 forks source link

Restore previous kdb brightness #250

Closed info-cppsp closed 4 years ago

info-cppsp commented 6 years ago

coming back from idle.

Checked out his old PR #111 Please check this - I can't test it. I am not sure, but the solution in gpm_kbd_backlight_button_pressed_cb () - using a static variable may be a better one. Or maybe I could use this new variable there as well.

raveit65 commented 6 years ago

Did you understand what origin author means with idle? suspend to ram suspend to disk or monitor power off or screensaver is running. I ask because brightness is still restored fine after suspend-to-ram on my notebook.

info-cppsp commented 6 years ago

Is it restored to full brightness or to the last brightness you have set it? If it works, then please close this PR and the other one as well.

raveit65 commented 6 years ago

I tested it with my notebook . Brightness value won't be restored after restart. But i assume it works for you as you open this PR.

raveit65 commented 6 years ago

And what means 'idle' for you or origin author?

info-cppsp commented 6 years ago

I check out the original PR and I saw that it wasn't finished. So I have made this one. I am not 100% sure, but the issue seems to be, that if you suspend your laptop, the keyboard backlight brightness is not saved, and as you resume from suspend, it is set to 100% brightness instead of the last used / known value. what the modes in the code mean is not fully clear to me. (like GPM_IDLE_MODE_NORMAL or GPM_IDLE_MODE_DIM) I can't test this, bc my laptop doesn't have keyboard backlight...

note that this problem may be for just idle - like you are doing nothing on the laptop for a while, and not for suspend. probably this, bc there is a separate mode GPM_IDLE_MODE_SLEEP for suspend ?? in gpm-idle.h

raveit65 commented 6 years ago

ahh, it is about keyboard backlight? Sorry, i misread your first post. I haven't such a hardware to test it.

raveit65 commented 6 years ago

@flexiondotorg want's helping to test

vkareh commented 6 years ago

My laptop has a backlit keyboard, but I might not be able to test much until this evening

info-cppsp commented 6 years ago

@vkareh cool, thanks!

flexiondotorg commented 6 years ago

This pull request does not persist the keyboard backlight brightness on my XPS 13.

The XPS 13 has 3 levels of keyboard backlight brightness 0=off, 1=dim, 2=max. Whatever brightness level I set, when I suspend and resume the brightness is always 1.

info-cppsp commented 6 years ago

can you check sg for me please? without this PR. there should be a gsettings key "kbd-brightness-on-ac" maybe you can set this on th GUI as well. gpm_kbd_backlight_evaluate_power_source_and_set () called should set the brightness to this level after getting back to normal state and if on AC

I can't see why this PR is not working. :( Should be trivial...

info-cppsp commented 6 years ago

@flexiondotorg

when I suspend and resume

sorry for the misunderstanding, but it is probably not suspending just leaving the laptop as is for a while. (like don't move your mouse or type) - though as I have said, it is not fully clear

another thing to check is the "kbd-brightness-dim-by-on-idle" gsettings key. if it is set to zero, there will be no dimming on idle...

raveit65 commented 6 years ago

@flexiondotorg Status of your review?

flexiondotorg commented 6 years ago

@raveit65 See my comment from Feb 26th

raveit65 commented 6 years ago

@flexiondotorg There is a code change since your last comment...... And the author did ask you questions since your comment.

flexiondotorg commented 6 years ago

I will test again. I'm curious that the keyboard brightness is handled in percentage by MATE but all my laptops do not.

raveit65 commented 4 years ago

No answer since 26 Mar 2018 from author. Closing.