Objects/bones in the selection menu weren't ordered usefully, worse, the closest items could be left out of the menu since items would stop being added once the menu-size limit was reached. Resolve this by sorting the menu items by depth, removing the most distant when the number of items exceeds the limit. When Ctrl is held, order by the distance to the object center instead of depth.