docstr: Convert the position of a GTK event, or of the current cursor position
  if *event* is None, to Matplotlib coordinates.
  
  GTK use logical pixels, but the figure is scaled to physical pixels for
  rendering.  Transform to physical pixels so that all of the down-stream
  transforms work as expected.
  
  Also, the origin is different and needs to be corrected.
docstr_tok: ["Convert","the","position","of","a","GTK","event",",","or","of","the","current","cursor","position","if","*","event","*","is","None",",","to","Matplotlib","coordinates",".","GTK","use","logical","pixels",",","but","the","figure","is","scaled","to","physical","pixels","for","rendering",".","Transform","to","physical","pixels","so","that","all","of","the","down-stream","transforms","work","as","expected",".","Also",",","the","origin","is","different","and","needs","to","be","corrected","."]
code: def _mpl_coords(self, event=None):
      """
      Convert the position of a GTK event, or of the current cursor position
      if *event* is None, to Matplotlib coordinates.
  
      GTK use logical pixels, but the figure is scaled to physical pixels for
      rendering.  Transform to physical pixels so that all of the down-stream
      transforms work as expected.
  
      Also, the origin is different and needs to be corrected.
      """
      if event is None:
          window = self.get_window()
          t, x, y, state = window.get_device_position(
              window.get_display()
              .get_device_manager()
              .get_client_pointer()
          )
      else:
          x, y = event.x, event.y
      x = x * self.device_pixel_ratio
      # flip y so y=0 is bottom of canvas
      y = self.figure.bbox.height - y * self.device_pixel_ratio
      return x, y
  
imports: import functools
  import logging
  import os
  from pathlib import Path
  import matplotlib
  from matplotlib import _api, backend_tools, cbook
  from matplotlib.backend_bases import ToolContainerBase, CloseEvent, KeyEvent, LocationEvent, MouseEvent, ResizeEvent
  from gi.repository import Gio, GLib, GObject, Gtk, Gdk
  from .None import _backend_gtk
  from ._backend_gtk import _BackendGTK, _FigureCanvasGTK, _FigureManagerGTK, _NavigationToolbar2GTK, TimerGTK
label_desc: Use image node_id 4 for calling the FigureCanvasGTK3 obj's underlying member method code with example usage: obj._mpl_coords(event) and returns: x,  y