Gtk.Widget.prototype.translate_coordinates

function translate_coordinates(dest_widget:Gtk.Widget, src_x:Number, src_y:Number):Boolean {
    // Gjs wrapper for gtk_widget_translate_coordinates()
}

Translate coordinates relative to src_widget's allocation to coordinates relative to dest_widget's allocations. In order to perform this operation, both widgets must be realized, and must share a common toplevel.

dest_widget

a Gtk.Widget

src_x

X position relative to src_widget

src_y

Y position relative to src_widget

Returns

false if either widget was not realized, or there was no common ancestor. In this case, nothing is stored in *dest_x and *dest_y. Otherwise true.