diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-03-28 14:56:26 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-03-28 14:56:26 -0400 |
commit | 7b135c96e4d269384000fd3bf81f96333e95b3e6 (patch) | |
tree | 81f4d8d1d17a15c67d99931c8496dde4b4a70e1f /gtk/gtkcellarea.c | |
parent | e662438675b66c35d70f977e82885e9298e04a07 (diff) | |
download | gtk+-7b135c96e4d269384000fd3bf81f96333e95b3e6.tar.gz |
cellarea: Fix cell editing
We need to translate the event coordinates to
widget-relative coordinates. This broke when
we stopped translating event coordinates in-place.
Diffstat (limited to 'gtk/gtkcellarea.c')
-rw-r--r-- | gtk/gtkcellarea.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gtk/gtkcellarea.c b/gtk/gtkcellarea.c index 157c3bc5ed..a4351d14c3 100644 --- a/gtk/gtkcellarea.c +++ b/gtk/gtkcellarea.c @@ -1042,12 +1042,19 @@ gtk_cell_area_real_event (GtkCellArea *area, GtkCellRenderer *renderer = NULL; GtkCellRenderer *focus_renderer; GdkRectangle alloc_area; - gdouble event_x, event_y; + double event_x, event_y; + int x, y; + GtkNative *native; /* We may need some semantics to tell us the offset of the event * window we are handling events for (i.e. GtkTreeView has a bin_window) */ gdk_event_get_position (event, &event_x, &event_y); + native = gtk_widget_get_native (widget); + gtk_widget_translate_coordinates (GTK_WIDGET (native), widget, event_x, event_y, &x, &y); + event_x = x; + event_y = y; + /* Dont try to search for an event coordinate that is not in the area, that will * trigger a runtime warning. */ |