diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-01-30 21:01:24 +0100 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-01-30 21:33:37 +0100 |
commit | a46f9af1c0f321cbaafc0383bf50e4f6a1d47c94 (patch) | |
tree | a9b1f430e9e7c5f5f6c41dc827b2bf14b48f3555 /gdk/x11/gdkdisplay-x11.c | |
parent | 99c89d61e18d63f1141b8dfb423c3971f4b66c9a (diff) | |
download | gtk+-a46f9af1c0f321cbaafc0383bf50e4f6a1d47c94.tar.gz |
Remove primary monitor api
We only have implementations of this on X11 and Win32,
so make it available as backend api there.
Update all callers to use either the backend api, or
just monitor 0.
Diffstat (limited to 'gdk/x11/gdkdisplay-x11.c')
-rw-r--r-- | gdk/x11/gdkdisplay-x11.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c index fdfbecbf7c..b758d197e5 100644 --- a/gdk/x11/gdkdisplay-x11.c +++ b/gdk/x11/gdkdisplay-x11.c @@ -2956,7 +2956,25 @@ gdk_x11_display_get_monitor (GdkDisplay *display, return NULL; } -static GdkMonitor * +/** + * gdk_x11_display_get_primary_monitor: + * @display: a #GdkDisplay + * + * Gets the primary monitor for the display. + * + * The primary monitor is considered the monitor where the “main desktop” + * lives. While normal application surfaces typically allow the window + * manager to place the surfaces, specialized desktop applications + * such as panels should place themselves on the primary monitor. + * + * If no monitor is the designated primary monitor, any monitor + * (usually the first) may be returned. To make sure there is a dedicated + * primary monitor, use gdk_monitor_is_primary() on the returned monitor. + * + * Returns: (transfer none): the primary monitor, or any monitor if no + * primary monitor is configured by the user + */ +GdkMonitor * gdk_x11_display_get_primary_monitor (GdkDisplay *display) { GdkX11Display *x11_display = GDK_X11_DISPLAY (display); @@ -3062,7 +3080,6 @@ gdk_x11_display_class_init (GdkX11DisplayClass * class) display_class->get_n_monitors = gdk_x11_display_get_n_monitors; display_class->get_monitor = gdk_x11_display_get_monitor; - display_class->get_primary_monitor = gdk_x11_display_get_primary_monitor; display_class->get_setting = gdk_x11_display_get_setting; display_class->get_last_seen_time = gdk_x11_display_get_last_seen_time; display_class->set_cursor_theme = gdk_x11_display_set_cursor_theme; |