diff --git a/src/core/screen-private.h b/src/core/screen-private.h index d3667d628..2e26a9efb 100644 --- a/src/core/screen-private.h +++ b/src/core/screen-private.h @@ -153,9 +153,6 @@ const MetaMonitorInfo* meta_screen_get_monitor_for_point (MetaScreen *screen, const MetaMonitorInfo* meta_screen_get_monitor_neighbor (MetaScreen *screen, int which_monitor, 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_names (MetaScreen *screen); diff --git a/src/core/screen.c b/src/core/screen.c index b8ac22f76..0da4a02a9 100644 --- a/src/core/screen.c +++ b/src/core/screen.c @@ -1513,101 +1513,6 @@ meta_screen_get_monitor_neighbor_index (MetaScreen *screen, 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* meta_screen_get_current_monitor_info (MetaScreen *screen) {