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/unixcommon.h b/unix/common/unixcommon.h
index 5f5c8d6..cd90f87 100644
--- a/unix/common/unixcommon.h
+++ b/unix/common/unixcommon.h
@@ -35,5 +35,11 @@
unsigned int setScreenLayout(int fb_width, int fb_height, const rfb::ScreenSet& layout,
OutputIdMap *outputIdMap);
+/*
+ * FIXME: This is only exposed because we still have logic in XDesktop
+ * that we haven't integrated in setScreenLayout()
+ */
+int getPreferredScreenOutput(OutputIdMap *outputIdMap,
+ const std::set<unsigned int>& disabledOutputs);
#endif /* UNIXCOMMON_H */