Put logical monitor grid lookup API in MetaMonitorManager

Don't falsely assume the screen has anything to do with the monitor
grid, and thus move the related API to MetaMonitorManager.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
This commit is contained in:
Jonas Ådahl
2016-11-30 10:49:00 +08:00
parent 9337d18468
commit 2df4ebff47
6 changed files with 36 additions and 39 deletions

View File

@ -5633,6 +5633,9 @@ update_move (MetaWindow *window,
!META_WINDOW_MAXIMIZED (window) &&
!META_WINDOW_TILED_SIDE_BY_SIDE (window))
{
MetaBackend *backend = meta_get_backend ();
MetaMonitorManager *monitor_manager =
meta_backend_get_monitor_manager (backend);
const MetaLogicalMonitor *monitor;
MetaRectangle work_area;
@ -5649,8 +5652,8 @@ update_move (MetaWindow *window,
* refers to the monitor which contains the largest part of the window,
* the latter to the one where the pointer is located.
*/
monitor = meta_screen_get_current_logical_monitor_for_pos (window->screen,
x, y);
monitor = meta_monitor_manager_get_logical_monitor_at (monitor_manager,
x, y);
meta_window_get_work_area_for_monitor (window,
monitor->number,
&work_area);