screen: Remove unused function

https://bugzilla.gnome.org/show_bug.cgi?id=777732
This commit is contained in:
Jonas Ådahl 2016-11-25 14:33:23 +08:00
parent 4177d4f9f4
commit e1b10769e5
2 changed files with 0 additions and 98 deletions

View File

@ -153,9 +153,6 @@ const MetaMonitorInfo* meta_screen_get_monitor_for_point (MetaScreen *screen,
const MetaMonitorInfo* meta_screen_get_monitor_neighbor (MetaScreen *screen, const MetaMonitorInfo* meta_screen_get_monitor_neighbor (MetaScreen *screen,
int which_monitor, int which_monitor,
MetaScreenDirection dir); MetaScreenDirection dir);
void meta_screen_get_natural_monitor_list (MetaScreen *screen,
int** monitors_list,
int* n_monitors);
void meta_screen_update_workspace_layout (MetaScreen *screen); void meta_screen_update_workspace_layout (MetaScreen *screen);
void meta_screen_update_workspace_names (MetaScreen *screen); void meta_screen_update_workspace_names (MetaScreen *screen);

View File

@ -1513,101 +1513,6 @@ meta_screen_get_monitor_neighbor_index (MetaScreen *screen,
return monitor ? monitor->number : -1; return monitor ? monitor->number : -1;
} }
void
meta_screen_get_natural_monitor_list (MetaScreen *screen,
int** monitors_list,
int* n_monitors)
{
const MetaMonitorInfo* current;
const MetaMonitorInfo* tmp;
GQueue* monitor_queue;
int* visited;
int cur = 0;
int i;
*n_monitors = screen->n_monitor_infos;
*monitors_list = g_new (int, screen->n_monitor_infos);
/* we calculate a natural ordering by which to choose monitors for
* window placement. We start at the current monitor, and perform
* a breadth-first search of the monitors starting from that
* monitor. We choose preferentially left, then right, then down,
* then up. The visitation order produced by this traversal is the
* natural monitor ordering.
*/
visited = g_new (int, screen->n_monitor_infos);
for (i = 0; i < screen->n_monitor_infos; i++)
{
visited[i] = FALSE;
}
current = meta_screen_get_current_monitor_info (screen);
monitor_queue = g_queue_new ();
g_queue_push_tail (monitor_queue, (gpointer) current);
visited[current->number] = TRUE;
while (!g_queue_is_empty (monitor_queue))
{
current = (const MetaMonitorInfo*)
g_queue_pop_head (monitor_queue);
(*monitors_list)[cur++] = current->number;
/* enqueue each of the directions */
tmp = meta_screen_get_monitor_neighbor (screen,
current->number,
META_SCREEN_LEFT);
if (tmp && !visited[tmp->number])
{
g_queue_push_tail (monitor_queue,
(MetaMonitorInfo*) tmp);
visited[tmp->number] = TRUE;
}
tmp = meta_screen_get_monitor_neighbor (screen,
current->number,
META_SCREEN_RIGHT);
if (tmp && !visited[tmp->number])
{
g_queue_push_tail (monitor_queue,
(MetaMonitorInfo*) tmp);
visited[tmp->number] = TRUE;
}
tmp = meta_screen_get_monitor_neighbor (screen,
current->number,
META_SCREEN_UP);
if (tmp && !visited[tmp->number])
{
g_queue_push_tail (monitor_queue,
(MetaMonitorInfo*) tmp);
visited[tmp->number] = TRUE;
}
tmp = meta_screen_get_monitor_neighbor (screen,
current->number,
META_SCREEN_DOWN);
if (tmp && !visited[tmp->number])
{
g_queue_push_tail (monitor_queue,
(MetaMonitorInfo*) tmp);
visited[tmp->number] = TRUE;
}
}
/* in case we somehow missed some set of monitors, go through the
* visited list and add in any monitors that were missed
*/
for (i = 0; i < screen->n_monitor_infos; i++)
{
if (visited[i] == FALSE)
{
(*monitors_list)[cur++] = i;
}
}
g_free (visited);
g_queue_free (monitor_queue);
}
const MetaMonitorInfo* const MetaMonitorInfo*
meta_screen_get_current_monitor_info (MetaScreen *screen) meta_screen_get_current_monitor_info (MetaScreen *screen)
{ {