gtk4 does not send absolute coordinates in monitor to IM clients but relative coordinates in workarea
To reproduce:
- Run
env GTK_IM_MODULE=wayland gtk4-demo
in GNOME Wayland and play GtkEntry
In GTK4, GtkIMContextWayland calculates the relative coordinates in the workarea using gtk_widget_translate_coordinates() and calls zwp_text_input_v3_set_cursor_rectangle()
rect.y seems to be a relative coordinate and exclude the height of gnome-shell's top panel.
In GTK3, GtkIMContextWayland can calculate the absolute coordinates in the monitor using gdk_window_get_root_coords() and calls zwp_text_input_v3_set_cursor_rectangle()
gnome-shell does not locate the right position of the IM candidate window using clutter_input_method_set_cursor_location() from GtkIMContextWayland in GTK4.
The problem also effects IBus with gtk_im_context_set_cursor_location().