} policy;
struct
{
+ struct wl_event_queue *queue;
struct screenshooter *screenshooter;
struct tizen_screenshooter *tz_screenshooter;
struct wayland_tbm_client *tbm_client;
EINA_FALSE,
NULL, NULL,
{ NULL, NULL, NULL }, /* tizen_policy protocol */
- { NULL, NULL, NULL, NULL, 0 }, /* screenshooter protocol */
+ { NULL, NULL, NULL, NULL, NULL, 0 }, /* screenshooter protocol */
{ NULL, -1 } /* tizen_input_device_manager protocol */
},
{
{
_eflutil.wl.shot.tz_screenshooter = wl_registry_bind(reg, name, &tizen_screenshooter_interface, version);
tizen_screenshooter_add_listener(_eflutil.wl.shot.tz_screenshooter, &tz_screenshooter_listener, NULL);
+
+ wl_display_roundtrip_queue(_eflutil.wl.dpy, _eflutil.wl.shot.queue);
}
}
if (!_eflutil.wl.shot.screenshooter)
{
- _wl_init();
+ ret = _wl_init();
+ if (ret == (int)EINA_FALSE)
+ {
+ set_last_result(EFL_UTIL_ERROR_INVALID_PARAMETER);
+ return NULL;
+ }
+ wl_display_roundtrip_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
display_wrapper = wl_proxy_create_wrapper(_eflutil.wl.dpy);
EINA_SAFETY_ON_NULL_GOTO(display_wrapper, fail_init);
- wl_proxy_set_queue((struct wl_proxy *)display_wrapper, _eflutil.wl.queue);
+ _eflutil.wl.shot.queue = wl_display_create_queue(_eflutil.wl.dpy);
+ EINA_SAFETY_ON_NULL_GOTO(_eflutil.wl.shot.queue, fail_init);
reg = wl_display_get_registry(display_wrapper);
EINA_SAFETY_ON_NULL_GOTO(reg, fail_init);
+ wl_proxy_set_queue((struct wl_proxy*)reg, _eflutil.wl.shot.queue);
+
wl_registry_add_listener(reg, &_wl_reg_screenshooter_listener, NULL);
- ret = wl_display_roundtrip_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+ ret = wl_display_roundtrip_queue(_eflutil.wl.dpy, _eflutil.wl.shot.queue);
EINA_SAFETY_ON_TRUE_GOTO(ret == -1, fail_init);
EINA_SAFETY_ON_NULL_GOTO(_eflutil.wl.shot.screenshooter, fail_init);
EINA_SAFETY_ON_NULL_GOTO(_eflutil.wl.shot.tz_screenshooter, fail_init);
EINA_SAFETY_ON_NULL_GOTO(_eflutil.wl.shot.tbm_client, fail_init);
}
- wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
- wl_display_roundtrip_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
-
if (_eflutil.wl.shot.noti == 0)
{
fprintf(stderr, "[screenshot] fail: privilege error\n"); /* LCOV_EXCL_LINE */
free(screenshot);
g_screenshot = NULL;
+ if (_eflutil.wl.shot.queue)
+ {
+ wl_event_queue_destroy(_eflutil.wl.shot.queue);
+ _eflutil.wl.shot.queue = NULL;
+ }
+
if (_eflutil.wl.shot.screenshooter)
{
screenshooter_destroy(_eflutil.wl.shot.screenshooter);
screenshot->shot_done = EINA_FALSE;
while (!screenshot->shot_done && ret != -1)
- ret = wl_display_roundtrip_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+ ret = wl_display_roundtrip_queue(_eflutil.wl.dpy, _eflutil.wl.shot.queue);
if (ret == -1)
{