### Function

# GimpUi widget_track_monitor

since: 2.10

#### Declaration [src]

    void
    gimp_widget_track_monitor (
      GtkWidget* widget,
      GCallback monitor_changed_callback,
      gpointer user_data,
      GDestroyNotify user_data_destroy
    )

#### Description [src]

This function behaves as if `GtkWidget` had a signal

GtkWidget::monitor_changed(GtkWidget *widget, gpointer user_data)

That is emitted whenever `widget`‘s toplevel window is moved from one monitor to another. This function automatically connects to the right toplevel `GtkWindow`, even across moving `widget` between toplevel windows.

Note that this function tracks the toplevel, not `widget` itself, so all a window’s widgets are always considered to be on the same monitor. This is because this function is mainly used for fetching the new monitor’s color profile, and it makes little sense to use different profiles for the widgets of one window.

Available since: 2.10

#### Parameters

`widget`

  Type: `GtkWidget`

  A `GtkWidget`.

  The data is owned by the caller of the function.

`monitor_changed_callback`

  Type: `GCallback`

  The callback when `widget`‘s monitor changes.

`user_data`

  Type: `gpointer`

  Data passed to `monitor_changed_callback`.

  The argument can be `NULL`.
  The data is owned by the caller of the function.

`user_data_destroy`

  Type: `GDestroyNotify`

  Destroy function for `user_data`.