summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Blumenkrantz <m.blumenkran@samsung.com>2013-06-19 06:42:39 +0100
committerMike Blumenkrantz <m.blumenkran@samsung.com>2013-06-19 06:42:39 +0100
commitfa8e976540c6a3d42158102ca7e42b26e1da2e6e (patch)
tree9c0da72c3b83c12bcf077708c4ddff0d3b7f2b73 /src
parentcf0ea3e9fdac136f71af5480e861e7c805f3df84 (diff)
ibar tasks are now restricted by NETWM skip taskbar state
Diffstat (limited to 'src')
-rw-r--r--src/modules/ibar/e_mod_main.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/src/modules/ibar/e_mod_main.c b/src/modules/ibar/e_mod_main.c
index 05fc06f35..0ff9b8d91 100644
--- a/src/modules/ibar/e_mod_main.c
+++ b/src/modules/ibar/e_mod_main.c
@@ -524,6 +524,7 @@ _ibar_fill(IBar *b)
524 EINA_LIST_FOREACH(l, ll, exe) 524 EINA_LIST_FOREACH(l, ll, exe)
525 { 525 {
526 if (!exe->desktop) continue; 526 if (!exe->desktop) continue;
527 if (exe->bd && exe->bd->client.netwm.state.skip_taskbar) continue;
527 ic = eina_hash_find(b->icon_hash, _desktop_name_get(exe->desktop)); 528 ic = eina_hash_find(b->icon_hash, _desktop_name_get(exe->desktop));
528 if (ic) 529 if (ic)
529 { 530 {
@@ -2131,6 +2132,59 @@ _ibar_cb_action_focus(E_Object *obj __UNUSED__, const char *params __UNUSED__, E
2131} 2132}
2132 2133
2133static Eina_Bool 2134static Eina_Bool
2135_ibar_cb_bd_prop(void *d EINA_UNUSED, int t EINA_UNUSED, E_Event_Border_Property *ev)
2136{
2137 IBar *b;
2138 Eina_List *l;
2139 Eina_Bool skip;
2140
2141 skip = ev->border->client.netwm.state.skip_taskbar;
2142 EINA_LIST_FOREACH(ibars, l, b)
2143 {
2144 IBar_Icon *ic;
2145
2146 ic = eina_hash_find(b->icon_hash, _desktop_name_get(ev->border->exe_inst->desktop));
2147 if (skip && (!ic)) continue;
2148 if (!skip)
2149 {
2150 if (ic)
2151 {
2152 _ibar_icon_signal_emit(ic, "e,state,started", "e");
2153 if (!ic->exes) _ibar_icon_signal_emit(ic, "e,state,on", "e");
2154 if (!eina_list_data_find(ic->exes, ev->border->exe_inst))
2155 ic->exes = eina_list_append(ic->exes, ev->border->exe_inst);
2156 }
2157 else if (!b->inst->ci->dont_add_nonorder)
2158 {
2159 _ibar_sep_create(b);
2160 ic = _ibar_icon_notinorder_new(b, ev->border->exe_inst);
2161 _ibar_resize_handle(b);
2162 }
2163 }
2164 else
2165 {
2166 ic->exes = eina_list_remove(ic->exes, ev->border->exe_inst);
2167 if (ic->exe_inst == ev->border->exe_inst) ic->exe_inst = NULL;
2168 if (!ic->exes)
2169 {
2170 if (ic->not_in_order)
2171 {
2172 _ibar_icon_free(ic);
2173 if (!b->not_in_order_count)
2174 {
2175 E_FREE_FUNC(b->o_sep, evas_object_del);
2176 }
2177 _ibar_resize_handle(b);
2178 }
2179 else
2180 _ibar_icon_signal_emit(ic, "e,state,off", "e");
2181 }
2182 }
2183 }
2184 return ECORE_CALLBACK_RENEW;
2185}
2186
2187static Eina_Bool
2134_ibar_cb_exec_del(void *d EINA_UNUSED, int t EINA_UNUSED, E_Exec_Instance *exe) 2188_ibar_cb_exec_del(void *d EINA_UNUSED, int t EINA_UNUSED, E_Exec_Instance *exe)
2135{ 2189{
2136 IBar *b; 2190 IBar *b;
@@ -2171,8 +2225,10 @@ _ibar_cb_exec_new(void *d EINA_UNUSED, int t EINA_UNUSED, E_Exec_Instance *exe)
2171{ 2225{
2172 IBar *b; 2226 IBar *b;
2173 Eina_List *l; 2227 Eina_List *l;
2228 Eina_Bool skip;
2174 2229
2175 if (!exe->desktop) return ECORE_CALLBACK_RENEW; //can't do anything here :( 2230 if (!exe->desktop) return ECORE_CALLBACK_RENEW; //can't do anything here :(
2231 skip = exe->bd && exe->bd->client.netwm.state.skip_taskbar;
2176 EINA_LIST_FOREACH(ibars, l, b) 2232 EINA_LIST_FOREACH(ibars, l, b)
2177 { 2233 {
2178 IBar_Icon *ic; 2234 IBar_Icon *ic;
@@ -2182,11 +2238,13 @@ _ibar_cb_exec_new(void *d EINA_UNUSED, int t EINA_UNUSED, E_Exec_Instance *exe)
2182 { 2238 {
2183 _ibar_icon_signal_emit(ic, "e,state,started", "e"); 2239 _ibar_icon_signal_emit(ic, "e,state,started", "e");
2184 if (!ic->exes) _ibar_icon_signal_emit(ic, "e,state,on", "e"); 2240 if (!ic->exes) _ibar_icon_signal_emit(ic, "e,state,on", "e");
2241 if (skip) continue;
2185 if (!eina_list_data_find(ic->exes, exe)) 2242 if (!eina_list_data_find(ic->exes, exe))
2186 ic->exes = eina_list_append(ic->exes, exe); 2243 ic->exes = eina_list_append(ic->exes, exe);
2187 } 2244 }
2188 else if (!b->inst->ci->dont_add_nonorder) 2245 else if (!b->inst->ci->dont_add_nonorder)
2189 { 2246 {
2247 if (skip) continue;
2190 _ibar_sep_create(b); 2248 _ibar_sep_create(b);
2191 ic = _ibar_icon_notinorder_new(b, exe); 2249 ic = _ibar_icon_notinorder_new(b, exe);
2192 _ibar_resize_handle(b); 2250 _ibar_resize_handle(b);
@@ -2253,6 +2311,8 @@ e_modapi_init(E_Module *m)
2253 _ibar_cb_exec_new, NULL); 2311 _ibar_cb_exec_new, NULL);
2254 E_LIST_HANDLER_APPEND(ibar_config->handlers, E_EVENT_EXEC_DEL, 2312 E_LIST_HANDLER_APPEND(ibar_config->handlers, E_EVENT_EXEC_DEL,
2255 _ibar_cb_exec_del, NULL); 2313 _ibar_cb_exec_del, NULL);
2314 E_LIST_HANDLER_APPEND(ibar_config->handlers, E_EVENT_BORDER_PROPERTY,
2315 _ibar_cb_bd_prop, NULL);
2256 2316
2257 e_gadcon_provider_register(&_gadcon_class); 2317 e_gadcon_provider_register(&_gadcon_class);
2258 ibar_orders = eina_hash_string_superfast_new(NULL); 2318 ibar_orders = eina_hash_string_superfast_new(NULL);