app: sort present devices to the beginning of the device list

and make sure the core pointer is always first in the list.
This commit is contained in:
Michael Natterer 2010-12-09 22:02:24 +01:00
parent 6e2d56a9b8
commit 9c98b0b804
1 changed files with 12 additions and 2 deletions

View File

@ -836,14 +836,24 @@ gint
gimp_device_info_compare (GimpDeviceInfo *a,
GimpDeviceInfo *b)
{
if (a->device && ! b->device)
if (a->device && a->display &&
a->device == gdk_display_get_core_pointer (a->display))
{
return -1;
}
else if (b->device && b->display &&
b->device == gdk_display_get_core_pointer (b->display))
{
return 1;
}
else if (! a->device && b->device)
else if (a->device && ! b->device)
{
return -1;
}
else if (! a->device && b->device)
{
return 1;
}
else
{
return gimp_object_name_collate ((GimpObject *) a,