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.
This commit is contained in:
crs 2002-06-11 18:31:06 +00:00
parent fba8063c17
commit 88490de5a2
1 changed files with 4 additions and 1 deletions

View File

@ -890,6 +890,9 @@ CServer::getNeighbor(
// get the first neighbor // get the first neighbor
CScreenInfo* lastGoodScreen = src; CScreenInfo* lastGoodScreen = src;
CScreenInfo* dst = getNeighbor(src, srcSide); CScreenInfo* dst = getNeighbor(src, srcSide);
if (dst == NULL) {
return NULL;
}
// get the source screen's size (needed for kRight and kBottom) // get the source screen's size (needed for kRight and kBottom)
SInt32 w = src->m_width, h = src->m_height; 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) // find destination screen, adjusting x or y (but not both)
switch (srcSide) { switch (srcSide) {
case CConfig::kLeft: case CConfig::kLeft:
while (dst != NULL) { while (dst != NULL && dst != lastGoodScreen) {
lastGoodScreen = dst; lastGoodScreen = dst;
w = lastGoodScreen->m_width; w = lastGoodScreen->m_width;
h = lastGoodScreen->m_height; h = lastGoodScreen->m_height;