Commit ef43d5a
committed
backlight: fix restore_on_exit with no_auto_calib mode
When both restore_on_exit and no_auto_calib are enabled, the user
expects Clight to preserve their manually-set brightness level
throughout the session - dimmer may temporarily lower it, but the
original level should be restored on dimmer exit and when Clight
terminates.
Currently this doesn't work because:
1. Startup forces 100% brightness, overwriting the user's setting
2. current_bl_pct stays at 0, so DIMMER restores to wrong level
3. Async D-Bus call on exit may not complete before process terminates
Fix by:
- Skip forcing 100% brightness at startup when restore is enabled
- Initialize current_bl_pct from hardware after initial Get
- Use synchronous D-Bus call on exit to ensure restore completes
Signed-off-by: LI Qingwu <Qing-wu.Li@leica-geosystems.com.cn>1 parent e2250cc commit ef43d5a
1 file changed
Lines changed: 31 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
239 | | - | |
| 239 | + | |
| 240 | + | |
240 | 241 | | |
241 | 242 | | |
242 | 243 | | |
| |||
250 | 251 | | |
251 | 252 | | |
252 | 253 | | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
253 | 271 | | |
254 | 272 | | |
255 | 273 | | |
| |||
544 | 562 | | |
545 | 563 | | |
546 | 564 | | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
547 | 569 | | |
548 | 570 | | |
549 | 571 | | |
| |||
571 | 593 | | |
572 | 594 | | |
573 | 595 | | |
574 | | - | |
575 | | - | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
576 | 604 | | |
577 | 605 | | |
578 | 606 | | |
| |||
0 commit comments