From e73da4a6563f20d5f09c29bf3a031f0559a1c018 Mon Sep 17 00:00:00 2001 From: David Fort Date: Fri, 24 Nov 2017 14:53:39 +0100 Subject: [PATCH] display control channel: add a callback called when we receive capabilities We need a signal to know when the channel is ready and it's safe to send the monitor layouts. --- channels/disp/client/disp_main.c | 10 +++++++--- include/freerdp/client/disp.h | 3 +++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/channels/disp/client/disp_main.c b/channels/disp/client/disp_main.c index 98f8d1f..550293a 100755 --- a/channels/disp/client/disp_main.c +++ b/channels/disp/client/disp_main.c @@ -176,8 +176,11 @@ UINT disp_send_display_control_monitor_layout_pdu(DISP_CHANNEL_CALLBACK* callbac UINT disp_recv_display_control_caps_pdu(DISP_CHANNEL_CALLBACK* callback, wStream* s) { DISP_PLUGIN* disp; + DispClientContext *context; + UINT ret = CHANNEL_RC_OK; disp = (DISP_PLUGIN*) callback->plugin; + context = (DispClientContext *)disp->iface.pInterface; if (Stream_GetRemainingLength(s) < 12) { @@ -188,10 +191,11 @@ UINT disp_recv_display_control_caps_pdu(DISP_CHANNEL_CALLBACK* callback, wStream Stream_Read_UINT32(s, disp->MaxNumMonitors); /* MaxNumMonitors (4 bytes) */ Stream_Read_UINT32(s, disp->MaxMonitorAreaFactorA); /* MaxMonitorAreaFactorA (4 bytes) */ Stream_Read_UINT32(s, disp->MaxMonitorAreaFactorB); /* MaxMonitorAreaFactorB (4 bytes) */ - //WLog_ERR(TAG, "DisplayControlCapsPdu: MaxNumMonitors: %"PRIu32" MaxMonitorAreaFactorA: %"PRIu32" MaxMonitorAreaFactorB: %"PRIu32"", - // disp->MaxNumMonitors, disp->MaxMonitorAreaFactorA, disp->MaxMonitorAreaFactorB); - return CHANNEL_RC_OK; + if (context->DisplayControlCaps) + ret = context->DisplayControlCaps(context, disp->MaxNumMonitors, disp->MaxMonitorAreaFactorA, disp->MaxMonitorAreaFactorB); + + return ret; } /** diff --git a/include/freerdp/client/disp.h b/include/freerdp/client/disp.h index d61644c..0b39d33 100644 --- a/include/freerdp/client/disp.h +++ b/include/freerdp/client/disp.h @@ -52,6 +52,8 @@ typedef struct _DISPLAY_CONTROL_MONITOR_LAYOUT DISPLAY_CONTROL_MONITOR_LAYOUT; typedef struct _disp_client_context DispClientContext; +typedef UINT (*pcDispCaps)(DispClientContext* context, UINT32 MaxNumMonitors, UINT32 MaxMonitorAreaFactorA, + UINT32 MaxMonitorAreaFactorB); typedef UINT (*pcDispSendMonitorLayout)(DispClientContext* context, UINT32 NumMonitors, DISPLAY_CONTROL_MONITOR_LAYOUT* Monitors); struct _disp_client_context @@ -59,6 +61,7 @@ struct _disp_client_context void* handle; void* custom; + pcDispCaps DisplayControlCaps; pcDispSendMonitorLayout SendMonitorLayout; }; -- 2.7.4