From 72b4adfd2f84fb253b4c19b58a8858e4682c5445 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Fri, 20 Jul 2012 14:11:26 +0000 Subject: [PATCH] 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 --- vncviewer/DesktopWindow.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vncviewer/DesktopWindow.cxx b/vncviewer/DesktopWindow.cxx index 829d3dbe..0431e04b 100644 --- a/vncviewer/DesktopWindow.cxx +++ b/vncviewer/DesktopWindow.cxx @@ -546,6 +546,11 @@ void DesktopWindow::remoteResize() 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 -- 2.39.5