now allowing a screen to be its own neighbor to allow wrapping.
also no longer warping mouse to 0,0 when setting server screen info. that was causing the mouse to jump if the server screen had itself as its left or top neighbor (directly or indirectly) once a screen could be its own neighbor.
This commit is contained in:
parent
2ea3d66112
commit
172fc7e5b3
|
@ -111,7 +111,9 @@ void CMSWindowsPrimaryScreen::open(CServer* server)
|
||||||
// send screen info
|
// send screen info
|
||||||
SInt32 w, h;
|
SInt32 w, h;
|
||||||
getScreenSize(&w, &h);
|
getScreenSize(&w, &h);
|
||||||
m_server->setInfo(w, h, getJumpZoneSize(), 0, 0);
|
POINT pos;
|
||||||
|
GetCursorPos(&pos);
|
||||||
|
m_server->setInfo(w, h, getJumpZoneSize(), pos.x, pos.y);
|
||||||
|
|
||||||
// compute center pixel of screen
|
// compute center pixel of screen
|
||||||
m_xCenter = w >> 1;
|
m_xCenter = w >> 1;
|
||||||
|
|
|
@ -894,9 +894,11 @@ CServer::CScreenInfo* CServer::getNeighbor(CScreenInfo* src,
|
||||||
}
|
}
|
||||||
assert(lastGoodScreen != NULL);
|
assert(lastGoodScreen != NULL);
|
||||||
|
|
||||||
|
/* allow screen to be it's own neighbor to allow wrapping
|
||||||
// no neighbor if best neighbor is the source itself
|
// no neighbor if best neighbor is the source itself
|
||||||
if (lastGoodScreen == src)
|
if (lastGoodScreen == src)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
*/
|
||||||
|
|
||||||
// if entering primary screen then be sure to move in far enough
|
// if entering primary screen then be sure to move in far enough
|
||||||
// to avoid the jump zone. if entering a side that doesn't have
|
// to avoid the jump zone. if entering a side that doesn't have
|
||||||
|
|
|
@ -202,16 +202,30 @@ void CXWindowsPrimaryScreen::open(CServer* server)
|
||||||
// m_numLockHalfDuplex = true;
|
// m_numLockHalfDuplex = true;
|
||||||
// m_capsLockHalfDuplex = true;
|
// m_capsLockHalfDuplex = true;
|
||||||
|
|
||||||
// update key state
|
// get screen size
|
||||||
|
SInt32 w, h;
|
||||||
|
getScreenSize(&w, &h);
|
||||||
|
|
||||||
|
int x, y;
|
||||||
{
|
{
|
||||||
CDisplayLock display(this);
|
CDisplayLock display(this);
|
||||||
|
|
||||||
|
// update key state
|
||||||
updateModifierMap(display);
|
updateModifierMap(display);
|
||||||
|
|
||||||
|
// get mouse position
|
||||||
|
Window root, window;
|
||||||
|
int xWindow, yWindow;
|
||||||
|
unsigned int mask;
|
||||||
|
if (!XQueryPointer(display, m_window, &root, &window,
|
||||||
|
&x, &y, &xWindow, &yWindow, &mask)) {
|
||||||
|
x = w >> 1;
|
||||||
|
y = h >> 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// send screen info
|
// send screen info
|
||||||
SInt32 w, h;
|
m_server->setInfo(w, h, getJumpZoneSize(), x, y);
|
||||||
getScreenSize(&w, &h);
|
|
||||||
m_server->setInfo(w, h, getJumpZoneSize(), 0, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CXWindowsPrimaryScreen::close()
|
void CXWindowsPrimaryScreen::close()
|
||||||
|
|
Loading…
Reference in New Issue