Permalink
Browse files

Fix for GLUI_List double-click callback

  • Loading branch information...
nigels-com committed Oct 2, 2017
1 parent 6358144 commit ad0f3a89694079cd145dbc0b9b49f8a7507162d6
Showing with 4 additions and 3 deletions.
  1. +2 −2 glui_list.cpp
  2. +2 −1 include/GL/glui.h
View
@@ -102,7 +102,7 @@ void GLUI_List::common_construct(
int GLUI_List::mouse_down_handler( int local_x, int local_y )
{
int tmp_line;
unsigned long int ms;
uint64_t ms;
timeb time;
ftime(&time);
ms = time.millitm + (time.time)*1000;
@@ -126,7 +126,7 @@ int GLUI_List::mouse_down_handler( int local_x, int local_y )
obj_cb(this);
}
} else {
if (last_line == curr_line && (ms - last_click_time) < 300) {
if (last_line == curr_line && last_click_time && (ms - last_click_time) < 300) {
//obj_cb(associated_object, user_id);
obj_cb(this);
} else {
View
@@ -44,6 +44,7 @@
#include <cstdlib>
#include <cstdio>
#include <cstdint>
#include <cstring>
#include <array>
@@ -2031,7 +2032,7 @@ class GLUIAPI GLUI_List : public GLUI_Control
GLUI_CB obj_cb;
int cb_click_type;
int last_line;
int last_click_time;
uint64_t last_click_time;
int mouse_down_handler( int local_x, int local_y ) override;
int mouse_up_handler( int local_x, int local_y, bool inside ) override;

0 comments on commit ad0f3a8

Please sign in to comment.