static void _ecore_evas_wl_iconified_set(Ecore_Evas *ee, int iconify);
static void _ecore_evas_wl_maximized_set(Ecore_Evas *ee, int max);
static void _ecore_evas_wl_fullscreen_set(Ecore_Evas *ee, int full);
-static void _ecore_evas_wl_withdrawn_set(Ecore_Evas *ee, int val);
static void _ecore_evas_wl_ignore_events_set(Ecore_Evas *ee, int ignore);
static void _ecore_evas_wl_alpha_set(Ecore_Evas *ee, int alpha);
static void _ecore_evas_wl_transparent_set(Ecore_Evas *ee, int transparent);
static int _ecore_evas_wl_render(Ecore_Evas *ee);
static void _ecore_evas_wl_screen_geometry_get(const Ecore_Evas *ee __UNUSED__, int *x, int *y, int *w, int *h);
static void _ecore_evas_wl_screen_dpi_get(const Ecore_Evas *ee __UNUSED__, int *xdpi, int *ydpi);
-static void _ecore_evas_wl_frame_callback_clean(Ecore_Evas *ee);
static Eina_Bool _ecore_evas_wl_cb_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event);
static Eina_Bool _ecore_evas_wl_cb_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event);
static Eina_Bool _ecore_evas_wl_cb_focus_in(void *data __UNUSED__, int type __UNUSED__, void *event);
_ecore_evas_wl_maximized_set,
_ecore_evas_wl_fullscreen_set,
NULL, // func avoid_damage set
- _ecore_evas_wl_withdrawn_set,
+ NULL, // func withdrawn set
NULL, // func sticky set
_ecore_evas_wl_ignore_events_set,
_ecore_evas_wl_alpha_set,
{
ecore_wl_window_show(ee->engine.wl.win);
ecore_wl_window_update_size(ee->engine.wl.win, ee->w, ee->h);
+ ecore_wl_window_buffer_attach(ee->engine.wl.win, NULL, 0, 0);
+
+ if ((ee->prop.clas) && (ee->engine.wl.win->shell_surface))
+ wl_shell_surface_set_class(ee->engine.wl.win->shell_surface,
+ ee->prop.clas);
+ if ((ee->prop.title) && (ee->engine.wl.win->shell_surface))
+ wl_shell_surface_set_title(ee->engine.wl.win->shell_surface,
+ ee->prop.title);
}
if (ee->engine.wl.frame)
/* printf("Failed to get a Surface from Ecore_Wl\n"); */
}
- /* force an update to push events, especially useful for wayland_egl */
- evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
-
ee->visible = 1;
if (ee->func.fn_show) ee->func.fn_show(ee);
}
ee->visible = 0;
ee->should_be_visible = 0;
- _ecore_evas_wl_frame_callback_clean (ee);
if (ee->func.fn_hide) ee->func.fn_hide(ee);
}
ee->func.fn_state_change(ee);
}
-static void
-_ecore_evas_wl_withdrawn_set(Ecore_Evas *ee, int val)
-{
- LOGFN(__FILE__, __LINE__, __FUNCTION__);
-
- if (val)
- ecore_evas_hide(ee);
- else
- ecore_evas_show(ee);
-}
-
static void
_ecore_evas_wl_ignore_events_set(Ecore_Evas *ee, int ignore)
{
};
static void
-_ecore_evas_wl_frame_callback_clean(Ecore_Evas *ee)
+_ecore_evas_wl_frame_complete(void *data, struct wl_callback *callback, uint32_t time __UNUSED__)
{
+ Ecore_Evas *ee = data;
Ecore_Wl_Window *win = ee->engine.wl.win;
- if (!win->frame_pending)
- return;
- wl_callback_destroy(win->frame_callback);
win->frame_callback = NULL;
- win->frame_pending = EINA_FALSE;
-}
+ win->frame_pending = EINA_FALSE;
+ wl_callback_destroy(callback);
-static void
-_ecore_evas_wl_frame_complete(void *data, struct wl_callback *callback __UNUSED__, uint32_t time __UNUSED__)
-{
- Ecore_Evas *ee = data;
- Ecore_Wl_Window *win = NULL;
-
- if (!ee) return;
-
- _ecore_evas_wl_frame_callback_clean(ee);
-
- if (!(win = ee->engine.wl.win)) return;
-
- if (ecore_wl_window_surface_get(win))
+ if (win->surface)
{
- win->frame_callback =
- wl_surface_frame(ecore_wl_window_surface_get(win));
+ win->frame_callback =
+ wl_surface_frame(win->surface);
wl_callback_add_listener(win->frame_callback,
&frame_listener, ee);
}
if (!ee) return 0;
if (!ee->visible)
- {
- evas_norender(ee->evas);
- return 0;
- }
+ evas_norender(ee->evas);
else
{
Eina_List *ll = NULL, *updates = NULL;
static void _ecore_evas_wl_iconified_set(Ecore_Evas *ee, int iconify);
static void _ecore_evas_wl_maximized_set(Ecore_Evas *ee, int max);
static void _ecore_evas_wl_fullscreen_set(Ecore_Evas *ee, int full);
-static void _ecore_evas_wl_withdrawn_set(Ecore_Evas *ee, int val);
static void _ecore_evas_wl_ignore_events_set(Ecore_Evas *ee, int ignore);
static void _ecore_evas_wl_alpha_set(Ecore_Evas *ee, int alpha);
static void _ecore_evas_wl_transparent_set(Ecore_Evas *ee, int transparent);
static struct wl_shm_pool *_ecore_evas_wl_shm_pool_create(int size, void **data);
static void _ecore_evas_wl_frame_complete(void *data, struct wl_callback *callback, uint32_t tm EINA_UNUSED);
-static void _ecore_evas_wl_frame_callback_clean(Ecore_Evas *ee);
static void _ecore_evas_wl_buffer_new(Ecore_Evas *ee, struct wl_shm_pool *pool);
_ecore_evas_wl_maximized_set,
_ecore_evas_wl_fullscreen_set,
NULL, // func avoid_damage set
- _ecore_evas_wl_withdrawn_set,
+ NULL, // func withdrawn set
NULL, // func sticky set
_ecore_evas_wl_ignore_events_set,
_ecore_evas_wl_alpha_set,
if ((!ee) || (!ee->visible)) return;
+ if (ee->engine.wl.buffer) wl_buffer_destroy(ee->engine.wl.buffer);
+ ee->engine.wl.buffer = NULL;
+
+ munmap(ee->engine.wl.pool_data, ee->engine.wl.pool_size);
+
einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas);
if ((einfo) && (einfo->info.dest))
{
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
}
- if (ee->engine.wl.win)
- ecore_wl_window_hide(ee->engine.wl.win);
+ ecore_wl_window_hide(ee->engine.wl.win);
ee->visible = 0;
ee->should_be_visible = 0;
- _ecore_evas_wl_frame_callback_clean (ee);
if (ee->func.fn_hide) ee->func.fn_hide(ee);
}
ee->func.fn_state_change(ee);
}
-static void
-_ecore_evas_wl_withdrawn_set(Ecore_Evas *ee, int val)
-{
- LOGFN(__FILE__, __LINE__, __FUNCTION__);
-
- if (val)
- ecore_evas_hide(ee);
- else
- ecore_evas_show(ee);
-}
-
static void
_ecore_evas_wl_ignore_events_set(Ecore_Evas *ee, int ignore)
{
}
static void
-_ecore_evas_wl_frame_callback_clean(Ecore_Evas *ee)
-{
- Ecore_Wl_Window *win = ee->engine.wl.win;
-
- if (!win->frame_pending)
- return;
- wl_callback_destroy(win->frame_callback);
- win->frame_callback = NULL;
- win->frame_pending = EINA_FALSE;
-}
-
-static void
-_ecore_evas_wl_frame_complete(void *data, struct wl_callback *callback EINA_UNUSED, uint32_t tm EINA_UNUSED)
+_ecore_evas_wl_frame_complete(void *data, struct wl_callback *callback, uint32_t tm EINA_UNUSED)
{
Ecore_Evas *ee = data;
Ecore_Wl_Window *win = NULL;
if (!ee) return;
if (!(win = ee->engine.wl.win)) return;
- _ecore_evas_wl_frame_callback_clean(ee);
+ win->frame_callback = NULL;
+ win->frame_pending = EINA_FALSE;
+ wl_callback_destroy(callback);
if (win->surface)
{