e_client: modify code to handle a client_type 84/280484/1
authorDoyoun Kang <doyoun.kang@samsung.com>
Tue, 30 Aug 2022 09:00:33 +0000 (18:00 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Tue, 30 Aug 2022 22:20:43 +0000 (07:20 +0900)
Change-Id: If6a7a2a243d5b918f88cdfda0dc3960834436482

src/bin/e_client.c

index 30f1984f67d48a2f4713a5ce710fae828d79fe7f..d01235989d8b8318e85a90c976d654ec884a03d3 100644 (file)
@@ -3324,20 +3324,38 @@ _e_client_type_match(E_Client *ec, E_Config_Client_Type *m)
      return EINA_FALSE;
 
 #if defined(__cplusplus) || defined(c_plusplus)
-   if (((m->clas) && (!ec->icccm.cpp_class)) ||
-       ((ec->icccm.cpp_class) && (m->clas) && (!e_util_glob_match(ec->icccm.cpp_class, m->clas))))
-     return EINA_FALSE;
+   if (m->clas)
+     {
+        if (!ec->icccm.cpp_class)
+          return EINA_FALSE;
+
+        if (!e_util_glob_match(ec->icccm.cpp_class, m->clas))
+          return EINA_FALSE;
+     }
 #else
-   if (((m->clas) && (!ec->icccm.class)) ||
-       ((ec->icccm.class) && (m->clas) && (!e_util_glob_match(ec->icccm.class, m->clas))))
-     return EINA_FALSE;
+   if (m->clas)
+     {
+        if (!ec->icccm.class)
+          return EINA_FALSE;
+
+        if (!e_util_glob_match(ec->icccm.class, m->clas))
+          return EINA_FALSE;
+     }
 #endif
 
-   if (((m->name) && (!ec->icccm.name)) ||
-       ((ec->icccm.name) && (m->name) && (!e_util_glob_match(ec->icccm.name, m->name))))
-     return EINA_FALSE;
+   if (m->name)
+     {
+        if (ec->icccm.name && e_util_glob_match(ec->icccm.name, m->name))
+          return EINA_TRUE;
 
-   return EINA_TRUE;
+        if (ec->icccm.title && e_util_glob_match(ec->icccm.title, m->name))
+          return EINA_TRUE;
+
+        if (ec->netwm.name && e_util_glob_match(ec->netwm.name, m->name))
+          return EINA_TRUE;
+     }
+
+   return EINA_FALSE;
 }
 
 static int
@@ -4343,9 +4361,12 @@ e_client_idler_before(void)
         if (title != e_client_util_name_get(ec))
           _e_client_event_property(ec, E_CLIENT_PROPERTY_TITLE);
 
-        client_type = ec->client_type;
-        if (client_type != _e_client_type_get(ec))
-           _e_client_event_property(ec, E_CLIENT_PROPERTY_CLIENT_TYPE);
+        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);
+          }
 
         /* PRE_POST_FETCH calls e_remember apply for new client */
         if (!_e_client_hook_call(E_CLIENT_HOOK_EVAL_PRE_POST_FETCH, ec)) continue;