e_mod_main : add motionless in config structure for not passing mouse motion event 60/269660/8
authordyamy-lee <dyamy.lee@samsung.com>
Thu, 20 Jan 2022 01:38:57 +0000 (10:38 +0900)
committerdyamy-lee <dyamy.lee@samsung.com>
Thu, 27 Jan 2022 08:57:06 +0000 (17:57 +0900)
e_mod_rdp_conf : add setting of motionless config
e_mod_rdp : add motionless in E_Rdp_Backend and implemente case of motionless when mouse move

Change-Id: Ie280b93c9e63222934ec5b7d72728729cc88279f

src/e_mod_main.h
src/e_mod_rdp.c
src/e_mod_rdp_conf.c

index a9090b7..3ca2273 100644 (file)
@@ -21,6 +21,7 @@ struct _E_Rdp_Conf_Edd
    int port;
    int no_clients_resize;
    int force_no_compression;
+   int motionless;
 };
 
 /*** E Module ***/
index 78472ff..d3decbb 100644 (file)
@@ -92,6 +92,7 @@ struct _E_Rdp_Backend
    int tls_enabled;
    int no_clients_resize;
    int force_no_compression;
+   int motionless;
 };
 
 struct _E_Rdp_Peer_Item
@@ -1031,6 +1032,7 @@ e_rdp_mouse_event(rdpInput *input, UINT16 flags, UINT16 x, UINT16 y)
 {
    int e_output_w, e_output_h;
    int move_x = 0, move_y = 0;
+   int motionless = 0;
    uint32_t button = 0;
    uint32_t state = 0;
 
@@ -1039,8 +1041,9 @@ e_rdp_mouse_event(rdpInput *input, UINT16 flags, UINT16 x, UINT16 y)
    E_Output *e_output = output->primary_output;
    e_output_w = e_output->config.mode.w;
    e_output_h = e_output->config.mode.h;
+   motionless = peerContext->rdpBackend->motionless;
 
-   if (flags & PTR_FLAGS_MOVE)
+   if (flags & PTR_FLAGS_MOVE && !motionless)
      {
         if (x < e_output_w && y < e_output_h)
           {
@@ -1076,7 +1079,24 @@ e_rdp_mouse_event(rdpInput *input, UINT16 flags, UINT16 x, UINT16 y)
         move_x = (int)value;
      }
 
-   e_info_server_input_mousegen(button, move_x, move_y, state);
+   if (!motionless)
+     e_info_server_input_mousegen(button, move_x, move_y, state);
+   else
+     {
+        if (!(flags & PTR_FLAGS_MOVE))
+          {
+             if (x < e_output_w && y < e_output_h)
+               {
+                  move_x = (int)((int)(x - output->prev_x) * output->mouse_scale_w);
+                  move_y = (int)((int)(y - output->prev_y) * output->mouse_scale_h);
+                  output->prev_x = x;
+                  output->prev_y = y;
+               }
+
+             e_info_server_input_mousegen(0, move_x, move_y, E_INFO_EVENT_STATE_MOTION);
+             e_info_server_input_mousegen(button, move_x, move_y, state);
+          }
+     }
 
    return TRUE;
 }
@@ -1495,6 +1515,7 @@ e_rdp_backend_create(E_Rdp_Conf_Edd *config)
 
    b->no_clients_resize = config->no_clients_resize;
    b->force_no_compression = config->force_no_compression;
+   b->motionless = config->motionless;
 
    if (config->rdp_key)
      {
index fece659..6a6e1c3 100644 (file)
@@ -17,10 +17,10 @@ _e_rdp_conf_value_check(E_Rdp_Config_Data *config)
         return EINA_FALSE;
      }
 
-   DBG("bindaddress:%s, rdp_key:%s, server_cert:%s, server_key:%s, port:%d, noresize:%d, nocompress:%d",
+   DBG("bindaddress:%s, rdp_key:%s, server_cert:%s, server_key:%s, port:%d, noresize:%d, nocompress:%d, motionless:%d",
        config->conf->bind_address?:"no_bind_address", config->conf->rdp_key?:"no_rdp_key",
        config->conf->server_cert?:"no_server_cert", config->conf->server_key?:"no_server_key",
-       config->conf->port, config->conf->no_clients_resize, config->conf->force_no_compression);
+       config->conf->port, config->conf->no_clients_resize, config->conf->force_no_compression, config->conf->motionless);
 
    return EINA_TRUE;
 }
@@ -44,6 +44,7 @@ e_rdp_conf_init(E_Rdp_Config_Data *config)
    E_CONFIG_VAL(D, T, port, INT);
    E_CONFIG_VAL(D, T, no_clients_resize, INT);
    E_CONFIG_VAL(D, T, force_no_compression, INT);
+   E_CONFIG_VAL(D, T, motionless, INT);
 #undef T
 #undef D
    config->conf = e_config_domain_load("module.rdp", config->conf_edd);