ecore_evas/wayland: Implement borderless_set engine method.

It is needed to set the engine internal borderless property.

Also update the border (frame) object, showing/hiding it as needed, and
updating the framespace size when the frame object is handled by the
engine.
This commit is contained in:
Rafael Antognolli 2013-05-08 19:18:55 -03:00
parent 42788da2ea
commit b259d944ee
4 changed files with 58 additions and 2 deletions

View File

@ -41,6 +41,7 @@ void _ecore_evas_wl_common_render_updates(void *data, Evas *evas EINA_UNUSED, vo
static void _rotation_do(Ecore_Evas *ee, int rotation, int resize);
static void _ecore_evas_wayland_alpha_do(Ecore_Evas *ee, int alpha);
static void _ecore_evas_wayland_transparent_do(Ecore_Evas *ee, int transparent);
static void _ecore_evas_wl_common_border_update(Ecore_Evas *ee);
/* Frame listener */
static void _ecore_evas_wl_frame_complete(void *data, struct wl_callback *callback, uint32_t tm);
@ -194,6 +195,9 @@ _ecore_evas_wl_common_cb_window_configure(void *data EINA_UNUSED, int type EINA_
{
if (ee->func.fn_state_change)
ee->func.fn_state_change(ee);
if (prev_full != ee->prop.fullscreen)
_ecore_evas_wl_common_border_update(ee);
}
if (ee->prop.fullscreen)
@ -809,6 +813,20 @@ _ecore_evas_wl_common_frame_border_size_set(Evas_Object *obj, int fx, int fy, in
evas_object_raise(sd->text);
}
void
_ecore_evas_wl_common_frame_border_size_get(Evas_Object *obj, int *fx, int *fy, int *fw, int *fh)
{
EE_Wl_Smart_Data *sd;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!(sd = evas_object_smart_data_get(obj))) return;
if (fx) *fx = sd->border_size[2];
if (fy) *fy = sd->border_size[0];
if (fw) *fw = sd->border_size[2] + sd->border_size[3];
if (fh) *fh = sd->border_size[0] + sd->border_size[1];
}
void
_ecore_evas_wl_common_raise(Ecore_Evas *ee)
{
@ -989,6 +1007,42 @@ _ecore_evas_wl_common_iconified_set(Ecore_Evas *ee, int iconify)
/* FIXME: Implement this in Wayland someshow */
}
static void
_ecore_evas_wl_common_border_update(Ecore_Evas *ee)
{
Ecore_Evas_Engine_Wl_Data *wdata;
wdata = ee->engine.data;
if (!wdata->frame)
return;
if (ee->prop.borderless || ee->prop.fullscreen)
{
evas_object_hide(wdata->frame);
evas_output_framespace_set(ee->evas, 0, 0, 0, 0);
}
else
{
int fx, fy, fw, fh;
evas_object_show(wdata->frame);
_ecore_evas_wl_common_frame_border_size_get(wdata->frame,
&fx, &fy, &fw, &fh);
evas_output_framespace_set(ee->evas, fx, fy, fw, fh);
}
}
void
_ecore_evas_wl_common_borderless_set(Ecore_Evas *ee, int borderless)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!ee) return;
if (ee->prop.borderless == borderless) return;
ee->prop.borderless = borderless;
_ecore_evas_wl_common_border_update(ee);
}
void
_ecore_evas_wl_common_maximized_set(Ecore_Evas *ee, int max)
{

View File

@ -55,7 +55,7 @@ static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
_ecore_evas_wl_common_layer_set,
NULL, // focus set
_ecore_evas_wl_common_iconified_set,
NULL, // borderless set
_ecore_evas_wl_common_borderless_set,
NULL, // override set
_ecore_evas_wl_common_maximized_set,
_ecore_evas_wl_common_fullscreen_set,

View File

@ -31,6 +31,7 @@ struct _Ecore_Evas_Engine_Wl_Data
{
Ecore_Wl_Window *parent, *win;
Evas_Object *frame;
int fx, fy, fw, fh;
};
Ecore_Evas_Interface_Wayland *_ecore_evas_wl_interface_new(void);
@ -68,6 +69,7 @@ void _ecore_evas_wl_common_screen_geometry_get(const Ecore_Evas *ee, int *x, int
void _ecore_evas_wl_common_screen_dpi_get(const Ecore_Evas *ee, int *xdpi, int *ydpi);
void _ecore_evas_wl_common_render_updates(void *data, Evas *evas, void *event);
void _ecore_evas_wl_common_rotation_set(Ecore_Evas *ee, int rotation, int resize);
void _ecore_evas_wl_common_borderless_set(Ecore_Evas *ee, int borderless);
Evas_Object * _ecore_evas_wl_common_frame_add(Evas *evas);
void _ecore_evas_wl_common_frame_border_size_set(Evas_Object *obj, int fx, int fy, int fw, int fh);

View File

@ -56,7 +56,7 @@ static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
_ecore_evas_wl_common_layer_set,
NULL, // focus set
_ecore_evas_wl_common_iconified_set,
NULL, // borderless set
_ecore_evas_wl_common_borderless_set,
NULL, // override set
_ecore_evas_wl_common_maximized_set,
_ecore_evas_wl_common_fullscreen_set,