Handle primary_monitor_first correctly at startup (issue #613)

This commit is contained in:
o9000 2016-12-18 11:34:22 +01:00
parent cd76bd311d
commit 17beb40283
3 changed files with 9 additions and 0 deletions

View file

@ -302,6 +302,11 @@ int monitor_includes_monitor(const void *monitor1, const void *monitor2)
} }
} }
void sort_monitors()
{
qsort(server.monitors, server.num_monitors, sizeof(Monitor), compare_monitor_pos);
}
void get_monitors() void get_monitors()
{ {
if (XineramaIsActive(server.display)) { if (XineramaIsActive(server.display)) {

View file

@ -159,6 +159,7 @@ void get_root_pixmap();
// detect monitors and desktops // detect monitors and desktops
void get_monitors(); void get_monitors();
void sort_monitors();
void print_monitors(); void print_monitors();
void get_desktops(); void get_desktops();
void server_get_number_of_desktops(); void server_get_number_of_desktops();

View file

@ -547,6 +547,9 @@ void init_X11_pre_config()
void init_X11_post_config() void init_X11_post_config()
{ {
if (primary_monitor_first)
sort_monitors();
server_init_visual(); server_init_visual();
gboolean need_sigchld = FALSE; gboolean need_sigchld = FALSE;