1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-25 23:11:33 +02:00

eeshow/gui.c (button_press_event): filter out double-click

That tripped an assertion in gui-aoi.c
This commit is contained in:
Werner Almesberger 2016-08-16 00:19:51 -03:00
parent 0d975a57d0
commit 0119b82340

View File

@ -777,6 +777,9 @@ static bool go_next_sheet(struct gui_ctx *ctx)
/* ----- Event handlers ---------------------------------------------------- */
static bool botton_1_down = 0;
static gboolean motion_notify_event(GtkWidget *widget, GdkEventMotion *event,
gpointer data)
{
@ -812,6 +815,14 @@ static gboolean button_press_event(GtkWidget *widget, GdkEventButton *event,
switch (event->button) {
case 1:
/*
* Double-click is sent as down-down-up, confusing the AoI
* logic that assumes each "down" to have a matching "up".
*/
if (botton_1_down)
return TRUE;
botton_1_down = 1;
if (aoi_down(ctx->aois, event->x, event->y))
break;
if (aoi_down(curr_sheet->aois,
@ -843,6 +854,8 @@ static gboolean button_release_event(GtkWidget *widget, GdkEventButton *event,
switch (event->button) {
case 1:
botton_1_down = 0;
if (aoi_up(ctx->aois, event->x, event->y))
break;
if (aoi_up(curr_sheet->aois,