Change rdp output size setting method 64/308264/1
authorJunkyeong Kim <jk0430.kim@samsung.com>
Wed, 20 Mar 2024 10:37:09 +0000 (19:37 +0900)
committerJunkyeong Kim <jk0430.kim@samsung.com>
Wed, 20 Mar 2024 10:37:16 +0000 (19:37 +0900)
Use e_output_size_get API.

Change-Id: I7d161bcbef456d8d655d41e2993647480c3b7c68
Signed-off-by: Junkyeong Kim <jk0430.kim@samsung.com>
src/e_mod_rdp.c

index 15acaff450c9c814968a5514f1d6f60de01e8f96..678546e647609ea9c9a2e615456dc1f70bd16cd2 100644 (file)
@@ -2020,9 +2020,8 @@ E_Rdp_Output *
 e_rdp_output_create(void)
 {
    E_Rdp_Output *output = NULL;
-   Eina_List *l;
-   E_Output_Mode *emode = NULL;
-   Eina_Bool mode = EINA_FALSE;
+   int w = 0;
+   int h = 0;
 
    output = E_NEW(E_Rdp_Output, 1);
    EINA_SAFETY_ON_NULL_RETURN_VAL(output, NULL);
@@ -2034,23 +2033,19 @@ e_rdp_output_create(void)
         return NULL;
      }
 
-   EINA_LIST_FOREACH(output->primary_output->info.modes, l, emode)
-     {
-        if (emode->current)
-          {
-             output->primary_w = emode->w;
-             output->primary_h = emode->h;
-             output->w = emode->w / 2;
-             output->h = emode->h / 2;
-             mode = EINA_TRUE;
-             break;
-          }
-     }
-   if (mode == EINA_FALSE)
+   e_output_size_get(output->primary_output, &w, &h);
+   if (w == 0 || h == 0)
      {
         output->w = E_RDP_WIDTH;
         output->h = E_RDP_HEIGHT;
      }
+   else
+     {
+        output->primary_w = w;
+        output->primary_h = h;
+        output->w = w / 2;
+        output->h = h / 2;
+     }
 
    wl_list_init(&output->peers);