window: Keep track of fullscreen monitors directly

Instead of keeping around array indexes, keep track of them by storing
a pointer instead. This also changes from using an array (imitating the
X11 behaviour) to more explicit storing.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
This commit is contained in:
Jonas Ådahl
2016-11-29 17:50:17 +08:00
parent 0a4fb008f3
commit ecf796f82b
6 changed files with 93 additions and 93 deletions

View File

@ -384,31 +384,22 @@ setup_constraint_info (ConstraintInfo *info,
logical_monitor->number,
&info->work_area_monitor);
if (!window->fullscreen || window->fullscreen_monitors[0] == -1)
if (!window->fullscreen || !meta_window_has_fullscreen_monitors (window))
{
info->entire_monitor = logical_monitor->rect;
}
else
{
MetaBackend *backend = meta_get_backend ();
MetaMonitorManager *monitor_manager =
meta_backend_get_monitor_manager (backend);
MetaLogicalMonitor *logical_monitors;
int i = 0;
long monitor;
logical_monitors =
meta_monitor_manager_get_logical_monitors (monitor_manager, NULL);
monitor = window->fullscreen_monitors[i];
info->entire_monitor = logical_monitors[monitor].rect;
for (i = 1; i <= 3; i++)
{
monitor = window->fullscreen_monitors[i];
meta_rectangle_union (&info->entire_monitor,
&logical_monitors[monitor].rect,
&info->entire_monitor);
}
info->entire_monitor = window->fullscreen_monitors.top->rect;
meta_rectangle_union (&info->entire_monitor,
&window->fullscreen_monitors.bottom->rect,
&info->entire_monitor);
meta_rectangle_union (&info->entire_monitor,
&window->fullscreen_monitors.left->rect,
&info->entire_monitor);
meta_rectangle_union (&info->entire_monitor,
&window->fullscreen_monitors.right->rect,
&info->entire_monitor);
}
cur_workspace = window->screen->active_workspace;