mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-11-14 07:47:19 +00:00
[client] windows: implement native clipboard support
Add Win32 clipboard ownership, notifications, and data exchange for text and image formats. Marshal clipboard access onto the window thread and reject stale transfers when ownership changes. Keep file clipboard offers unsupported while clearing stale content from earlier remote offers.
This commit is contained in:
@@ -54,6 +54,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "clipboard.h"
|
||||
|
||||
#define LG_WINDOW_CLASS L"LookingGlassClientWindow"
|
||||
|
||||
enum WindowsMessage
|
||||
@@ -849,6 +851,7 @@ static LRESULT handleCustomMessage(UINT message, WPARAM wParam,
|
||||
switch (message)
|
||||
{
|
||||
case WM_LG_SHUTDOWN:
|
||||
windowsCBEventShutdown();
|
||||
eventSourceFree();
|
||||
setKeyboardGrab(false);
|
||||
setPointerGrab(false, false);
|
||||
@@ -930,6 +933,11 @@ static LRESULT handleCustomMessage(UINT message, WPARAM wParam,
|
||||
static LRESULT CALLBACK windowProc(HWND window, UINT message,
|
||||
WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
LRESULT clipboardResult;
|
||||
if (windowsCBHandleMessage(
|
||||
window, message, wParam, lParam, &clipboardResult))
|
||||
return clipboardResult;
|
||||
|
||||
if (message >= WM_LG_SHUTDOWN && message <= WM_LG_EVENT_SOURCE)
|
||||
return handleCustomMessage(message, wParam, lParam);
|
||||
|
||||
@@ -1887,4 +1895,10 @@ struct LG_DisplayServerOps LGDS_Windows =
|
||||
.getFullscreen = windowsGetFullscreen,
|
||||
.setFullscreen = windowsSetFullscreen,
|
||||
.minimize = windowsMinimize,
|
||||
.cbInit = windowsCBInit,
|
||||
.cbNotice = windowsCBNotice,
|
||||
.cbRelease = windowsCBRelease,
|
||||
.cbRequest = windowsCBRequest,
|
||||
.cbRequestReady = windowsCBRequestReady,
|
||||
.cbRequestCancel = windowsCBRequestCancel,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user