This saves callers some trouble with identifying which monitor is primary.
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/winex11.drv/xinerama.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/dlls/winex11.drv/xinerama.c b/dlls/winex11.drv/xinerama.c index 739b139736..42bf34cc46 100644 --- a/dlls/winex11.drv/xinerama.c +++ b/dlls/winex11.drv/xinerama.c @@ -128,6 +128,7 @@ static int query_screens(void) int i, count, event_base, error_base; XineramaScreenInfo *screens; RECT rc_work = {0, 0, 0, 0}; + INT primary_index;
if (!monitors) /* first time around */ load_xinerama(); @@ -157,6 +158,18 @@ static int query_screens(void) }
get_primary()->dwFlags |= MONITORINFOF_PRIMARY; + + /* Make primary monitor always the first one */ + primary_index = primary_monitor; + if (primary_index >= nb_monitors) + primary_index = 0; + + if (primary_index) + { + MONITORINFOEXW tmp = monitors[0]; + monitors[0] = monitors[i]; + monitors[i] = tmp; + } } else count = 0;
Zhiyi Zhang zzhang@codeweavers.com writes:
This saves callers some trouble with identifying which monitor is primary.
Why do you need that? And isn't that going to break referencing monitors by index?
On 4/8/19 8:12 PM, Alexandre Julliard wrote:
Zhiyi Zhang zzhang@codeweavers.com writes:
This saves callers some trouble with identifying which monitor is primary.
Why do you need that? And isn't that going to break referencing monitors by index?
This is not neccessary. Reporting primary first can be deferred to later patches. I see how it breaks. Thank for review. I will send a new version.