From 88490de5a25d172f9729c9887e2424db356861e8 Mon Sep 17 00:00:00 2001 From: crs Date: Tue, 11 Jun 2002 18:31:06 +0000 Subject: [PATCH] fixed bug with switching screens on primary when there's no link in that direction (it would assert). introduced bug when adding support for wrapping. now ignores attempts to move in a direction with no link. --- server/CServer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/CServer.cpp b/server/CServer.cpp index 3bbeef49..fb30944e 100644 --- a/server/CServer.cpp +++ b/server/CServer.cpp @@ -890,6 +890,9 @@ CServer::getNeighbor( // get the first neighbor CScreenInfo* lastGoodScreen = src; CScreenInfo* dst = getNeighbor(src, srcSide); + if (dst == NULL) { + return NULL; + } // get the source screen's size (needed for kRight and kBottom) SInt32 w = src->m_width, h = src->m_height; @@ -897,7 +900,7 @@ CServer::getNeighbor( // find destination screen, adjusting x or y (but not both) switch (srcSide) { case CConfig::kLeft: - while (dst != NULL) { + while (dst != NULL && dst != lastGoodScreen) { lastGoodScreen = dst; w = lastGoodScreen->m_width; h = lastGoodScreen->m_height;