From 9229548cd772fa85161990dd773d85800e370e1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Wed, 15 May 2013 11:39:28 -0400 Subject: [PATCH] xfreerdp: fix initialization when multitouch hardware is not present --- channels/client/channels.c | 6 +++++- client/X11/xf_input.c | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/channels/client/channels.c b/channels/client/channels.c index 6531d2a92..a9ea2b0dc 100644 --- a/channels/client/channels.c +++ b/channels/client/channels.c @@ -692,11 +692,15 @@ BOOL freerdp_channels_get_fds(rdpChannels* channels, freerdp* instance, void** r void* freerdp_channels_get_static_channel_interface(rdpChannels* channels, const char* name) { + void* pInterface = NULL; CHANNEL_OPEN_DATA* pChannelOpenData; pChannelOpenData = freerdp_channels_find_channel_open_data_by_name(channels, name); - return pChannelOpenData->pInterface; + if (pChannelOpenData) + pInterface = pChannelOpenData->pInterface; + + return pInterface; } HANDLE freerdp_channels_get_event_handle(freerdp* instance) diff --git a/client/X11/xf_input.c b/client/X11/xf_input.c index 23bb97fb6..9db6b4dff 100644 --- a/client/X11/xf_input.c +++ b/client/X11/xf_input.c @@ -68,6 +68,7 @@ int xf_input_init(xfInfo* xfi, Window window) BYTE masks[8][XIMaskLen(XI_LASTEVENT)]; nmasks = 0; + ndevices = 0; active_contacts = 0; ZeroMemory(contacts, sizeof(touchContact) * MAX_CONTACTS); @@ -123,9 +124,10 @@ int xf_input_init(xfInfo* xfi, Window window) } } - xstatus = XISelectEvents(xfi->display, window, evmasks, nmasks); + if (nmasks > 0) + xstatus = XISelectEvents(xfi->display, window, evmasks, nmasks); - return -1; + return 0; } BOOL xf_input_is_duplicate(XIDeviceEvent* event)