xwayland: Do not retry the same display

Merged Olivier Fourdan requested to merge ofourdan/mutter:optimize-display-search into master

Mutter listens to two display connections, one for regular X11 clients and another one for the so called "managed services".

Once an available display number is found for the regular X11 clients, mutter would then redo the work to find another available display number for the managed services.

Yet, it does so starting from the same initial display, which is a waste of time since it just tried all displays to find the first available one, so all these, including the regular display it just took, are now in use.

So instead of starting over from the beginning when looking for a display available for the managed services, continue from the next display immediately after the one we found precedently.

Merge request reports