Merge branch 'wip/carlosg/im-text-location' into 'main'

gtkimcontextwayland: Add native surface offset to input coordinates

Closes #4668

See merge request GNOME/gtk!4573
This commit is contained in:
Matthias Clasen 2022-03-16 11:54:26 +00:00
commit df593ee651

View File

@ -357,7 +357,7 @@ notify_cursor_location (GtkIMContextWayland *context)
{
GtkIMContextWaylandGlobal *global;
cairo_rectangle_int_t rect;
double x, y;
double x, y, sx, sy;
global = gtk_im_context_wayland_get_global (context);
if (global == NULL)
@ -369,8 +369,11 @@ notify_cursor_location (GtkIMContextWayland *context)
rect.x, rect.y,
&x, &y);
rect.x = x;
rect.y = y;
gtk_native_get_surface_transform (gtk_widget_get_native (context->widget),
&sx, &sy);
rect.x = x + sx;
rect.y = y + sy;
zwp_text_input_v3_set_cursor_rectangle (global->text_input,
rect.x, rect.y,
rect.width, rect.height);