monitor: Add API to query suggested position

Adds an API to get the position suggested by the backend. This
translates to position advertised by some VM:s, used to hint at a
position making the position more natural (i.e. placed similarly to how
it may be placed on the host desktop).

https://bugzilla.gnome.org/show_bug.cgi?id=777732
This commit is contained in:
Jonas Ådahl 2017-01-09 15:35:03 +08:00
parent 644ee666f6
commit f607b03456
2 changed files with 21 additions and 0 deletions

View File

@ -362,6 +362,23 @@ meta_monitor_tiled_get_tile_group_id (MetaMonitorTiled *monitor_tiled)
return monitor_tiled->tile_group_id;
}
gboolean
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;
}
static void
add_tiled_monitor_outputs (MetaMonitorManager *monitor_manager,
MetaMonitorTiled *monitor_tiled)

View File

@ -115,6 +115,10 @@ const char * meta_monitor_get_serial (MetaMonitor *monitor);
uint32_t meta_monitor_tiled_get_tile_group_id (MetaMonitorTiled *monitor_tiled);
gboolean meta_monitor_get_suggested_position (MetaMonitor *monitor,
int *x,
int *y);
MetaLogicalMonitor * meta_monitor_get_logical_monitor (MetaMonitor *monitor);
MetaMonitorMode * meta_monitor_get_mode_from_spec (MetaMonitor *monitor,