static Eina_List *_damage_trace_objs = NULL;
static Eina_List *_damage_trace_post_objs = NULL;
-/* sekrit functionzzz */
-EINTERN void e_client_focused_set(E_Client *ec);
-
/* emitted every time a new noteworthy comp object is added */
EINTERN int E_EVENT_COMP_OBJECT_ADD = -1;
{
E_Comp_Object *cw = data;
E_Client *ec;
+ E_Zone *zone;
ec = cw->ec;
+ zone = e_comp_zone_find_by_ec(ec);
+ if (!zone)
+ {
+ ERR("intercept_focus:: zone is NULL");
+ zone = e_zone_current_get();
+ }
/* note: this is here as it seems there are enough apps that do not even
* expect us to emulate a look of focus but not actually set x input
* focus as we do - so simply abort any focus set on such windows */
{
if (!focus)
{
- if (e_client_focused_get() == ec)
- e_client_focused_set(NULL);
+ if (e_zone_focused_client_get(zone) == ec)
+ e_zone_focused_client_set(zone, NULL);
ELOGF("FOCUS", "FOCUS UNSET | evas_object(%p) (frame:%p)", ec, obj, ec->frame);
evas_object_focus_set(obj, focus);
e_client_focus_latest_set(ec);
ELOGF("FOCUS", "FOCUS SET to MODAL (ec:%p, win:0x%08zx, frame:%p)", ec, modal_child, e_client_util_win_get(modal_child), modal_child->frame);
+ // FIXME : check why the modal_child should use evas_object_focus_set
//e_client_focused_set(modal_child);
evas_object_focus_set(modal_child->frame, focus);
return;
EC_CHANGED(ec);
return;
}
- e_client_focused_set(ec);
+ e_zone_focused_client_set(zone, ec);
}
else
{
- if (e_client_focused_get() == ec)
- e_client_focused_set(NULL);
+ if (e_zone_focused_client_get(zone) == ec)
+ e_zone_focused_client_set(zone, NULL);
}
if (focus)
#include "e_compositor_intern.h"
#include "e_view_intern.h"
#include "e_view_client_intern.h"
-#include "e_policy_zone_intern.h"
#include "e_comp_canvas_intern.h"
#include "e_hwc_window_intern.h"
#include "e_canvas_intern.h"
static E_Client_Resize_Object_Create_Cb _e_client_resize_object_create_cb = NULL;
-EINTERN void e_client_focused_set(E_Client *ec);
static void _e_client_transient_for_group_make(E_Client *ec, Eina_List **list);
static Evas_Object *_e_client_resize_object_create(E_Client *ec);
static void _e_client_resize_object_del(E_Client *ec);
EINTERN void
e_client_focused_set(E_Client *ec)
{
- E_Client *focused_ec;
E_Zone *zone;
- if (ec)
- ELOGF("FOCUS", "CLIENT FOCUSED_SET : SET", ec);
- else
- ELOGF("FOCUS", "CLIENT FOCUSED_SET : UNSET", NULL);
-
- focused_ec = e_comp_focused_ec_get();
- if (ec == focused_ec) return;
-
- TRACE_DS_BEGIN(CLIENT:FOCUSED SET);
-
- // unset the current focused_ec if focused_ec is not being deleted
- if (focused_ec)
- {
- if (!e_object_is_del(E_OBJECT(focused_ec)))
- {
- // FIXME: Remove focus_unset event of client.
- // Instead, make zone focus_unset event and use it.
- wl_signal_emit(&PRI(focused_ec)->events.focus_unset, NULL);
- _e_client_hook_call(E_CLIENT_HOOK_FOCUS_UNSET, focused_ec);
-
- if (e_object_ref_get(E_OBJECT(focused_ec)) > 0)
- {
- _e_client_event_simple(focused_ec, E_EVENT_CLIENT_FOCUS_OUT);
- }
- }
- }
+ EINA_SAFETY_ON_NULL_RETURN(ec);
- // clear the current focused_ec when ec is NULL
- if (!ec)
+ zone = e_comp_zone_find_by_ec(ec);
+ if (!zone)
{
- zone = e_comp_zone_find_by_ec(focused_ec);
- E_Policy_Zone *policy_zone = e_comp_screen_policy_zone_get(zone);
- e_policy_zone_focus_clear(policy_zone);
-
- TRACE_DS_END();
+ ELOGF("FOCUS", "E_Client(%p):%s: Couldn't find zone", ec, ec, e_client_icccm_title_get(ec));
return;
}
+ ELOGF("FOCUS", "CLIENT FOCUSED_SET", ec);
+ TRACE_DS_BEGIN(CLIENT:FOCUSED SET);
+
// FIXME: Remove focus_set event of client.
// Instead, make zone focus_set event and use it.
// set the new current focused_ec
TRACE_DS_END();
}
+EINTERN void
+e_client_focused_unset(E_Client *ec)
+{
+ E_Zone *zone;
+
+ EINA_SAFETY_ON_NULL_RETURN(ec);
+ if (e_object_is_del(E_OBJECT(ec))) return;
+
+ zone = e_comp_zone_find_by_ec(ec);
+ if (!zone)
+ {
+ ELOGF("FOCUS", "E_Client(%p):%s: Couldn't find zone", ec, ec, e_client_icccm_title_get(ec));
+ return;
+ }
+
+ ELOGF("FOCUS", "CLIENT FOCUSED_UNSET", ec);
+ TRACE_DS_BEGIN(CLIENT:FOCUSED UNSET);
+
+ // FIXME: Remove focus_unset event of client.
+ // Instead, make zone focus_unset event and use it.
+ wl_signal_emit(&PRI(ec)->events.focus_unset, NULL);
+ _e_client_hook_call(E_CLIENT_HOOK_FOCUS_UNSET, ec);
+
+ if (e_object_ref_get(E_OBJECT(ec)) > 0)
+ {
+ _e_client_event_simple(ec, E_EVENT_CLIENT_FOCUS_OUT);
+ }
+
+ TRACE_DS_END();
+ return;
+}
+
EINTERN void
e_client_activate(E_Client *ec)
{
EINTERN void e_client_idler_before(Eina_Bool *check_focus);
EINTERN unsigned int e_clients_count(void);
+EINTERN void e_client_focused_set(E_Client *ec);
+EINTERN void e_client_focused_unset(E_Client *ec);
EINTERN void e_client_activate(E_Client *ec);
EINTERN Eina_List *e_client_lost_windows_get(E_Zone *zone);
EINTERN void e_client_layout_set(E_Client *ec, uint32_t num_cols, uint32_t num_rows, uint32_t column_id, uint32_t row_id, uint32_t col_span, uint32_t row_span);
wl_signal_emit(&PRI(zone)->events.focused_client_get, &focused_ec);
- ELOGF("ZONE", "Focused client get: %p", focused_ec, focused_ec);
+ ELOGF("ZONE", "Zone(%d):%p Focused client get: %p", focused_ec, zone->id, zone, focused_ec);
return focused_ec;
}
{
EINA_SAFETY_ON_NULL_RETURN(zone);
- wl_signal_emit(&PRI(zone)->events.focused_client_set, ec);
-
ELOGF("ZONE", "Focused client set: %p", ec, ec);
+
+ wl_signal_emit(&PRI(zone)->events.focused_client_set, ec);
return;
}
static void
_e_policy_zone_cb_focused_client_set(struct wl_listener *listener, void *data)
{
- //E_Policy_Zone *policy_zone;
- //E_Zone *zone;
+ E_Policy_Zone *policy_zone;
+ E_Zone *zone;
+ E_Client *ec, *focused_ec;
+
+ policy_zone = wl_container_of(listener, policy_zone, focused_client_set);
+ zone = policy_zone->zone;
+ ec = (E_Client *)data;
- //policy_zone = wl_container_of(listener, policy_zone, focused_client_set);
- //zone = policy_zone->zone;
+ focused_ec = e_zone_focused_client_get(zone);
+ if (ec && (ec == focused_ec)) return;
+
+ if (focused_ec)
+ {
+ e_client_focused_unset(focused_ec);
+ e_policy_zone_focus_clear(policy_zone);
+ }
- // TODO:: Need to impl
+ if (ec)
+ e_client_focused_set(ec);
return;
}