diff --git a/power_console_common.h b/power_console_common.h index 1c2c2ea..c4dcdce 100644 --- a/power_console_common.h +++ b/power_console_common.h @@ -4,6 +4,7 @@ #include #include +#include void saverChosen(); void perfChosen(); @@ -31,7 +32,13 @@ class MouseWheelSlider : public Fl_Value_Slider // Negative, because I use this for the Brightness control. const int dy= -Fl::event_dy(); - value( value() - dy * step() ); + const int newVal= value() - dy * step(); + if( 0 ) std::cerr << "newVal: " << newVal << " max: " << maximum() << " min: " << minimum() << std::endl; + if( newVal >= maximum() + and newVal <= minimum() ) + { + value( newVal ); + } do_callback();