Browse Source

Fix corner case in monitor index calculation

Fix a bug in the comparison function that could result in the wrong
index being assigned to a monitor. Change the logic to more directly map
to the description.
tags/v1.12.90
Pierre Ossman 2 years ago
parent
commit
72d632673b
1 changed files with 6 additions and 4 deletions
  1. 6
    4
      vncviewer/MonitorIndicesParameter.cxx

+ 6
- 4
vncviewer/MonitorIndicesParameter.cxx View File

@@ -243,12 +243,14 @@ int MonitorIndicesParameter::compare(const void *a, const void *b)
if (monitor1->x < monitor2->x)
return -1;

if (monitor1->x > monitor2->x)
return 1;

if (monitor1->y < monitor2->y)
return -1;

if (monitor1->x == monitor2->x)
if (monitor1->y == monitor2->y)
return 0;
if (monitor1->y > monitor2->y)
return 1;

return 1;
return 0;
}

Loading…
Cancel
Save