mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 07:30:42 -05:00
input-mapper: Reverse sort order of display score comparator
The `guess_candidates()` function scores each display that an input
device could be mapped to and then uses the `sort_by_score()` comparator
to find the best option. The function expects the list to be sorted from
best to worst, but the comparator currently sorts them in the opposite
order. This causes the function to end up returning the _worst_ match
rather than the the best. This commit reverses the sort order of the
comparator so that the best display can be returned as intended.
Closes: #1889
(Cherry-picked from commit 64ff1f20f8
)
This commit is contained in:
parent
7f9defb444
commit
ad787c3cf7
@ -473,7 +473,7 @@ static int
|
|||||||
sort_by_score (DeviceMatch *match1,
|
sort_by_score (DeviceMatch *match1,
|
||||||
DeviceMatch *match2)
|
DeviceMatch *match2)
|
||||||
{
|
{
|
||||||
return (int) match1->score - match2->score;
|
return (int) match2->score - match1->score;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user