Skip to content

Commit

Permalink
Add an activated event and a Timer event
Browse files Browse the repository at this point in the history
Added an event that is triggered when the activation sequence is finished.
We also define a timer event that is neat to have for regular operation.
  • Loading branch information
hardening committed Dec 19, 2017
1 parent 71fd6f3 commit 2a6c9e1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/freerdp/event.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ DEFINE_EVENT_BEGIN(ErrorInfo)
UINT32 code;
DEFINE_EVENT_END(ErrorInfo)

DEFINE_EVENT_BEGIN(Activated)
BOOL firstActivation;
DEFINE_EVENT_END(Activated)

DEFINE_EVENT_BEGIN(Terminate)
int code;
DEFINE_EVENT_END(Terminate)
Expand Down Expand Up @@ -100,6 +104,10 @@ UINT16 x;
UINT16 y;
DEFINE_EVENT_END(MouseEvent)

DEFINE_EVENT_BEGIN(Timer)
UINT64 now;
DEFINE_EVENT_END(Timer)

#ifdef __cplusplus
}
#endif
Expand Down
2 changes: 2 additions & 0 deletions libfreerdp/core/freerdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,8 @@ static wEventType FreeRDP_Events[] =
DEFINE_EVENT_ENTRY(ChannelConnected)
DEFINE_EVENT_ENTRY(ChannelDisconnected)
DEFINE_EVENT_ENTRY(MouseEvent)
DEFINE_EVENT_ENTRY(Activated)
DEFINE_EVENT_ENTRY(Timer)
};

/** Allocator function for a rdp context.
Expand Down
8 changes: 8 additions & 0 deletions libfreerdp/core/rdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1438,7 +1438,15 @@ int rdp_recv_callback(rdpTransport* transport, wStream* s, void* extra)

if ((status >= 0) && (rdp->finalize_sc_pdus == FINALIZE_SC_COMPLETE))
{
ActivatedEventArgs activatedEvent;
rdpContext *context = rdp->context;

rdp_client_transition_to_state(rdp, CONNECTION_STATE_ACTIVE);

EventArgsInit(&activatedEvent, "xfreerdp");
activatedEvent.firstActivation = !rdp->deactivation_reactivation;
PubSub_OnActivated(context->pubSub, context, &activatedEvent);

return 2;
}
if (status < 0)
Expand Down

0 comments on commit 2a6c9e1

Please sign in to comment.