@@ -450,7 +450,6 @@ Singleton {
450450 }
451451
452452 readonly property real stepSize: Settings .data .brightness .brightnessStep / 100.0
453- readonly property real minBrightnessValue: (Settings .data .brightness .enforceMinimum ? 0.01 : 0.0 )
454453
455454 // Timer for debouncing rapid changes
456455 readonly property Timer timer: Timer {
@@ -470,13 +469,7 @@ Singleton {
470469
471470 function increaseBrightness (): void {
472471 const value = ! isNaN (monitor .queuedBrightness ) ? monitor .queuedBrightness : monitor .brightness ;
473- // Enforce minimum brightness if enabled
474- if (Settings .data .brightness .enforceMinimum && value < minBrightnessValue) {
475- setBrightnessDebounced (Math .max (stepSize, minBrightnessValue));
476- } else {
477- // Normal brightness increase
478- setBrightnessDebounced (value + stepSize);
479- }
472+ setBrightnessDebounced (value + stepSize);
480473 }
481474
482475 function decreaseBrightness (): void {
@@ -485,7 +478,7 @@ Singleton {
485478 }
486479
487480 function setBrightness (value : real ): void {
488- value = Math .max (minBrightnessValue, Math . min (1 , value) );
481+ value = Math .min (1 , value);
489482 var rounded = Math .round (value * 100 );
490483
491484 // Always update internal value and trigger UI feedback immediately
@@ -522,11 +515,12 @@ Singleton {
522515 } else if (! isDdc) {
523516 monitor .commandRunning = true ;
524517 monitor .ignoreNextChange = true ;
518+ var setMin = Settings .data .brightness .enforceMinimum ? " -n" : " " ;
525519 var backlightDeviceName = root .getBacklightDeviceName (monitor .backlightDevice );
526520 if (backlightDeviceName !== " " ) {
527- setBrightnessProc .command = [" brightnessctl" , " -d" , backlightDeviceName, " s" , rounded + " %" ];
521+ setBrightnessProc .command = [" brightnessctl" , " -d" , backlightDeviceName, " s" , rounded + " %" , setMin ];
528522 } else {
529- setBrightnessProc .command = [" brightnessctl" , " s" , rounded + " %" ];
523+ setBrightnessProc .command = [" brightnessctl" , " s" , rounded + " %" , setMin ];
530524 }
531525 setBrightnessProc .running = true ;
532526 }
0 commit comments