Select the correct output for new screens
For example, if we have earlier disabled an output because it was too
large for the framebuffer, we should prefer this output when
allocating new outputs.
Move the code that turn off unused outputs to the end.
Also, add support for checking the output connection state.
diff --git a/unix/common/RandrGlue.h b/unix/common/RandrGlue.h
index 43c9b68..8618119 100644
--- a/unix/common/RandrGlue.h
+++ b/unix/common/RandrGlue.h
@@ -45,6 +45,7 @@
int vncRandRIsOutputEnabled(int outputIdx);
int vncRandRIsOutputUsable(int outputIdx);
+int vncRandRIsOutputConnected(int outputIdx);
int vncRandRDisableOutput(int outputIdx);
int vncRandRReconfigureOutput(int outputIdx, int x, int y,