Browse Source

Mixer: Fix issue with meter module eating ctrl+left click event.

tags/non-daw-v1.2.0
Jonathan Moore Liles 10 years ago
parent
commit
6d7a71636a
4 changed files with 10 additions and 6 deletions
  1. +4
    -2
      FL/test_press.C
  2. +2
    -1
      mixer/src/Meter.H
  3. +1
    -1
      mixer/src/Meter_Indicator_Module.C
  4. +3
    -2
      mixer/src/Meter_Module.C

+ 4
- 2
FL/test_press.C View File

@@ -31,8 +31,10 @@ test_press ( unsigned long e )
if ( Fl::event_text()[0] )
((char *)Fl::event_text())[0] = '\0';

if ( ! ( e & FL_SHIFT ) )
return Fl::test_shortcut( e ) && ! Fl::event_shift();
const int mod_mask = FL_SHIFT | FL_ALT | FL_CTRL;

if ( ( e & mod_mask ) != ( Fl::event_state() & mod_mask ) )
return false;
else
return Fl::test_shortcut( e );
}

+ 2
- 1
mixer/src/Meter.H View File

@@ -23,6 +23,7 @@
#include <FL/Fl.H>
#include <FL/Fl_Widget.H>
#include <FL/Fl_Valuator.H>
#include "FL/test_press.H"

class Meter : public Fl_Valuator
{
@@ -37,7 +38,7 @@ protected:
{
if ( m == FL_ENTER || m == FL_LEAVE )
return 1;
else if ( m == FL_PUSH && Fl::event_button1())
else if ( m == FL_PUSH && test_press( FL_BUTTON1 ))
{
reset();
return 1;


+ 1
- 1
mixer/src/Meter_Indicator_Module.C View File

@@ -197,7 +197,7 @@ Meter_Indicator_Module::handle ( int m )
if ( Fl::event_button3() && _disable_context_menu )
return 0;

if ( Fl::event_button1() )
if ( test_press( FL_BUTTON1 ) )
{
/* don't let Module::handle eat our click */
return Fl_Group::handle( m );


+ 3
- 2
mixer/src/Meter_Module.C View File

@@ -150,12 +150,13 @@ Meter_Module::handle ( int m )
{
case FL_PUSH:
{
int r = 0;
if ( test_press( FL_BUTTON1 ) )
{
/* don't let Module::handle eat our click */
return Fl_Group::handle( m );
r = Fl_Group::handle( m );
}
return Module::handle( m );
return Module::handle( m ) || r;
}
}



Loading…
Cancel
Save