screen: Add an introspectible wrapper for find_monitor_for_rect

Instead of returning a MonitorInfo, it returns a monitor index.

https://bugzilla.gnome.org/show_bug.cgi?id=692679
This commit is contained in:
Jasper St. Pierre 2013-01-27 23:39:12 -05:00
parent 093e101252
commit 32b7743735
2 changed files with 12 additions and 0 deletions

View File

@ -2040,6 +2040,14 @@ meta_screen_get_monitor_for_window (MetaScreen *screen,
return meta_screen_get_monitor_for_rect (screen, &window_rect); return meta_screen_get_monitor_for_rect (screen, &window_rect);
} }
int
meta_screen_get_monitor_index_for_rect (MetaScreen *screen,
MetaRectangle *rect)
{
const MetaMonitorInfo *monitor = meta_screen_get_monitor_for_rect (screen, rect);
return monitor->number;
}
const MetaMonitorInfo* const MetaMonitorInfo*
meta_screen_get_monitor_neighbor (MetaScreen *screen, meta_screen_get_monitor_neighbor (MetaScreen *screen,
int which_monitor, int which_monitor,

View File

@ -81,6 +81,10 @@ int meta_screen_get_current_monitor (MetaScreen *screen);
void meta_screen_get_monitor_geometry (MetaScreen *screen, void meta_screen_get_monitor_geometry (MetaScreen *screen,
int monitor, int monitor,
MetaRectangle *geometry); MetaRectangle *geometry);
int meta_screen_get_monitor_index_for_rect (MetaScreen *screen,
MetaRectangle *rect);
void meta_screen_focus_default_window (MetaScreen *screen, void meta_screen_focus_default_window (MetaScreen *screen,
guint32 timestamp); guint32 timestamp);