diff --git a/server/CMSWindowsPrimaryScreen.cpp b/server/CMSWindowsPrimaryScreen.cpp index cc83079a..b85c6909 100644 --- a/server/CMSWindowsPrimaryScreen.cpp +++ b/server/CMSWindowsPrimaryScreen.cpp @@ -111,7 +111,9 @@ void CMSWindowsPrimaryScreen::open(CServer* server) // send screen info SInt32 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 m_xCenter = w >> 1; diff --git a/server/CServer.cpp b/server/CServer.cpp index bd09ce74..dfaa86da 100644 --- a/server/CServer.cpp +++ b/server/CServer.cpp @@ -894,9 +894,11 @@ CServer::CScreenInfo* CServer::getNeighbor(CScreenInfo* src, } assert(lastGoodScreen != NULL); +/* allow screen to be it's own neighbor to allow wrapping // no neighbor if best neighbor is the source itself if (lastGoodScreen == src) return NULL; +*/ // 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 diff --git a/server/CXWindowsPrimaryScreen.cpp b/server/CXWindowsPrimaryScreen.cpp index 9012e089..52297109 100644 --- a/server/CXWindowsPrimaryScreen.cpp +++ b/server/CXWindowsPrimaryScreen.cpp @@ -202,16 +202,30 @@ void CXWindowsPrimaryScreen::open(CServer* server) // m_numLockHalfDuplex = true; // m_capsLockHalfDuplex = true; - // update key state + // get screen size + SInt32 w, h; + getScreenSize(&w, &h); + + int x, y; { CDisplayLock display(this); + + // update key state 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 - SInt32 w, h; - getScreenSize(&w, &h); - m_server->setInfo(w, h, getJumpZoneSize(), 0, 0); + m_server->setInfo(w, h, getJumpZoneSize(), x, y); } void CXWindowsPrimaryScreen::close()