changeset 20033:91e2212b060d

Fix FLTK SelectionType for Middle Button and double clicks (bug #44669). * __init_fltk__.cc (handle): Check event for FL_MIDDLE_BUTTON and return "extend" if found. Use Fl::event_clicks to check for double click before any other button processing and return "open" if found.
author Rik <rik@octave.org>
date Tue, 31 Mar 2015 11:18:46 -0700
parents abf348f41759
children 0376c1225660
files libinterp/dldfcn/__init_fltk__.cc
diffstat 1 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/dldfcn/__init_fltk__.cc	Mon Mar 30 20:31:11 2015 -0700
+++ b/libinterp/dldfcn/__init_fltk__.cc	Tue Mar 31 11:18:46 2015 -0700
@@ -1454,15 +1454,16 @@
 
               set_currentpoint (pos_x, pos_y);
 
-              if (Fl::event_button () == FL_LEFT_MOUSE
-                  && Fl::event_shift ())
+              if (Fl::event_clicks ())
+                fp.set_selectiontype ("open");
+              else if (Fl::event_button () == FL_MIDDLE_MOUSE
+                       || (Fl::event_button () == FL_LEFT_MOUSE
+                           && Fl::event_shift ()))
                 fp.set_selectiontype ("extend");
-              else if ((Fl::event_button () == FL_LEFT_MOUSE
-                        && Fl::event_ctrl ())
-                       || Fl::event_button () == FL_RIGHT_MOUSE)
+              else if (Fl::event_button () == FL_RIGHT_MOUSE
+                       || (Fl::event_button () == FL_LEFT_MOUSE
+                           && Fl::event_ctrl ()))
                 fp.set_selectiontype ("alt");
-              else if (Fl::event_clicks ())
-                fp.set_selectiontype ("open");
               else
                 fp.set_selectiontype ("normal");