[gnome-remote-desktop] clipboard-rdp: Simplify delegate handling
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-remote-desktop] clipboard-rdp: Simplify delegate handling
- Date: Thu, 4 Mar 2021 20:01:49 +0000 (UTC)
commit 41579f9e51909f9272fa6a89abea6027f71fbafc
Author: Pascal Nowack <Pascal Nowack gmx de>
Date: Sun Feb 21 19:25:46 2021 +0100
clipboard-rdp: Simplify delegate handling
In the first approach of the clipboard implementation for RDP every
function operated on the CliprdrServerContext instance.
This handling got replaced in the final version, but the delegate
handling still seems to use it.
Directly using the delegate instance not only simplifies the delegate
functions, but is also necessary for clipboard locking, as
gnome-remote-desktop might need to use a different delegate than the
default one.
src/grd-clipboard-rdp.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
---
diff --git a/src/grd-clipboard-rdp.c b/src/grd-clipboard-rdp.c
index 4f6dc3d..ad07333 100644
--- a/src/grd-clipboard-rdp.c
+++ b/src/grd-clipboard-rdp.c
@@ -1258,24 +1258,21 @@ cliprdr_client_format_data_response (CliprdrServerContext *cliprdr
}
static uint32_t
-delegate_request_file_contents_size (CliprdrServerContext *cliprdr_context,
+delegate_request_file_contents_size (wClipboardDelegate *delegate,
const CLIPRDR_FILE_CONTENTS_REQUEST *file_contents_request)
{
- GrdClipboardRdp *clipboard_rdp = cliprdr_context->custom;
wClipboardFileSizeRequest file_size_request = {0};
file_size_request.streamId = file_contents_request->streamId;
file_size_request.listIndex = file_contents_request->listIndex;
- return clipboard_rdp->delegate->ClientRequestFileSize (clipboard_rdp->delegate,
- &file_size_request);
+ return delegate->ClientRequestFileSize (delegate, &file_size_request);
}
static uint32_t
-delegate_request_file_contents_range (CliprdrServerContext *cliprdr_context,
+delegate_request_file_contents_range (wClipboardDelegate *delegate,
const CLIPRDR_FILE_CONTENTS_REQUEST *file_contents_request)
{
- GrdClipboardRdp *clipboard_rdp = cliprdr_context->custom;
wClipboardFileRangeRequest file_range_request = {0};
file_range_request.streamId = file_contents_request->streamId;
@@ -1284,8 +1281,7 @@ delegate_request_file_contents_range (CliprdrServerContext *clipr
file_range_request.nPositionHigh = file_contents_request->nPositionHigh;
file_range_request.cbRequested = file_contents_request->cbRequested;
- return clipboard_rdp->delegate->ClientRequestFileRange (clipboard_rdp->delegate,
- &file_range_request);
+ return delegate->ClientRequestFileRange (delegate, &file_range_request);
}
static uint32_t
@@ -1332,12 +1328,12 @@ cliprdr_client_file_contents_request (CliprdrServerContext *clipr
if (file_contents_request->dwFlags & FILECONTENTS_SIZE)
{
- error = delegate_request_file_contents_size (cliprdr_context,
+ error = delegate_request_file_contents_size (clipboard_rdp->delegate,
file_contents_request);
}
else if (file_contents_request->dwFlags & FILECONTENTS_RANGE)
{
- error = delegate_request_file_contents_range (cliprdr_context,
+ error = delegate_request_file_contents_range (clipboard_rdp->delegate,
file_contents_request);
}
else
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]