e_mod_rdp : initialize virtual device for rdp_input and add deinit 56/269656/5
authordyamy-lee <dyamy.lee@samsung.com>
Thu, 20 Jan 2022 01:51:17 +0000 (10:51 +0900)
committerdyamy-lee <dyamy.lee@samsung.com>
Thu, 27 Jan 2022 08:17:07 +0000 (17:17 +0900)
Change-Id: I5eea2ba5500ea77c25a12319cd56dba9b2f82905

src/e_mod_rdp.c

index 1f98180..0e52d29 100644 (file)
 #include <pixman.h>
 #include <tbm_surface.h>
 #include <tbm_surface_internal.h>
+#include <e_info_server_input.h>
 
 #include "e_mod_main.h"
 #include "e_mod_rdp.h"
 
 #define E_RDP_WIDTH 1280
 #define E_RDP_HEIGHT 720
+#define E_RDP_DEVICE_NAME "rdp_input"
 #define E_MOD_RDP_CONFIG_VERSION  2
 #define E_MOD_RDP_NAME_LEN        64
 #define MAX_FREERDP_FDS           10
@@ -1136,6 +1138,8 @@ e_rdp_peer_init(freerdp_peer *client, E_Rdp_Backend *b)
    void *rfds[MAX_FREERDP_FDS];
    int i, fd;
    struct wl_event_loop *loop;
+   char *device_name = NULL, *result = NULL;
+   unsigned int device_type = 0x0;
    rdpSettings *settings;
    rdpInput *input;
    E_Rdp_Peer_Context *peerCtx;
@@ -1186,6 +1190,18 @@ e_rdp_peer_init(freerdp_peer *client, E_Rdp_Backend *b)
 
    client->update->SuppressOutput = (pSuppressOutput)e_rdp_suppress_output;
 
+   device_type = E_INPUT_SEAT_POINTER | E_INPUT_SEAT_TOUCH | E_INPUT_SEAT_KEYBOARD;
+   device_name = E_RDP_DEVICE_NAME;
+   result = e_info_server_input_init_device(device_type, device_name);
+
+   if (e_util_strcmp(result, E_INFO_INPUT_RESULT_NONE))
+     {
+        e_info_server_input_deinit_device();
+        result = e_info_server_input_init_device(device_type, device_name);
+     }
+
+   DBG("rdp peer init | init input device | result = %s\n", result);
+
    input = client->input;
    input->SynchronizeEvent = e_rdp_input_synchronize_event;
    input->MouseEvent = e_rdp_mouse_event;
@@ -1489,6 +1505,7 @@ conf_err:
 void
 e_mod_rdp_deinit(void)
 {
+   e_info_server_input_deinit_device();
    e_rdp_backend_destroy();
    if (g_rdp_config)
      {