From 5441d7ad0b05afb70b5b63e7737e5c28d7c5a29d Mon Sep 17 00:00:00 2001 From: Doyoun Kang Date: Tue, 30 Aug 2022 18:00:33 +0900 Subject: [PATCH] e_client: modify code to handle a client_type Change-Id: If6a7a2a243d5b918f88cdfda0dc3960834436482 --- src/bin/e_client.c | 47 +++++++++++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/src/bin/e_client.c b/src/bin/e_client.c index 30f1984f67..d01235989d 100644 --- a/src/bin/e_client.c +++ b/src/bin/e_client.c @@ -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; -- 2.34.1