canvas: fix enter notify event handler to work with gtk ungrabs
GTK delivers both window and root coordinates as (0,0) for GDK_CROSSING_GTK_UNGRAB modes. We need the real coordinates of the pointer to pick the right canvas item
This commit is contained in:
@@ -1396,7 +1396,13 @@ GtkCanvas::on_touch_end_event (GdkEventTouch *ev)
|
||||
bool
|
||||
GtkCanvas::on_enter_notify_event (GdkEventCrossing* ev)
|
||||
{
|
||||
pick_current_item (Duple (ev->x, ev->y), ev->state);
|
||||
if (ev->mode == GDK_CROSSING_GTK_UNGRAB) {
|
||||
int px, py;
|
||||
get_pointer (px, py);
|
||||
pick_current_item (Duple (px, py), ev->state);
|
||||
} else {
|
||||
pick_current_item (Duple (ev->x, ev->y), ev->state);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user