Closed info-cppsp closed 4 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.
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.
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.
And what means 'idle' for you or origin author?
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
ahh, it is about keyboard backlight? Sorry, i misread your first post. I haven't such a hardware to test it.
@flexiondotorg want's helping to test
My laptop has a backlit keyboard, but I might not be able to test much until this evening
@vkareh cool, thanks!
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.
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...
@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...
@flexiondotorg Status of your review?
@raveit65 See my comment from Feb 26th
@flexiondotorg There is a code change since your last comment...... And the author did ask you questions since your comment.
I will test again. I'm curious that the keyboard brightness is handled in percentage by MATE but all my laptops do not.
No answer since 26 Mar 2018 from author. Closing.
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.