mirror of
https://github.com/debauchee/barrier.git
synced 2026-02-13 23:25:27 +08:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user