Skip to content
Snippets Groups Projects
Commit 1cc8edd5 authored by Dridi Boukelmoune's avatar Dridi Boukelmoune Committed by Olivier Fourdan
Browse files

common: Add a xfwm_monitor_is_primary function


It's a shorthand for gdk_monitor_is_primary when working from a screen.

Signed-off-by: default avatarDridi Boukelmoune <dridi@fedoraproject.org>
parent ec3b1b12
No related branches found
No related tags found
1 merge request!3tabwin: Comply with the primary monitor setting
......@@ -173,6 +173,25 @@ xfwm_get_primary_refresh_rate (GdkScreen *screen)
gboolean
xfwm_monitor_is_primary (GdkScreen *screen,
gint monitor_num)
{
#if GTK_CHECK_VERSION(3, 22, 0)
GdkDisplay *display;
GdkMonitor *monitor;
display = gdk_screen_get_display (screen);
monitor = gdk_display_get_monitor (display, monitor_num);
return gdk_monitor_is_primary (monitor);
#else
return gdk_screen_get_primary_monitor (screen) == monitor_num;
#endif
}
gint
xfwm_get_n_monitors (GdkScreen *screen)
{
......
......@@ -40,6 +40,9 @@ gboolean xfwm_get_primary_monitor_geometry (GdkScreen *screen,
gint xfwm_get_primary_refresh_rate (GdkScreen *screen);
gboolean xfwm_monitor_is_primary (GdkScreen *screen,
gint monitor_num);
gint xfwm_get_n_monitors (GdkScreen *screen);
gchar *xfwm_make_display_name (GdkScreen *screen);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment