diff --git a/src/backends/meta-monitor.c b/src/backends/meta-monitor.c index af1287888..8310472ab 100644 --- a/src/backends/meta-monitor.c +++ b/src/backends/meta-monitor.c @@ -418,6 +418,23 @@ meta_monitor_normal_derive_dimensions (MetaMonitor *monitor, *height = output->crtc->rect.height; } +static gboolean +meta_monitor_normal_get_suggested_position (MetaMonitor *monitor, + int *x, + int *y) +{ + MetaOutput *output; + + output = meta_monitor_get_main_output (monitor); + if (output->suggested_x < 0 && output->suggested_y < 0) + return FALSE; + + *x = output->suggested_x; + *y = output->suggested_y; + + return TRUE; +} + static void meta_monitor_normal_calculate_crtc_pos (MetaMonitor *monitor, MetaMonitorMode *monitor_mode, @@ -443,6 +460,7 @@ meta_monitor_normal_class_init (MetaMonitorNormalClass *klass) monitor_class->get_main_output = meta_monitor_normal_get_main_output; monitor_class->derive_dimensions = meta_monitor_normal_derive_dimensions; monitor_class->calculate_crtc_pos = meta_monitor_normal_calculate_crtc_pos; + monitor_class->get_suggested_position = meta_monitor_normal_get_suggested_position; } uint32_t @@ -456,16 +474,8 @@ meta_monitor_get_suggested_position (MetaMonitor *monitor, int *x, int *y) { - MetaOutput *main_output; - - main_output = meta_monitor_get_main_output (monitor); - if (main_output->suggested_x < 0 && main_output->suggested_y < 0) - return FALSE; - - *x = main_output->suggested_x; - *y = main_output->suggested_y; - - return TRUE; + return META_MONITOR_GET_CLASS (monitor)->get_suggested_position (monitor, + x, y); } static void @@ -804,6 +814,14 @@ meta_monitor_tiled_derive_dimensions (MetaMonitor *monitor, *out_height = max_y - min_y; } +static gboolean +meta_monitor_tiled_get_suggested_position (MetaMonitor *monitor, + int *x, + int *y) +{ + return FALSE; +} + static void meta_monitor_tiled_calculate_crtc_pos (MetaMonitor *monitor, MetaMonitorMode *monitor_mode, @@ -854,6 +872,7 @@ meta_monitor_tiled_class_init (MetaMonitorTiledClass *klass) monitor_class->get_main_output = meta_monitor_tiled_get_main_output; monitor_class->derive_dimensions = meta_monitor_tiled_derive_dimensions; monitor_class->calculate_crtc_pos = meta_monitor_tiled_calculate_crtc_pos; + monitor_class->get_suggested_position = meta_monitor_tiled_get_suggested_position; } static void diff --git a/src/backends/meta-monitor.h b/src/backends/meta-monitor.h index e3adb6a7e..e1358e373 100644 --- a/src/backends/meta-monitor.h +++ b/src/backends/meta-monitor.h @@ -70,6 +70,9 @@ struct _MetaMonitorClass MetaMonitorTransform crtc_transform, int *out_x, int *out_y); + gboolean (* get_suggested_position) (MetaMonitor *monitor, + int *width, + int *height); }; #define META_TYPE_MONITOR_NORMAL (meta_monitor_normal_get_type ())