mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-11-17 21:03:43 +02:00
eeshow/gui/input.c (hover_update): handle a few more rare cases
This commit is contained in:
parent
aced11f9f2
commit
fe5bc4a55a
@ -104,7 +104,7 @@ static void hover_update(int x, int y)
|
||||
{
|
||||
const struct input *old_sp = sp;
|
||||
|
||||
assert(sp->state == input_hovering);
|
||||
assert(sp->state == input_hovering || sp->state == input_hovering_down);
|
||||
|
||||
if (!sp->ops->hover_update)
|
||||
return;
|
||||
@ -118,7 +118,23 @@ static void hover_update(int x, int y)
|
||||
if (sp != old_sp)
|
||||
return;
|
||||
|
||||
sp->state = sp->state == input_hovering ? input_idle : input_clicking;
|
||||
progress(3, "hover_update %s\n", state());
|
||||
|
||||
switch (sp->state) {
|
||||
case input_idle:
|
||||
case input_hovering:
|
||||
case input_ignoring:
|
||||
sp->state = input_idle;
|
||||
break;
|
||||
case input_clicking:
|
||||
case input_hovering_down:
|
||||
sp->state = input_clicking;
|
||||
break;
|
||||
case input_dragging:
|
||||
default:
|
||||
abort();
|
||||
}
|
||||
|
||||
if (sp->ops->hover_end)
|
||||
sp->ops->hover_end(sp->user);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user