From 29cd45142a6cba1c28faa940d3b332f78e484a2d Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 10 Feb 2014 20:10:38 -0500 Subject: [PATCH] remove E_EVENT_CLIENT_(UN)STICK, use E_EVENT_CLIENT_PROPERTY & E_CLIENT_PROPERTY_STICKY --- src/bin/e_client.c | 8 ++------ src/bin/e_client.h | 3 +-- src/modules/pager/e_mod_main.c | 10 ++++++---- src/modules/tiling/e_mod_tiling.c | 4 ++-- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/bin/e_client.c b/src/bin/e_client.c index 98ba0eefd..425b24b5c 100644 --- a/src/bin/e_client.c +++ b/src/bin/e_client.c @@ -14,8 +14,6 @@ EAPI int E_EVENT_CLIENT_SHOW = -1; EAPI int E_EVENT_CLIENT_HIDE = -1; EAPI int E_EVENT_CLIENT_ICONIFY = -1; EAPI int E_EVENT_CLIENT_UNICONIFY = -1; -EAPI int E_EVENT_CLIENT_STICK = -1; -EAPI int E_EVENT_CLIENT_UNSTICK = -1; EAPI int E_EVENT_CLIENT_STACK = -1; EAPI int E_EVENT_CLIENT_FOCUS_IN = -1; EAPI int E_EVENT_CLIENT_FOCUS_OUT = -1; @@ -2163,8 +2161,6 @@ e_client_init(void) E_EVENT_CLIENT_HIDE = ecore_event_type_new(); E_EVENT_CLIENT_ICONIFY = ecore_event_type_new(); E_EVENT_CLIENT_UNICONIFY = ecore_event_type_new(); - E_EVENT_CLIENT_STICK = ecore_event_type_new(); - E_EVENT_CLIENT_UNSTICK = ecore_event_type_new(); E_EVENT_CLIENT_STACK = ecore_event_type_new(); E_EVENT_CLIENT_FOCUS_IN = ecore_event_type_new(); E_EVENT_CLIENT_FOCUS_OUT = ecore_event_type_new(); @@ -3685,7 +3681,7 @@ e_client_stick(E_Client *ec) } } - _e_client_event_simple(ec, E_EVENT_CLIENT_STICK); + _e_client_event_property(ec, E_CLIENT_PROPERTY_STICKY); e_remember_update(ec); } @@ -3717,7 +3713,7 @@ e_client_unstick(E_Client *ec) } e_comp_object_signal_emit(ec->frame, "e,state,unsticky", "e"); - _e_client_event_simple(ec, E_EVENT_CLIENT_UNSTICK); + _e_client_event_property(ec, E_CLIENT_PROPERTY_STICKY); e_client_desk_set(ec, e_desk_current_get(ec->zone)); e_remember_update(ec); diff --git a/src/bin/e_client.h b/src/bin/e_client.h index 25d000bb8..90a081e7e 100644 --- a/src/bin/e_client.h +++ b/src/bin/e_client.h @@ -128,6 +128,7 @@ typedef enum E_Client_Property E_CLIENT_PROPERTY_URGENCY = (1 << 4), E_CLIENT_PROPERTY_GRAVITY = (1 << 5), E_CLIENT_PROPERTY_NETWM_STATE = (1 << 6), + E_CLIENT_PROPERTY_STICKY = (1 << 7), } E_Client_Property; typedef struct E_Client E_Client; @@ -713,8 +714,6 @@ EAPI extern int E_EVENT_CLIENT_SHOW; EAPI extern int E_EVENT_CLIENT_HIDE; EAPI extern int E_EVENT_CLIENT_ICONIFY; EAPI extern int E_EVENT_CLIENT_UNICONIFY; -EAPI extern int E_EVENT_CLIENT_STICK; -EAPI extern int E_EVENT_CLIENT_UNSTICK; EAPI extern int E_EVENT_CLIENT_STACK; EAPI extern int E_EVENT_CLIENT_FOCUS_IN; EAPI extern int E_EVENT_CLIENT_FOCUS_OUT; diff --git a/src/modules/pager/e_mod_main.c b/src/modules/pager/e_mod_main.c index 966a741ff..5f6b63f79 100644 --- a/src/modules/pager/e_mod_main.c +++ b/src/modules/pager/e_mod_main.c @@ -1113,10 +1113,11 @@ _pager_cb_event_client_uniconify(void *data __UNUSED__, int type __UNUSED__, voi static Eina_Bool _pager_cb_event_client_stick(void *data __UNUSED__, int type __UNUSED__, void *event) { - E_Event_Client *ev = event; + E_Event_Client_Property *ev = event; Eina_List *l; Pager *p; + if ((!(ev->property & E_CLIENT_PROPERTY_STICKY)) || (!ev->ec->sticky)) return ECORE_CALLBACK_RENEW; EINA_LIST_FOREACH(pagers, l, p) { Eina_List *l2; @@ -1141,10 +1142,11 @@ _pager_cb_event_client_stick(void *data __UNUSED__, int type __UNUSED__, void *e static Eina_Bool _pager_cb_event_client_unstick(void *data __UNUSED__, int type __UNUSED__, void *event) { - E_Event_Client *ev = event; + E_Event_Client_Property *ev = event; Eina_List *l; Pager *p; + if ((!(ev->property & E_CLIENT_PROPERTY_STICKY)) || (ev->ec->sticky)) return ECORE_CALLBACK_RENEW; EINA_LIST_FOREACH(pagers, l, p) { Pager_Desk *pd; @@ -2864,8 +2866,8 @@ e_modapi_init(E_Module *m) E_LIST_HANDLER_APPEND(pager_config->handlers, E_EVENT_CLIENT_REMOVE, _pager_cb_event_client_remove, NULL); E_LIST_HANDLER_APPEND(pager_config->handlers, E_EVENT_CLIENT_ICONIFY, _pager_cb_event_client_iconify, NULL); E_LIST_HANDLER_APPEND(pager_config->handlers, E_EVENT_CLIENT_UNICONIFY, _pager_cb_event_client_uniconify, NULL); - E_LIST_HANDLER_APPEND(pager_config->handlers, E_EVENT_CLIENT_STICK, _pager_cb_event_client_stick, NULL); - E_LIST_HANDLER_APPEND(pager_config->handlers, E_EVENT_CLIENT_UNSTICK, _pager_cb_event_client_unstick, NULL); + E_LIST_HANDLER_APPEND(pager_config->handlers, E_EVENT_CLIENT_PROPERTY, _pager_cb_event_client_stick, NULL); + E_LIST_HANDLER_APPEND(pager_config->handlers, E_EVENT_CLIENT_PROPERTY, _pager_cb_event_client_unstick, NULL); E_LIST_HANDLER_APPEND(pager_config->handlers, E_EVENT_CLIENT_DESK_SET, _pager_cb_event_client_desk_set, NULL); E_LIST_HANDLER_APPEND(pager_config->handlers, E_EVENT_CLIENT_STACK, _pager_cb_event_client_stack, NULL); E_LIST_HANDLER_APPEND(pager_config->handlers, E_EVENT_CLIENT_PROPERTY, _pager_cb_event_client_icon_change, NULL); diff --git a/src/modules/tiling/e_mod_tiling.c b/src/modules/tiling/e_mod_tiling.c index f5fcb2d23..3ea9da078 100644 --- a/src/modules/tiling/e_mod_tiling.c +++ b/src/modules/tiling/e_mod_tiling.c @@ -3703,8 +3703,8 @@ e_modapi_init(E_Module *m) HANDLER(_G.handler_client_iconify, CLIENT_ICONIFY, _iconify_hook); HANDLER(_G.handler_client_uniconify, CLIENT_UNICONIFY, _uniconify_hook); - HANDLER(_G.handler_client_stick, CLIENT_STICK, _stick_hook); - HANDLER(_G.handler_client_unstick, CLIENT_UNSTICK, _unstick_hook); + HANDLER(_G.handler_client_stick, CLIENT_PROPERTY, _stick_hook); + HANDLER(_G.handler_client_unstick, CLIENT_PROPERTY, _unstick_hook); HANDLER(_G.handler_desk_show, DESK_SHOW, _desk_show_hook); HANDLER(_G.handler_desk_before_show, DESK_BEFORE_SHOW, _desk_before_show_hook);