summaryrefslogtreecommitdiff
path: root/src/gpm-kbd-backlight.c
AgeCommit message (Collapse)AuthorFilesLines
2025-01-16Keyboard backlight handling improvements (#404)Colomban Wendling1-78/+84
* gpm-kbd-backlight: Fix toggling backlight back on The static value was reset on every call rather than only initially, resulting in failure to restore the initial value when toggling it back on. * gpm-kbd-backlight: Persistently save user-set brightness Try and save the user-set brightness to be able to restore it on next restart. This is not perfect because we have complex interaction between settings which makes it not trivial, if at all possible, to save the value yet respect the dim settings. Here we try to save the value in a way that counteract battery dimming so that restoring the value yields expected results (e.g. a value saved on battery restores identical on battery again), but it cannot work when the value to save is larger than the dimmed maximum as at the moment the maximum value is 100%. It is however the best I could come up with working with the settings we currently have, and it's probably good enough at least as a starting point. It also switches from `master_percentage` to `brightness_percent` in the toggle code because the former is only initialized to the actual current brightness value once brightness changed at least once, while the former is properly initialized. It is otherwise quivalent for this feature, and less confusing as to when the value gets updated. * refactor: gpm-kbd-backlight: Remove some unnecessary temp variables * refactor: gpm-kbd-backlight: Move dimming logic to a helper function * gpm-kbd-backlight: Get rid of `master_percentage` Now the on-AC value changes following user input, the internal `master_percentage` was just plain confusing and actually make things a bit weird at times because it doesn't follow dynamic user choices. So just get rid of it, replacing it with the on-AC value. * gpm-kbd-backlight: Rationalize handling of battery-reduce setting Handling of a disabled battery-reduce setting was too aggressive, which could reduce in not setting backlight value in unrelated cases, including initial startup and resume, as well as some cases of IDLE handling. Now the user choices are better followed, the whole special-casing could probably be removed as the internal state should always reflect the reality, but keep the specific check not to do anything on AC plug/unplug when this is disabled just in case, although the historical reasons why it was actually problematic should be gone now.
2023-11-06Remove compilation warning fix data type format errorzhuyaliang1-1/+1
2021-06-22update copyright to 2021raveit651-0/+1
2020-07-12gpm-kbd-backlight: Remove unused functionsrbuj1-100/+0
2020-05-25gpm-kbd-backlight: do not change keyboard back-light, when disabledAndrej Valek1-9/+16
Automatically change keyboard back-light only when enabled on battery. Keep previous brightness level between state change. Signed-off-by: Andrej Valek <[email protected]>
2020-03-09Port from EggDebug to the built-in GLib logging frameworkrbuj1-13/+12
2019-09-26drop obsolete version checks for upowerraveit651-9/+2
with required version bump to upower-0.99.8 we don't need them any more.
2019-08-20gpm-kbd-backlight: avoid 'g_type_class_add_private'Pablo Barciela1-6/+2
2018-08-13gpm-kbd-backlight: replace deprecated GDK_DEVICE_MANAGERraveit651-10/+10
2018-01-29require GTK+ 3.22 and GLib 2.50monsta1-14/+0
and drop additional checks for min/max GLib versions, it's not needed
2017-08-24gtk 3.22: avoid deprecated gdk_screen_get_monitor... functions:ZenWalker1-0/+12
avoid deprecated: gdk_screen_get_monitor_geometry gdk_screen_get_monitor_at_point
2017-08-16don't abort on unknown DBus signal namemonsta1-1/+1
it's external data, so it's not very clever to put assert on it same as done in: https://github.com/mate-desktop/mate-panel/commit/40b31b2117f8a1776d2f23d97c60547c3c5a70e4
2016-11-22move to GTK+3 (>= 3.14), drop GTK+2 code and --with-gtk build optionmonsta1-14/+1
and require mate-panel >= 1.17
2016-06-07GTK+-3 gpm-kbd-backlight: replace deprecated gdk_display_get_pointerraveit651-0/+15
gdk_display_get_pointer --> gdk_device_get_position
2016-05-31GTK+3: do not use deprecated gtk_widget_size_requestraveit651-1/+6
2015-07-28Unable to change keyboard back light #108Mikhail Shevtsov1-0/+5
Fixed issue for laptops with levels less then 10;
2015-03-19removed unused code, corrected indentationmonsta1-13/+5
the code seems to be unused since https://github.com/mate-desktop/mate-power-manager/commit/8767ffb8172c1e9ae4410226ac4015309bc03f7f Closes https://github.com/mate-desktop/mate-power-manager/pull/136
2014-04-09port mate-power-manager to upower-0.99 APIStefan Seyfried1-0/+8
fix mate-power-manager for current upower versions
2014-04-09avoid "levels is 0" warning if no kbd backlight presentStefan Seyfried1-0/+3
2014-03-09Merge pull request #60 from Firstyear/masterStefano Karapetsas1-49/+0
Add DBUS interface to kbdbacklight control
2014-01-16Copy paste latest OSD code from mate-settings-daemonStefano Karapetsas1-7/+7
2013-06-27RHBZ #964678 : Patch that provides DBUS interface to control KbdBacklight.William Brown1-49/+0
2013-04-13Dont print an error if optional hardware is missingStefano Karapetsas1-1/+2
Closes #54 (https://github.com/mate-desktop/mate-power-manager/issues/54)
2012-11-21This fixes the g_settings issue preventing auto dim of keyboard backlightWilliam Brown1-7/+12
2012-11-21Added some debuging optionsWilliam Brown1-2/+6
2012-11-21Adds on screen display support to keyboard backlight controlsWilliam Brown1-20/+128
2012-11-14Rename some components to mate friendly valuesWilliam Brown1-2/+2
2012-11-11Keyboard backlight patches, tested as working against 1.5.0 on F18William Brown1-0/+734