workspace: Don't keep state given logical monitor indices

Don't store logical monitor specific state in an array where the index
from the monitor manager is used as index locally. Instead just use
table associating a logical monitor with a monitor specific state
holder, and store the state in there. This way we don't have the
workspace implementation relying on implementation details of other
units.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
This commit is contained in:
Jonas Ådahl
2016-12-02 17:39:01 +08:00
parent 6de3e4a07e
commit 68f3b5849a
3 changed files with 96 additions and 65 deletions

View File

@ -410,8 +410,7 @@ setup_constraint_info (ConstraintInfo *info,
info->usable_screen_region =
meta_workspace_get_onscreen_region (cur_workspace);
info->usable_monitor_region =
meta_workspace_get_onmonitor_region (cur_workspace,
logical_monitor->number);
meta_workspace_get_onmonitor_region (cur_workspace, logical_monitor);
/* Log all this information for debugging */
meta_topic (META_DEBUG_GEOMETRY,
@ -496,8 +495,7 @@ place_window_if_needed(MetaWindow *window,
&info->work_area_monitor);
cur_workspace = window->screen->active_workspace;
info->usable_monitor_region =
meta_workspace_get_onmonitor_region (cur_workspace,
logical_monitor->number);
meta_workspace_get_onmonitor_region (cur_workspace, logical_monitor);
info->current.x = placed_rect.x;
info->current.y = placed_rect.y;