mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
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:
parent
b292e5191c
commit
2eb1a31e16
1 changed files with 7 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue