mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-09 07:22:21 +08:00
Fixed several win32 bugs. First, synergy wasn't forwarding mouse
events to other hook functions, which broke some tools like objectbar. Second, windows key processing was fixed. Previously pressing and release the key would only send a press event, locking the user onto the client window; also, the win32 server treated as a Meta modifier instead of a Super modifier, which broke any use of it as any kind of modifier key. Third, added hacks to support several key combinations on windows 95/98/me that are treated specially by windows, including Alt+Tab, Alt+Shift+Tab, Alt+Esc, Alt+Shift+Esc, Ctrl+Esc, and any combination using the windows key like Win+E and Win+F but not Ctrl+Alt+Del. Fourth, scroll lock only locking to the client (which only happened when using a synergy server on windows) has been fixed; unfortunately the solution causes a lot of screen redraws for some reason. Finally, there's been a fix to clipboard handling that may or may not fix a problem where the clipboard would stop transferring between systems after a little while. I can't be sure if it fixes the problem because I can't reproduce the problem.
This commit is contained in:
@@ -21,6 +21,8 @@
|
||||
// CMSWindowsClipboard
|
||||
//
|
||||
|
||||
UINT CMSWindowsClipboard::s_ownershipFormat = 0;
|
||||
|
||||
CMSWindowsClipboard::CMSWindowsClipboard(HWND window) :
|
||||
m_window(window),
|
||||
m_time(0)
|
||||
@@ -40,11 +42,16 @@ CMSWindowsClipboard::empty()
|
||||
{
|
||||
LOG((CLOG_DEBUG "empty clipboard"));
|
||||
|
||||
// empty the clipboard (and take ownership)
|
||||
if (!EmptyClipboard()) {
|
||||
LOG((CLOG_DEBUG "failed to grab clipboard"));
|
||||
return false;
|
||||
}
|
||||
|
||||
// mark clipboard as being owned by synergy
|
||||
HGLOBAL data = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, 1);
|
||||
SetClipboardData(getOwnershipFormat(), data);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -159,3 +166,25 @@ CMSWindowsClipboard::clearConverters()
|
||||
}
|
||||
m_converters.clear();
|
||||
}
|
||||
|
||||
bool
|
||||
CMSWindowsClipboard::isOwnedBySynergy()
|
||||
{
|
||||
// create ownership format if we haven't yet
|
||||
if (s_ownershipFormat == 0) {
|
||||
s_ownershipFormat = RegisterClipboardFormat(TEXT("SynergyOwnership"));
|
||||
}
|
||||
return (IsClipboardFormatAvailable(getOwnershipFormat()) != 0);
|
||||
}
|
||||
|
||||
UINT
|
||||
CMSWindowsClipboard::getOwnershipFormat()
|
||||
{
|
||||
// create ownership format if we haven't yet
|
||||
if (s_ownershipFormat == 0) {
|
||||
s_ownershipFormat = RegisterClipboardFormat(TEXT("SynergyOwnership"));
|
||||
}
|
||||
|
||||
// return the format
|
||||
return s_ownershipFormat;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user