mirror of
https://github.com/debauchee/barrier.git
synced 2024-11-23 20:12:39 +03:00
faked escape key down and up then a left mouse button up in CServer when isSwitchOkay return true.
removed the assertions in CScreen so server screen can fake input event as well.
This commit is contained in:
parent
f6ecf9322c
commit
57db3da6f3
@ -359,7 +359,6 @@ CMSWindowsScreen::leave()
|
||||
forceShowCursor();
|
||||
|
||||
if (m_draggingStarted) {
|
||||
fakeMouseButton(kButtonLeft, false);
|
||||
m_draggingStarted = false;
|
||||
}
|
||||
|
||||
|
@ -1741,6 +1741,11 @@ CServer::onMouseMovePrimary(SInt32 x, SInt32 y)
|
||||
// should we switch or not?
|
||||
if (isSwitchOkay(newScreen, dir, x, y, xc, yc)) {
|
||||
if (m_screen->getDraggingStarted() && m_active != newScreen) {
|
||||
// fake a escape key down and up then left mouse button up
|
||||
m_screen->keyDown(kKeyEscape, 8192, 1);
|
||||
m_screen->keyUp(kKeyEscape, 8192, 1);
|
||||
m_screen->mouseUp(kButtonLeft);
|
||||
|
||||
CString& dragFileList = m_screen->getDraggingFileDir();
|
||||
size_t size = dragFileList.size() + 1;
|
||||
char* fileList = new char[size];
|
||||
|
@ -186,8 +186,6 @@ CScreen::screensaver(bool activate)
|
||||
void
|
||||
CScreen::keyDown(KeyID id, KeyModifierMask mask, KeyButton button)
|
||||
{
|
||||
assert(!m_isPrimary || m_fakeInput);
|
||||
|
||||
// check for ctrl+alt+del emulation
|
||||
if (id == kKeyDelete &&
|
||||
(mask & (KeyModifierControl | KeyModifierAlt)) ==
|
||||
@ -211,21 +209,18 @@ CScreen::keyRepeat(KeyID id,
|
||||
void
|
||||
CScreen::keyUp(KeyID, KeyModifierMask, KeyButton button)
|
||||
{
|
||||
assert(!m_isPrimary || m_fakeInput);
|
||||
m_screen->fakeKeyUp(button);
|
||||
}
|
||||
|
||||
void
|
||||
CScreen::mouseDown(ButtonID button)
|
||||
{
|
||||
assert(!m_isPrimary);
|
||||
m_screen->fakeMouseButton(button, true);
|
||||
}
|
||||
|
||||
void
|
||||
CScreen::mouseUp(ButtonID button)
|
||||
{
|
||||
assert(!m_isPrimary);
|
||||
m_screen->fakeMouseButton(button, false);
|
||||
}
|
||||
|
||||
@ -372,16 +367,14 @@ CScreen::isLockedToScreen() const
|
||||
{
|
||||
// check for pressed mouse buttons
|
||||
// HACK: commented out as it breaks new drag drop feature
|
||||
// UInt32 buttonID = 0;
|
||||
// if (m_screen->isAnyMouseButtonDown(buttonID)) {
|
||||
// LOG((CLOG_DEBUG "locked by mouse buttonID: %d", buttonID));
|
||||
// if (buttonID == kButtonLeft) {
|
||||
// // TODO: fake esc key down and up
|
||||
// //m_screen->fakeMouseButton(buttonID, false);
|
||||
// }
|
||||
//
|
||||
// return (buttonID == kButtonLeft) ? false : true;
|
||||
// }
|
||||
UInt32 buttonID = 0;
|
||||
if (m_screen->isAnyMouseButtonDown(buttonID)) {
|
||||
if (buttonID != kButtonLeft) {
|
||||
LOG((CLOG_DEBUG "locked by mouse buttonID: %d", buttonID));
|
||||
}
|
||||
|
||||
return (buttonID == kButtonLeft) ? false : true;
|
||||
}
|
||||
|
||||
// not locked
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user