printf("WIN FOCUS: %s\n", (char *)data);
}
+static void
+_win_state_visibility_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
+{
+ /* event_info for "visibility,changed" callback
+ * 0: the window is fully obscured
+ * 1: the window is unobscured
+ */
+ int visibility = (int)(void *)event_info;
+ printf("WIN: %s %d\n", (char *)data, visibility);
+}
+
static void
_win_show(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
evas_object_smart_callback_add(win, "focus,in", _win_state_focus_cb, "focus,in");
evas_object_smart_callback_add(win, "delete,request", _win_state_print_cb, "delete,request");
evas_object_smart_callback_add(win, "wm,rotation,changed", _win_state_print_cb, "wm,rotation,changed");
+ evas_object_smart_callback_add(win, "visibility,changed", _win_state_visibility_cb, "visibility,changed");
elm_win_autodel_set(win, EINA_TRUE);
bg = elm_bg_add(win);
Eina_Bool noblank : 1;
Eina_Bool theme_alpha : 1; /**< alpha value fetched by a theme. this has higher priority than application_alpha */
Eina_Bool application_alpha : 1; /**< alpha value set by an elm_win_alpha_set() api. this has lower priority than theme_alpha */
+ Eina_Bool obscured :1;
};
static const char SIG_DELETE_REQUEST[] = "delete,request";
static const char SIG_WM_ROTATION_CHANGED[] = "wm,rotation,changed";
static const char SIG_CONFORMANT_CHANGED[] = "conformant,changed";
static const char SIG_AUX_HINT_ALLOWED[] = "aux,hint,allowed";
+static const char SIG_VISIBILITY_CHANGED[] = "visibility,changed";
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{SIG_DELETE_REQUEST, ""},
{SIG_WIDGET_UNFOCUSED, ""}, /**< handled by elm_widget */
{SIG_CONFORMANT_CHANGED, ""},
{SIG_AUX_HINT_ALLOWED, ""},
+ {SIG_VISIBILITY_CHANGED, ""},
{NULL, NULL}
};
Eina_Bool ch_profile = EINA_FALSE;
Eina_Bool ch_wm_rotation = EINA_FALSE;
Eina_Bool ch_conformant = EINA_FALSE;
+ Eina_Bool ch_visibility = EINA_FALSE;
Eina_Bool ch_aux_hint = EINA_FALSE;
Eina_List *aux_hints = NULL;
const char *profile;
ch_wm_rotation = EINA_TRUE;
}
}
+
+ if (sd->obscured != ecore_evas_obscured_get(sd->ee))
+ {
+ sd->obscured = ecore_evas_obscured_get(sd->ee);
+ ch_visibility = EINA_TRUE;
+ }
+
aux_hints = ecore_evas_aux_hints_allowed_get(sd->ee);
if (aux_hints)
{
}
eina_list_free(aux_hints);
}
+ if (ch_visibility)
+ {
+ evas_object_smart_callback_call(obj, SIG_VISIBILITY_CHANGED, (void*)!sd->obscured);
+ }
}
EOLIAN static Eina_Bool
sd->parent = parent;
sd->modal_count = 0;
sd->withdrawn = ecore_evas_withdrawn_get(sd->ee);
+ sd->obscured = ecore_evas_obscured_get(sd->ee);
if (sd->parent)
evas_object_event_callback_add
* @li "focused" : When the win has received focus. (since 1.8)
* @li "unfocused" : When the win has lost focus. (since 1.8)
* @li "theme,changed" - The theme was changed. (since 1.13)
+ * @li "visibility,changed" - visibility of the window has been changed.
*
* Note that calling evas_object_show() after window contents creation is
* recommended. It will trigger evas_smart_objects_calculate() and some backend