From b8554930143b3d40fa5b06aa252ed1ff326e2296 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Mon, 18 Mar 2013 17:20:46 -0700 Subject: [PATCH] Mixer: disable context menu on fader view meter indicators. --- mixer/src/Meter_Indicator_Module.C | 4 ++++ mixer/src/Meter_Indicator_Module.H | 4 ++++ mixer/src/Mixer_Strip.C | 1 + 3 files changed, 9 insertions(+) diff --git a/mixer/src/Meter_Indicator_Module.C b/mixer/src/Meter_Indicator_Module.C index 8015232..6ec5e68 100644 --- a/mixer/src/Meter_Indicator_Module.C +++ b/mixer/src/Meter_Indicator_Module.C @@ -50,6 +50,7 @@ Meter_Indicator_Module::Meter_Indicator_Module ( bool is_default ) box( FL_FLAT_BOX ); color( FL_BACKGROUND_COLOR ); + _disable_context_menu = false; _pad = true; control_value = 0; @@ -209,6 +210,9 @@ Meter_Indicator_Module::handle ( int m ) { case FL_PUSH: { + if ( Fl::event_button3() && _disable_context_menu ) + return 0; + if ( Fl::event_button1() ) { /* don't let Module::handle eat our click */ diff --git a/mixer/src/Meter_Indicator_Module.H b/mixer/src/Meter_Indicator_Module.H index 9869eed..1d9f44c 100644 --- a/mixer/src/Meter_Indicator_Module.H +++ b/mixer/src/Meter_Indicator_Module.H @@ -37,8 +37,12 @@ class Meter_Indicator_Module : public Module volatile float *control_value; + bool _disable_context_menu; + public: + void disable_context_menu ( bool b ) { _disable_context_menu = b; } + void handle_control_changed ( Port *p ); Meter_Indicator_Module ( bool is_default = false ); diff --git a/mixer/src/Mixer_Strip.C b/mixer/src/Mixer_Strip.C index e34fa76..cca6774 100644 --- a/mixer/src/Mixer_Strip.C +++ b/mixer/src/Mixer_Strip.C @@ -451,6 +451,7 @@ Mixer_Strip::init ( ) o->size( 33, 100 ); } { Meter_Indicator_Module *o = meter_indicator = new Meter_Indicator_Module( true ); + o->disable_context_menu( true ); o->pad( false ); o->size( 38, 100 ); Fl_Group::current()->resizable(o);