e_client: modify code for handling client type 87/300187/1
authorDoyoun Kang <doyoun.kang@samsung.com>
Wed, 18 Oct 2023 05:59:15 +0000 (14:59 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Wed, 18 Oct 2023 06:39:32 +0000 (15:39 +0900)
Change-Id: I8c5b72e6ddcf4283d44e95acfea86cab574cbd79

src/bin/e_client.c
src/bin/e_client.h
src/bin/e_comp_wl_shell.c

index 4820274..784fe36 100644 (file)
@@ -3394,8 +3394,8 @@ _e_client_type_match(E_Client *ec, E_Config_Client_Type *m)
    return EINA_FALSE;
 }
 
-static int
-_e_client_type_get(E_Client *ec)
+EINTERN int
+e_client_type_update(E_Client *ec)
 {
    E_Config_Client_Type *m;
    Eina_List *l;
@@ -3413,7 +3413,11 @@ _e_client_type_get(E_Client *ec)
           }
      }
 
-   ec->client_type = type;
+   if (ec->client_type != type)
+     {
+        ec->client_type = type;
+        _e_client_event_property(ec, E_CLIENT_PROPERTY_CLIENT_TYPE);
+     }
 
    return ec->client_type;
 }
@@ -4101,8 +4105,6 @@ e_client_idler_before(Eina_Bool *check_focus)
 
    EINA_LIST_FOREACH(e_comp->clients, l, ec)
      {
-        int client_type;
-
         // pass 1 - eval0. fetch properties on new or on change and
         // call hooks to decide what to do - maybe move/resize
         if (ec->ignored || (!ec->changed)) continue;
@@ -4117,9 +4119,7 @@ e_client_idler_before(Eina_Bool *check_focus)
 
         if (ec->new_client)
           {
-             client_type = ec->client_type;
-             if (client_type != _e_client_type_get(ec))
-               _e_client_event_property(ec, E_CLIENT_PROPERTY_CLIENT_TYPE);
+             e_client_type_update(ec);
           }
 
         /* PRE_POST_FETCH calls e_remember apply for new client */
index 51e6149..74a2107 100644 (file)
@@ -1326,6 +1326,8 @@ E_API void      e_client_stack_below(E_Client *ec, E_Client *below);
 E_API int       e_client_show_pending_set(E_Client *ec);
 E_API int       e_client_show_pending_unset(E_Client *ec);
 
+EINTERN int     e_client_type_update(E_Client *ec);
+
 typedef Eina_Bool (*E_Client_Surface_Tree_Foreach)(void *data, E_Client *ec);
 
 /**
index dea52c1..9664a8f 100644 (file)
@@ -191,7 +191,11 @@ e_shell_e_client_name_title_set(E_Client *ec, const char *name, const char *titl
           e_comp_object_frame_title_set(ec->frame, title);
      }
 
-   if (ec->changes.title) EC_CHANGED(ec);
+   if (ec->changes.title)
+     {
+        e_client_type_update(ec);
+        EC_CHANGED(ec);
+     }
    return EINA_TRUE;
 }