mirror of
https://github.com/debauchee/barrier.git
synced 2025-07-25 20:38:46 +02:00
Fix high DPI breaking edge detection and mouse delta calculation #5030
This commit is contained in:
parent
66335cd6f8
commit
a09bfc5f07
4 changed files with 69 additions and 24 deletions
|
@ -33,6 +33,7 @@
|
|||
#include "synergy/KeyState.h"
|
||||
#include "synergy/Screen.h"
|
||||
#include "synergy/PacketStreamFilter.h"
|
||||
#include "synergy/DpiHelper.h"
|
||||
#include "net/TCPSocket.h"
|
||||
#include "net/IDataSocket.h"
|
||||
#include "net/IListenSocket.h"
|
||||
|
@ -2000,8 +2001,18 @@ Server::onMouseMoveSecondary(SInt32 dx, SInt32 dy)
|
|||
m_sendFileThread = NULL;
|
||||
}
|
||||
|
||||
SInt32 newX = m_x;
|
||||
SInt32 newY = m_y;
|
||||
|
||||
if (DpiHelper::s_dpiScaled) {
|
||||
// only scale if it's going back to server
|
||||
if (newScreen->isPrimary()) {
|
||||
newX = (SInt32)(newX / DpiHelper::getDpi());
|
||||
newY = (SInt32)(newY / DpiHelper::getDpi());
|
||||
}
|
||||
}
|
||||
// switch screens
|
||||
switchScreen(newScreen, m_x, m_y, false);
|
||||
switchScreen(newScreen, newX, newY, false);
|
||||
}
|
||||
else {
|
||||
// same screen. clamp mouse to edge.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue