We can end up with no screens in some cases. Make sure we at least have a
dummy one when that happens.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4947 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/vncviewer/DesktopWindow.cxx b/vncviewer/DesktopWindow.cxx
index 829d3db..0431e04 100644
--- a/vncviewer/DesktopWindow.cxx
+++ b/vncviewer/DesktopWindow.cxx
@@ -546,6 +546,11 @@
 
       layout.add_screen(rfb::Screen(id, sx, sy, sw, sh, 0));
     }
+
+    // If the viewport doesn't match a physical screen, then we might
+    // end up with no screens in the layout. Add a fake one...
+    if (layout.num_screens() == 0)
+      layout.add_screen(rfb::Screen(0, 0, 0, width, height, 0));
   }
 #endif