forked from enlightenment/efl
win: fix FAKE window geometry updating + resize object adding
users of this will want the win to automatically match the geometry of the ee in all cases fix T2692
This commit is contained in:
parent
72d214a21f
commit
2198490c61
|
@ -3751,12 +3751,10 @@ _elm_win_finalize_internal(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_
|
||||||
ecore_evas_callback_state_change_set(sd->ee, _elm_win_state_change);
|
ecore_evas_callback_state_change_set(sd->ee, _elm_win_state_change);
|
||||||
ecore_evas_callback_focus_in_set(sd->ee, _elm_win_focus_in);
|
ecore_evas_callback_focus_in_set(sd->ee, _elm_win_focus_in);
|
||||||
ecore_evas_callback_focus_out_set(sd->ee, _elm_win_focus_out);
|
ecore_evas_callback_focus_out_set(sd->ee, _elm_win_focus_out);
|
||||||
|
ecore_evas_callback_resize_set(sd->ee, _elm_win_resize);
|
||||||
|
ecore_evas_callback_move_set(sd->ee, _elm_win_move);
|
||||||
if (type != ELM_WIN_FAKE)
|
if (type != ELM_WIN_FAKE)
|
||||||
{
|
ecore_evas_callback_mouse_in_set(sd->ee, _elm_win_mouse_in);
|
||||||
ecore_evas_callback_resize_set(sd->ee, _elm_win_resize);
|
|
||||||
ecore_evas_callback_mouse_in_set(sd->ee, _elm_win_mouse_in);
|
|
||||||
ecore_evas_callback_move_set(sd->ee, _elm_win_move);
|
|
||||||
}
|
|
||||||
evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _elm_win_cb_hide, NULL);
|
evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _elm_win_cb_hide, NULL);
|
||||||
evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _elm_win_cb_show, NULL);
|
evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _elm_win_cb_show, NULL);
|
||||||
|
|
||||||
|
@ -3781,24 +3779,26 @@ _elm_win_finalize_internal(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* do not append to list; all windows render as black rects */
|
/* do not append to list; all windows render as black rects */
|
||||||
if (type == ELM_WIN_FAKE) return obj;
|
if (type != ELM_WIN_FAKE)
|
||||||
_elm_win_list = eina_list_append(_elm_win_list, obj);
|
|
||||||
_elm_win_count++;
|
|
||||||
|
|
||||||
if ((engine) && ((!strcmp(engine, ELM_SOFTWARE_FB)) || (!strcmp(engine, ELM_DRM))))
|
|
||||||
{
|
{
|
||||||
TRAP(sd, fullscreen_set, 1);
|
_elm_win_list = eina_list_append(_elm_win_list, obj);
|
||||||
}
|
_elm_win_count++;
|
||||||
else if ((type != ELM_WIN_INLINED_IMAGE) &&
|
|
||||||
((engine) &&
|
|
||||||
((!strcmp(engine, ELM_WAYLAND_SHM) ||
|
|
||||||
(!strcmp(engine, ELM_WAYLAND_EGL))))))
|
|
||||||
_elm_win_frame_add(sd, "default");
|
|
||||||
|
|
||||||
if (_elm_config->focus_highlight_enable)
|
if ((engine) && ((!strcmp(engine, ELM_SOFTWARE_FB)) || (!strcmp(engine, ELM_DRM))))
|
||||||
elm_win_focus_highlight_enabled_set(obj, EINA_TRUE);
|
{
|
||||||
if (_elm_config->focus_highlight_animate)
|
TRAP(sd, fullscreen_set, 1);
|
||||||
elm_win_focus_highlight_animate_set(obj, EINA_TRUE);
|
}
|
||||||
|
else if ((type != ELM_WIN_INLINED_IMAGE) &&
|
||||||
|
((engine) &&
|
||||||
|
((!strcmp(engine, ELM_WAYLAND_SHM) ||
|
||||||
|
(!strcmp(engine, ELM_WAYLAND_EGL))))))
|
||||||
|
_elm_win_frame_add(sd, "default");
|
||||||
|
|
||||||
|
if (_elm_config->focus_highlight_enable)
|
||||||
|
elm_win_focus_highlight_enabled_set(obj, EINA_TRUE);
|
||||||
|
if (_elm_config->focus_highlight_animate)
|
||||||
|
elm_win_focus_highlight_animate_set(obj, EINA_TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef ELM_DEBUG
|
#ifdef ELM_DEBUG
|
||||||
Evas_Modifier_Mask mask = evas_key_modifier_mask_get(sd->evas, "Control");
|
Evas_Modifier_Mask mask = evas_key_modifier_mask_get(sd->evas, "Control");
|
||||||
|
@ -3811,28 +3811,31 @@ _elm_win_finalize_internal(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_
|
||||||
ERR("failed to grab F12 key to elm widgets (dot) tree generation");
|
ERR("failed to grab F12 key to elm widgets (dot) tree generation");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ((_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_ON) ||
|
if (type != ELM_WIN_FAKE)
|
||||||
((_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_AUTO) &&
|
|
||||||
((engine) &&
|
|
||||||
((!strcmp(engine, ELM_SOFTWARE_FB)) || (!strcmp(engine, ELM_DRM))))))
|
|
||||||
{
|
{
|
||||||
Evas_Object *o;
|
if ((_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_ON) ||
|
||||||
Evas_Coord mw = 1, mh = 1, hx = 0, hy = 0;
|
((_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_AUTO) &&
|
||||||
|
((engine) &&
|
||||||
|
((!strcmp(engine, ELM_SOFTWARE_FB)) || (!strcmp(engine, ELM_DRM))))))
|
||||||
|
{
|
||||||
|
Evas_Object *o;
|
||||||
|
Evas_Coord mw = 1, mh = 1, hx = 0, hy = 0;
|
||||||
|
|
||||||
sd->pointer.obj = o = edje_object_add(ecore_evas_get(tmp_sd.ee));
|
sd->pointer.obj = o = edje_object_add(ecore_evas_get(tmp_sd.ee));
|
||||||
_elm_theme_object_set(obj, o, "pointer", "base", "default");
|
_elm_theme_object_set(obj, o, "pointer", "base", "default");
|
||||||
edje_object_size_min_calc(o, &mw, &mh);
|
edje_object_size_min_calc(o, &mw, &mh);
|
||||||
evas_object_resize(o, mw, mh);
|
evas_object_resize(o, mw, mh);
|
||||||
edje_object_part_geometry_get(o, "elm.swallow.hotspot",
|
edje_object_part_geometry_get(o, "elm.swallow.hotspot",
|
||||||
&hx, &hy, NULL, NULL);
|
&hx, &hy, NULL, NULL);
|
||||||
sd->pointer.hot_x = hx;
|
sd->pointer.hot_x = hx;
|
||||||
sd->pointer.hot_y = hy;
|
sd->pointer.hot_y = hy;
|
||||||
evas_object_show(o);
|
evas_object_show(o);
|
||||||
ecore_evas_object_cursor_set(tmp_sd.ee, o, EVAS_LAYER_MAX, hx, hy);
|
ecore_evas_object_cursor_set(tmp_sd.ee, o, EVAS_LAYER_MAX, hx, hy);
|
||||||
}
|
}
|
||||||
else if (_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_OFF)
|
else if (_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_OFF)
|
||||||
{
|
{
|
||||||
// do nothing
|
// do nothing
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sd->edje = edje_object_add(sd->evas);
|
sd->edje = edje_object_add(sd->evas);
|
||||||
|
@ -3843,9 +3846,12 @@ _elm_win_finalize_internal(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_
|
||||||
edje_object_part_swallow(sd->edje, "elm.swallow.contents", sd->box);
|
edje_object_part_swallow(sd->edje, "elm.swallow.contents", sd->box);
|
||||||
evas_object_move(sd->edje, 0, 0);
|
evas_object_move(sd->edje, 0, 0);
|
||||||
evas_object_resize(sd->edje, 1, 1);
|
evas_object_resize(sd->edje, 1, 1);
|
||||||
edje_object_update_hints_set(sd->edje, EINA_TRUE);
|
if (type != ELM_WIN_FAKE)
|
||||||
evas_object_event_callback_add(sd->edje, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
{
|
||||||
_elm_win_on_resize_obj_changed_size_hints, obj);
|
edje_object_update_hints_set(sd->edje, EINA_TRUE);
|
||||||
|
evas_object_event_callback_add(sd->edje, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||||
|
_elm_win_on_resize_obj_changed_size_hints, obj);
|
||||||
|
}
|
||||||
|
|
||||||
eo_do(obj, elm_interface_atspi_accessible_role_set(ELM_ATSPI_ROLE_WINDOW));
|
eo_do(obj, elm_interface_atspi_accessible_role_set(ELM_ATSPI_ROLE_WINDOW));
|
||||||
if (_elm_config->atspi_mode == ELM_ATSPI_MODE_ON)
|
if (_elm_config->atspi_mode == ELM_ATSPI_MODE_ON)
|
||||||
|
@ -3855,7 +3861,11 @@ _elm_win_finalize_internal(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_
|
||||||
|
|
||||||
eo_do(obj, eo_event_callback_add(EO_EV_CALLBACK_ADD, _cb_added, sd),
|
eo_do(obj, eo_event_callback_add(EO_EV_CALLBACK_ADD, _cb_added, sd),
|
||||||
eo_event_callback_add(EO_EV_CALLBACK_DEL, _cb_deled, sd));
|
eo_event_callback_add(EO_EV_CALLBACK_DEL, _cb_deled, sd));
|
||||||
|
if (type == ELM_WIN_FAKE)
|
||||||
|
{
|
||||||
|
_elm_win_resize_job(obj);
|
||||||
|
_elm_win_move(sd->ee);
|
||||||
|
}
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue