#ifdef REFACTOR_DESK_AREA
#else
static void
+_e_comp_input_thread_layers_update(void *data)
+{
+ E_Comp_Input_Layer_Data *layer_data = data;
+ EINA_SAFETY_ON_NULL_RETURN(layer_data);
+
+ INF("[input thread|%s] layer(%u), function type(%d), item(%p), relative(%p)\n",
+ __func__, layer_data->layer, layer_data->type, layer_data->item, layer_data->relative);
+ e_comp_input_layers_update(layer_data);
+}
+
+static void
+_e_comp_object_layers_update(unsigned int layer, E_Comp_Input_Inlist_Function_Type type, E_Client *item, E_Client *relative)
+{
+ E_Comp_Input_Layer_Data layer_data;
+ memset(&layer_data, 0, sizeof(E_Comp_Input_Layer_Data));
+
+ layer_data.layer = layer;
+ layer_data.type = type;
+ layer_data.item = item;
+ layer_data.relative = relative;
+
+ INF("[%s] layer(%u), function type(%d), item(%p), relative(%p)\n", __func__, layer, type, item, relative);
+ e_input_thread_safe_call(_e_comp_input_thread_layers_update, &layer_data, sizeof(E_Comp_Input_Layer_Data));
+}
+
+static void
_e_comp_object_layers_add(E_Comp_Object *cw, E_Comp_Object *above, E_Comp_Object *below, Eina_Bool prepend)
{
g_rec_mutex_lock(&e_comp->ec_list_mutex);
if (above)
- e_comp->layers[above->layer].clients = eina_inlist_append_relative(e_comp->layers[above->layer].clients, EINA_INLIST_GET(cw->ec), EINA_INLIST_GET(above->ec));
+ {
+ e_comp->layers[above->layer].clients = eina_inlist_append_relative(e_comp->layers[above->layer].clients, EINA_INLIST_GET(cw->ec), EINA_INLIST_GET(above->ec));
+ _e_comp_object_layers_update(above->layer, E_COMP_INPUT_INLIST_APPEND_RELATIVE, e_comp->layers[above->layer].clients, cw->ec, above->ec);
+ }
else if (below)
- e_comp->layers[below->layer].clients = eina_inlist_prepend_relative(e_comp->layers[below->layer].clients, EINA_INLIST_GET(cw->ec), EINA_INLIST_GET(below->ec));
+ {
+ e_comp->layers[below->layer].clients = eina_inlist_prepend_relative(e_comp->layers[below->layer].clients, EINA_INLIST_GET(cw->ec), EINA_INLIST_GET(below->ec));
+ _e_comp_object_layers_update(above->layer, E_COMP_INPUT_INLIST_APPEND_RELATIVE, cw->ec, above->ec);
+ }
if ((!above) && (!below))
{
if (prepend)
- e_comp->layers[cw->layer].clients = eina_inlist_prepend(e_comp->layers[cw->layer].clients, EINA_INLIST_GET(cw->ec));
+ {
+ e_comp->layers[cw->layer].clients = eina_inlist_prepend(e_comp->layers[cw->layer].clients, EINA_INLIST_GET(cw->ec));
+ _e_comp_object_layers_update(cw->layer, E_COMP_INPUT_INLIST_PREPEND, cw->ec, NULL);
+ }
else //this is either the layer object or a tough actin tinactin^W^W^Wfast stacking client
- e_comp->layers[cw->layer].clients = eina_inlist_append(e_comp->layers[cw->layer].clients, EINA_INLIST_GET(cw->ec));
+ {
+ e_comp->layers[cw->layer].clients = eina_inlist_append(e_comp->layers[cw->layer].clients, EINA_INLIST_GET(cw->ec));
+ _e_comp_object_layers_update(cw->layer, E_COMP_INPUT_INLIST_APPEND, cw->ec, NULL);
+ }
}
e_comp->layers[cw->layer].clients_count++;
if (cw->ec && e_comp->layers[cw->layer].clients)
{
e_comp->layers[cw->layer].clients = eina_inlist_remove(e_comp->layers[cw->layer].clients, EINA_INLIST_GET(cw->ec));
+ _e_comp_object_layers_update(cw->layer, E_COMP_INPUT_INLIST_REMOVE, cw->ec, NULL);
e_comp->layers[cw->layer].clients_count--;
}
e_comp_object_signal_emit(cw->smart_obj, "e,state,focused", "e");
else
e_comp_object_signal_emit(cw->smart_obj, "e,state,unfocused", "e");
- if (cw->ec->sticky)
- e_comp_object_signal_emit(cw->smart_obj, "e,state,sticky", "e");
- if (cw->ec->hung)
- e_comp_object_signal_emit(cw->smart_obj, "e,state,hung", "e");
/* visibility must always be enabled for re_manage clients to prevent
* pop-in animations every time the user sees a persistent client again;
* applying visibility for iconic clients prevents the client from getting
e_client_size_set(cw->ec, w, h);
cw->ec->client.w = w - cw->client_inset.l - cw->client_inset.r;
cw->ec->client.h = h - cw->client_inset.t - cw->client_inset.b;
- evas_object_smart_callback_call(obj, "client_resize", NULL);
+ wl_signal_emit(&cw->events.resize, NULL);
}
return;
}
(((w - fw != pw) || (h - fh != ph))))
{
//INF("CALLBACK: REQ(%dx%d) != CUR(%dx%d)", w - fw, h - fh, pw, ph);
- evas_object_smart_callback_call(obj, "client_resize", NULL);
+ wl_signal_emit(&cw->events.resize, NULL);
/* flip for CSD */
if (cw->frame_object || cw->ec->input_only)
e_comp_object_frame_wh_adjust(obj, pw, ph, &w, &h);
}
else
{
- evas_object_smart_callback_call(obj, "client_resize", NULL);
-
/* flip for CSD */
if ((!cw->frame_object) && (!cw->ec->input_only))
w = pw, h = ph;
+
+ wl_signal_emit(&cw->events.resize, NULL);
/* "just do it" for overrides */
evas_object_resize(obj, w, h);
}
/* clamp to valid client layer */
layer = e_comp_canvas_client_layer_map_nearest(layer);
cw->ec->layer = layer;
+ e_client_input_thread_layer_set(cw->ec, layer);
if (e_config->transient.layer)
{
E_Client *child;
_e_comp_object_animating_begin(cw);
if (!_e_comp_object_effect_visibility_start(cw, 0)) return;
}
- evas_object_smart_callback_call(obj, "hiding", cw->ec);
+
+ wl_signal_emit(&cw->events.hiding, NULL);
+
cw->defer_hide = !!cw->animating;
if (!cw->animating)
e_comp_object_effect_set(obj, NULL);
cw->visible, cw->animating, cw->defer_hide, cw->content_type, cw->updates, cw->w, cw->h,
ec->iconic, ec->exp_iconify.by_client, ec->exp_iconify.type, ec->input_only, ec->ignored, ec->new_client);
- if (ec->sticky)
- e_comp_object_signal_emit(cw->smart_obj, "e,state,sticky", "e");
if (cw->visible)
{
if (ec->iconic && cw->animating)
if (focus)
{
+ /* check for modal child and set focus to modal child */
+ E_Client *modal_child = e_client_modal_child_get(ec);
+ if ((modal_child) && (modal_child != ec) &&
+ (!e_client_is_iconified_by_client(modal_child)) &&
+ (modal_child->visible) && (!e_object_is_del(E_OBJECT(modal_child))))
+ {
+ // add ec to latest focus stack
+ 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);
+ //e_client_focused_set(modal_child);
+ evas_object_focus_set(modal_child->frame, focus);
+ return;
+ }
if (!cw->visible)
{
/* not yet visible, wait till the next time... */
}
static void
-_e_comp_smart_cb_sticky(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
-{
- e_comp_object_signal_emit(obj, "e,state,sticky", "e");
-}
-
-static void
-_e_comp_smart_cb_unsticky(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
-{
- e_comp_object_signal_emit(obj, "e,state,unsticky", "e");
-}
-
-static void
-_e_comp_smart_cb_unhung(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
-{
- E_Comp_Object *cw = data;
-
- if (!cw->ec) return; //NYI
- e_comp_object_signal_emit(cw->smart_obj, "e,state,unhung", "e");
-}
-
-static void
-_e_comp_smart_cb_hung(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
-{
- E_Comp_Object *cw = data;
-
- if (!cw->ec) return; //NYI
- e_comp_object_signal_emit(cw->smart_obj, "e,state,hung", "e");
-}
-
-static void
_e_comp_smart_focus_in(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
{
e_comp_object_signal_emit(obj, "e,state,focused", "e");
#endif
wl_signal_init(&cw->events.show);
wl_signal_init(&cw->events.hide);
+ wl_signal_init(&cw->events.hiding);
#ifdef REFACTOR_DESK_AREA
wl_signal_init(&cw->events.set_layer);
wl_signal_init(&cw->events.stack_above);
wl_signal_init(&cw->events.content_type_set);
wl_signal_init(&cw->events.color_set);
wl_signal_init(&cw->events.color_visible_set);
+ wl_signal_init(&cw->events.resize);
cw->smart_obj = obj;
cw->x = cw->y = cw->w = cw->h = -1;
evas_object_smart_callback_add(obj, "unmaximize", _e_comp_smart_cb_unmaximize, cw);
evas_object_smart_callback_add(obj, "unfullscreen", _e_comp_smart_cb_unfullscreen, cw);
- evas_object_smart_callback_add(obj, "stick", _e_comp_smart_cb_sticky, cw);
- evas_object_smart_callback_add(obj, "unstick", _e_comp_smart_cb_unsticky, cw);
-
- evas_object_smart_callback_add(obj, "hung", _e_comp_smart_cb_hung, cw);
- evas_object_smart_callback_add(obj, "unhung", _e_comp_smart_cb_unhung, cw);
-
evas_object_smart_callback_add(obj, "frame_recalc", _e_comp_smart_cb_frame_recalc, cw);
evas_object_event_callback_add(obj, EVAS_CALLBACK_FOCUS_IN, _e_comp_smart_focus_in, cw);
{
INTERNAL_ENTRY;
evas_object_color_set(cw->clip, r, g, b, a);
- evas_object_smart_callback_call(obj, "color_set", NULL);
}
wl_signal_add(&cw->events.hide, listener);
}
+EINTERN void
+e_comp_object_hiding_listener_add(Evas_Object *obj, struct wl_listener *listener)
+{
+ API_ENTRY;
+ wl_signal_add(&cw->events.hiding, listener);
+}
+
#ifdef REFACTOR_DESK_AREA
EINTERN void
e_comp_object_set_layer_listener_add(Evas_Object *obj, struct wl_listener *listener)
API_ENTRY;
wl_signal_add(&cw->events.color_visible_set, listener);
}
+
+EINTERN void
+e_comp_object_resize_listener_add(Evas_Object *obj, struct wl_listener *listener)
+{
+ API_ENTRY;
+ wl_signal_add(&cw->events.resize, listener);
+}