_e_comp_wl_cb_read(void *data EINA_UNUSED, Ecore_Fd_Handler *hdlr EINA_UNUSED)
{
/* dispatch pending wayland events */
- wl_event_loop_dispatch(e_comp->wl_comp_data->wl.loop, 0);
+ wl_event_loop_dispatch(e_comp_wl->wl.loop, 0);
return ECORE_CALLBACK_RENEW;
}
_e_comp_wl_cb_prepare(void *data EINA_UNUSED, Ecore_Fd_Handler *hdlr EINA_UNUSED)
{
/* flush pending client events */
- wl_display_flush_clients(e_comp->wl_comp_data->wl.disp);
+ wl_display_flush_clients(e_comp_wl->wl.disp);
}
static Eina_Bool
if (!ec->comp_data->surface) return;
- e_comp->wl_comp_data->ptr.ec = ec;
- if (e_comp->wl_comp_data->drag)
+ e_comp_wl->ptr.ec = ec;
+ if (e_comp_wl->drag)
{
e_comp_wl_data_device_send_enter(ec);
return;
}
- if (!eina_list_count(e_comp->wl_comp_data->ptr.resources)) return;
+ if (!eina_list_count(e_comp_wl->ptr.resources)) return;
wc = wl_resource_get_client(ec->comp_data->surface);
- serial = wl_display_next_serial(e_comp->wl_comp_data->wl.disp);
- EINA_LIST_FOREACH(e_comp->wl_comp_data->ptr.resources, l, res)
+ serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ EINA_LIST_FOREACH(e_comp_wl->ptr.resources, l, res)
{
if (!e_comp_wl_input_pointer_check(res)) continue;
if (wl_resource_get_client(res) != wc) continue;
if (e_comp->pointer->o_ptr != o)
e_pointer_object_set(e_comp->pointer, NULL, 0, 0);
}
- if (e_comp->wl_comp_data->ptr.ec == ec)
- e_comp->wl_comp_data->ptr.ec = NULL;
+ if (e_comp_wl->ptr.ec == ec)
+ e_comp_wl->ptr.ec = NULL;
if (e_object_is_del(E_OBJECT(ec))) return;
if (!ec->comp_data->surface) return;
- if (e_comp->wl_comp_data->drag)
+ if (e_comp_wl->drag)
{
e_comp_wl_data_device_send_leave(ec);
return;
}
- if (!eina_list_count(e_comp->wl_comp_data->ptr.resources)) return;
+ if (!eina_list_count(e_comp_wl->ptr.resources)) return;
wc = wl_resource_get_client(ec->comp_data->surface);
- serial = wl_display_next_serial(e_comp->wl_comp_data->wl.disp);
- EINA_LIST_FOREACH(e_comp->wl_comp_data->ptr.resources, l, res)
+ serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ EINA_LIST_FOREACH(e_comp_wl->ptr.resources, l, res)
{
if (!e_comp_wl_input_pointer_check(res)) continue;
if (wl_resource_get_client(res) != wc) continue;
Eina_List *l;
wc = wl_resource_get_client(ec->comp_data->surface);
- EINA_LIST_FOREACH(e_comp->wl_comp_data->ptr.resources, l, res)
+ EINA_LIST_FOREACH(e_comp_wl->ptr.resources, l, res)
{
if (!e_comp_wl_input_pointer_check(res)) continue;
if (wl_resource_get_client(res) != wc) continue;
if (ec->ignored) return;
if (!ec->comp_data->surface) return;
- if ((!e_comp->wl_comp_data->drag_client) || (!e_client_has_xwindow(e_comp->wl_comp_data->drag_client)))
+ if ((!e_comp_wl->drag_client) || (!e_client_has_xwindow(e_comp_wl->drag_client)))
_e_comp_wl_send_mouse_move(ec, ev->cur.canvas.x, ev->cur.canvas.y, ev->timestamp);
}
if (!ec->comp_data->surface) return;
wc = wl_resource_get_client(ec->comp_data->surface);
- EINA_LIST_FOREACH(e_comp->wl_comp_data->ptr.resources, l, res)
+ EINA_LIST_FOREACH(e_comp_wl->ptr.resources, l, res)
{
if (!e_comp_wl_input_pointer_check(res)) continue;
if (wl_resource_get_client(res) != wc) continue;
if (!ec->comp_data->surface) return;
wc = wl_resource_get_client(ec->comp_data->surface);
- serial = wl_display_next_serial(e_comp->wl_comp_data->wl.disp);
+ serial = wl_display_next_serial(e_comp_wl->wl.disp);
x = wl_fixed_from_int(ev->canvas.x - ec->client.x);
y = wl_fixed_from_int(ev->canvas.y - ec->client.y);
- EINA_LIST_FOREACH(e_comp->wl_comp_data->touch.resources, l, res)
+ EINA_LIST_FOREACH(e_comp_wl->touch.resources, l, res)
{
if (wl_resource_get_client(res) != wc) continue;
if (!e_comp_wl_input_touch_check(res)) continue;
if (!ec->comp_data->surface) return;
wc = wl_resource_get_client(ec->comp_data->surface);
- serial = wl_display_next_serial(e_comp->wl_comp_data->wl.disp);
+ serial = wl_display_next_serial(e_comp_wl->wl.disp);
- EINA_LIST_FOREACH(e_comp->wl_comp_data->touch.resources, l, res)
+ EINA_LIST_FOREACH(e_comp_wl->touch.resources, l, res)
{
if (wl_resource_get_client(res) != wc) continue;
if (!e_comp_wl_input_touch_check(res)) continue;
x = wl_fixed_from_int(ev->cur.canvas.x - ec->client.x);
y = wl_fixed_from_int(ev->cur.canvas.y - ec->client.y);
- EINA_LIST_FOREACH(e_comp->wl_comp_data->touch.resources, l, res)
+ EINA_LIST_FOREACH(e_comp_wl->touch.resources, l, res)
{
if (wl_resource_get_client(res) != wc) continue;
if (!e_comp_wl_input_touch_check(res)) continue;
ec->comp_data->on_focus_timer = NULL;
- if (!e_comp->wl_comp_data->kbd.focused) return EINA_FALSE;
- serial = wl_display_next_serial(e_comp->wl_comp_data->wl.disp);
+ if (!e_comp_wl->kbd.focused) return EINA_FALSE;
+ serial = wl_display_next_serial(e_comp_wl->wl.disp);
t = ecore_time_unix_get();
- EINA_LIST_FOREACH(e_comp->wl_comp_data->kbd.focused, l, res)
- wl_array_for_each(k, &e_comp->wl_comp_data->kbd.keys)
+ EINA_LIST_FOREACH(e_comp_wl->kbd.focused, l, res)
+ wl_array_for_each(k, &e_comp_wl->kbd.keys)
wl_keyboard_send_key(res, serial, t,
*k, WL_KEYBOARD_KEY_STATE_PRESSED);
return EINA_FALSE;
_e_comp_wl_client_priority_raise(ec);
wc = wl_resource_get_client(ec->comp_data->surface);
- EINA_LIST_FOREACH(e_comp->wl_comp_data->kbd.resources, l, res)
+ EINA_LIST_FOREACH(e_comp_wl->kbd.resources, l, res)
if (wl_resource_get_client(res) == wc)
- e_comp->wl_comp_data->kbd.focused = eina_list_append(e_comp->wl_comp_data->kbd.focused, res);
- if (!e_comp->wl_comp_data->kbd.focused) return;
+ e_comp_wl->kbd.focused = eina_list_append(e_comp_wl->kbd.focused, res);
+ if (!e_comp_wl->kbd.focused) return;
e_comp_wl_input_keyboard_enter_send(ec);
e_comp_wl_data_device_keyboard_focus_set();
ec->comp_data->on_focus_timer = ecore_timer_add(0.8, (Ecore_Task_Cb)_e_comp_wl_evas_cb_focus_in_timer, ec);
wl_keyboard_send_key(res, serial, t,
*k, WL_KEYBOARD_KEY_STATE_RELEASED);
wl_keyboard_send_leave(res, serial, ec->comp_data->surface);
- e_comp->wl_comp_data->kbd.focused = eina_list_remove_list(e_comp->wl_comp_data->kbd.focused, l);
+ e_comp_wl->kbd.focused = eina_list_remove_list(e_comp_wl->kbd.focused, l);
}
}
if ((ec->shading) || (ec->shaded)) return;
if (!ec->comp_data->shell.configure_send) return;
- if (e_client_util_resizing_get(ec) && e_comp->wl_comp_data->resize.edges)
+ if (e_client_util_resizing_get(ec) && e_comp_wl->resize.edges)
{
int x, y, ax, ay;
x = E_CLAMP(x, 1, x);
y = E_CLAMP(y, 1, y);
ec->comp_data->shell.configure_send(ec->comp_data->shell.surface,
- e_comp->wl_comp_data->resize.edges,
+ e_comp_wl->resize.edges,
x, y);
}
else if ((!ec->fullscreen) && (!ec->maximized) && (!ec->comp_data->maximize_pre))
ec->comp_data->shell.configure_send(ec->comp_data->shell.surface,
- e_comp->wl_comp_data->resize.edges,
+ e_comp_wl->resize.edges,
ec->client.w, ec->client.h);
}
{
_last_event_time = ecore_loop_time_get();
- e_comp->wl_comp_data->ptr.x = wl_fixed_from_int(ev->x);
- e_comp->wl_comp_data->ptr.y = wl_fixed_from_int(ev->y);
+ e_comp_wl->ptr.x = wl_fixed_from_int(ev->x);
+ e_comp_wl->ptr.y = wl_fixed_from_int(ev->y);
e_screensaver_notidle();
- if (e_comp->wl_comp_data->selection.target &&
- (!e_client_has_xwindow(e_comp->wl_comp_data->selection.target)) &&
- e_comp->wl_comp_data->drag)
+ if (e_comp_wl->selection.target &&
+ (!e_client_has_xwindow(e_comp_wl->selection.target)) &&
+ e_comp_wl->drag)
{
struct wl_resource *res;
int x, y;
- res = e_comp_wl_data_find_for_client(wl_resource_get_client(e_comp->wl_comp_data->selection.target->comp_data->surface));
- x = ev->x - e_comp->wl_comp_data->selection.target->client.x;
- y = ev->y - e_comp->wl_comp_data->selection.target->client.y;
+ res = e_comp_wl_data_find_for_client(wl_resource_get_client(e_comp_wl->selection.target->comp_data->surface));
+ x = ev->x - e_comp_wl->selection.target->client.x;
+ y = ev->y - e_comp_wl->selection.target->client.y;
wl_data_device_send_motion(res, ev->timestamp, wl_fixed_from_int(x), wl_fixed_from_int(y));
}
- if (e_comp->wl_comp_data->drag &&
- e_comp->wl_comp_data->drag_client &&
- e_client_has_xwindow(e_comp->wl_comp_data->drag_client))
- _e_comp_wl_send_mouse_move(e_comp->wl_comp_data->drag_client, ev->x, ev->y, ev->timestamp);
+ if (e_comp_wl->drag &&
+ e_comp_wl->drag_client &&
+ e_client_has_xwindow(e_comp_wl->drag_client))
+ _e_comp_wl_send_mouse_move(e_comp_wl->drag_client, ev->x, ev->y, ev->timestamp);
return ECORE_CALLBACK_RENEW;
}
return;
}
- /* scale = e_comp->wl_comp_data->output.scale; */
- /* switch (e_comp->wl_comp_data->output.transform) */
+ /* scale = e_comp_wl->output.scale; */
+ /* switch (e_comp_wl->output.transform) */
/* { */
/* case WL_OUTPUT_TRANSFORM_90: */
/* case WL_OUTPUT_TRANSFORM_270: */
ecore_evas_pointer_xy_get(e_comp->ee, &ec->mouse.current.mx, &ec->mouse.current.my);
ec->netwm.sync.send_time = ecore_loop_time_get();
}
- if (e_comp->wl_comp_data->drag && e_comp->wl_comp_data->drag_client &&
- (e_comp->wl_comp_data->drag_client == ec))
+ if (e_comp_wl->drag && e_comp_wl->drag_client &&
+ (e_comp_wl->drag_client == ec))
{
- e_comp->wl_comp_data->drag->dx -= state->sx;
- e_comp->wl_comp_data->drag->dy -= state->sy;
- e_drag_move(e_comp->wl_comp_data->drag,
- e_comp->wl_comp_data->drag->x + state->sx, e_comp->wl_comp_data->drag->y + state->sy);
- e_drag_resize(e_comp->wl_comp_data->drag, state->bw, state->bh);
+ e_comp_wl->drag->dx -= state->sx;
+ e_comp_wl->drag->dy -= state->sy;
+ e_drag_move(e_comp_wl->drag,
+ e_comp_wl->drag->x + state->sx, e_comp_wl->drag->y + state->sy);
+ e_drag_resize(e_comp_wl->drag, state->bw, state->bh);
}
else
e_client_util_move_resize_without_frame(ec, x, y, w, h);
DBG("\tUsing Client: %p", ec);
wl_resource_set_user_data(res, ec);
#ifndef HAVE_WAYLAND_ONLY
- EINA_LIST_FOREACH(e_comp->wl_comp_data->xwl_pending, l, wc)
+ EINA_LIST_FOREACH(e_comp_wl->xwl_pending, l, wc)
{
if (!e_pixmap_is_x(wc->pixmap)) continue;
if (wl_resource_get_id(res) != ((E_Comp_X_Client_Data*)wc->comp_data)->surface_id) continue;
}
#endif
/* emit surface create signal */
- wl_signal_emit(&e_comp->wl_comp_data->signals.surface.create, res);
+ wl_signal_emit(&e_comp_wl->signals.surface.create, res);
}
static void
return;
}
- if (e_comp->wl_comp_data->screenshooter.read_pixels)
- e_comp->wl_comp_data->screenshooter.read_pixels(output, pixels);
+ if (e_comp_wl->screenshooter.read_pixels)
+ e_comp_wl->screenshooter.read_pixels(output, pixels);
shm_buffer = wl_shm_buffer_get(buffer->resource);
if (!shm_buffer)
//else if (!ec->icccm.take_focus)
//e_grabinput_focus(e_client_util_win_get(ec), E_FOCUS_METHOD_PASSIVE);
- e_comp->wl_comp_data->kbd.focus = ec->comp_data->surface;
+ e_comp_wl->kbd.focus = ec->comp_data->surface;
}
static void
_e_comp_wl_focus_check();
- if (e_comp->wl_comp_data->kbd.focus == ec->comp_data->surface)
- e_comp->wl_comp_data->kbd.focus = NULL;
+ if (e_comp_wl->kbd.focus == ec->comp_data->surface)
+ e_comp_wl->kbd.focus = NULL;
}
static void
{
if (e_pixmap_type_get(ec->pixmap) != E_PIXMAP_TYPE_WL) return;
- e_comp->wl_comp_data->resize.edges = 0;
+ e_comp_wl->resize.edges = 0;
if (ec->keyboard_resizing) return;
switch (ec->resize_mode)
{
case E_POINTER_RESIZE_T: // 1
- e_comp->wl_comp_data->resize.edges = 1;
+ e_comp_wl->resize.edges = 1;
break;
case E_POINTER_RESIZE_B: // 2
- e_comp->wl_comp_data->resize.edges = 2;
+ e_comp_wl->resize.edges = 2;
break;
case E_POINTER_RESIZE_L: // 4
- e_comp->wl_comp_data->resize.edges = 4;
+ e_comp_wl->resize.edges = 4;
break;
case E_POINTER_RESIZE_R: // 8
- e_comp->wl_comp_data->resize.edges = 8;
+ e_comp_wl->resize.edges = 8;
break;
case E_POINTER_RESIZE_TL: // 5
- e_comp->wl_comp_data->resize.edges = 5;
+ e_comp_wl->resize.edges = 5;
break;
case E_POINTER_RESIZE_TR: // 9
- e_comp->wl_comp_data->resize.edges = 9;
+ e_comp_wl->resize.edges = 9;
break;
case E_POINTER_RESIZE_BL: // 6
- e_comp->wl_comp_data->resize.edges = 6;
+ e_comp_wl->resize.edges = 6;
break;
case E_POINTER_RESIZE_BR: // 10
- e_comp->wl_comp_data->resize.edges = 10;
+ e_comp_wl->resize.edges = 10;
break;
default:
break;
if (e_object_is_del(E_OBJECT(ec))) return;
if (e_pixmap_type_get(ec->pixmap) != E_PIXMAP_TYPE_WL) return;
- e_comp->wl_comp_data->resize.edges = 0;
- e_comp->wl_comp_data->resize.resource = NULL;
+ e_comp_wl->resize.edges = 0;
+ e_comp_wl->resize.resource = NULL;
if (ec->pending_resize)
{
E_API struct wl_signal
e_comp_wl_surface_create_signal_get(void)
{
- return e_comp->wl_comp_data->signals.surface.create;
+ return e_comp_wl->signals.surface.create;
}
/* internal functions */
/* free handlers */
E_FREE_LIST(handlers, ecore_event_handler_del);
- while (e_comp->wl_comp_data->wl.globals)
+ while (e_comp_wl->wl.globals)
{
- Ecore_Wl_Global *global = EINA_INLIST_CONTAINER_GET(e_comp->wl_comp_data->wl.globals, Ecore_Wl_Global);
- e_comp->wl_comp_data->wl.globals =
- eina_inlist_remove(e_comp->wl_comp_data->wl.globals,
- e_comp->wl_comp_data->wl.globals);
+ Ecore_Wl_Global *global = EINA_INLIST_CONTAINER_GET(e_comp_wl->wl.globals, Ecore_Wl_Global);
+ e_comp_wl->wl.globals =
+ eina_inlist_remove(e_comp_wl->wl.globals,
+ e_comp_wl->wl.globals);
free(global->interface);
free(global);
}
- if (e_comp->wl_comp_data->wl.shm) wl_shm_destroy(e_comp->wl_comp_data->wl.shm);
+ if (e_comp_wl->wl.shm) wl_shm_destroy(e_comp_wl->wl.shm);
/* shutdown ecore_wayland */
ecore_wl_shutdown();
uint32_t serial, btn;
struct wl_resource *res;
- if (ec->cur_mouse_action || ec->border_menu || e_comp->wl_comp_data->drag) return EINA_FALSE;
+ if (ec->cur_mouse_action || ec->border_menu || e_comp_wl->drag) return EINA_FALSE;
if (e_object_is_del(E_OBJECT(ec))) return EINA_FALSE;
if (ec->ignored) return EINA_FALSE;
break;
}
- e_comp->wl_comp_data->ptr.button = btn;
+ e_comp_wl->ptr.button = btn;
if (!ec->comp_data->surface) return EINA_FALSE;
- if (!eina_list_count(e_comp->wl_comp_data->ptr.resources))
+ if (!eina_list_count(e_comp_wl->ptr.resources))
return EINA_TRUE;
wc = wl_resource_get_client(ec->comp_data->surface);
- serial = wl_display_next_serial(e_comp->wl_comp_data->wl.disp);
+ serial = wl_display_next_serial(e_comp_wl->wl.disp);
- EINA_LIST_FOREACH(e_comp->wl_comp_data->ptr.resources, l, res)
+ EINA_LIST_FOREACH(e_comp_wl->ptr.resources, l, res)
{
if (wl_resource_get_client(res) != wc) continue;
if (!e_comp_wl_input_pointer_check(res)) continue;
EINTERN void
e_comp_wl_xwayland_client_queue(E_Client *ec)
{
- e_comp->wl_comp_data->xwl_pending = eina_list_append(e_comp->wl_comp_data->xwl_pending, ec);
+ e_comp_wl->xwl_pending = eina_list_append(e_comp_wl->xwl_pending, ec);
}
((E_Comp_Wl_Client_Data*)ec->comp_data)->xwayland_data = cd;
((E_Comp_Wl_Client_Data*)ec->comp_data)->xwayland_pixmap = ep;
}
- if (e_comp->wl_comp_data->xwl_pending)
- e_comp->wl_comp_data->xwl_pending = eina_list_remove(e_comp->wl_comp_data->xwl_pending, ec);
+ if (e_comp_wl->xwl_pending)
+ e_comp_wl->xwl_pending = eina_list_remove(e_comp_wl->xwl_pending, ec);
}
# endif
# endif
if (!(source = (E_Comp_Wl_Data_Source*)data))
return;
- e_comp->wl_comp_data->selection.data_source = NULL;
+ e_comp_wl->selection.data_source = NULL;
- if (e_comp->wl_comp_data->kbd.enabled)
- focus = e_comp->wl_comp_data->kbd.focus;
+ if (e_comp_wl->kbd.enabled)
+ focus = e_comp_wl->kbd.focus;
if (focus)
{
wl_data_device_send_selection(data_device_res, NULL);
}
- wl_signal_emit(&e_comp->wl_comp_data->selection.signal, e_comp->wl_comp_data);
+ wl_signal_emit(&e_comp_wl->selection.signal, e_comp->wl_comp_data);
}
static struct wl_resource*
E_Comp_Wl_Data_Source *sel_source;
struct wl_resource *offer_res, *data_device_res, *focus = NULL;
- sel_source = (E_Comp_Wl_Data_Source*)e_comp->wl_comp_data->selection.data_source;
+ sel_source = (E_Comp_Wl_Data_Source*)e_comp_wl->selection.data_source;
if ((sel_source) &&
- (e_comp->wl_comp_data->selection.serial - serial < UINT32_MAX / 2))
+ (e_comp_wl->selection.serial - serial < UINT32_MAX / 2))
{
/* TODO: elm_entry is sending too many request on now,
* for those requests, selection.signal is being emitted also a lot.
* when it completes to optimize the entry, it should be checked more.
*/
- if (e_comp->wl_comp_data->clipboard.source)
- wl_signal_emit(&e_comp->wl_comp_data->selection.signal, e_comp->wl_comp_data);
+ if (e_comp_wl->clipboard.source)
+ wl_signal_emit(&e_comp_wl->selection.signal, e_comp->wl_comp_data);
return;
}
{
if (sel_source->cancelled)
sel_source->cancelled(sel_source);
- if (!e_comp->wl_comp_data->clipboard.xwl_owner)
- wl_list_remove(&e_comp->wl_comp_data->selection.data_source_listener.link);
- e_comp->wl_comp_data->selection.data_source = NULL;
+ if (!e_comp_wl->clipboard.xwl_owner)
+ wl_list_remove(&e_comp_wl->selection.data_source_listener.link);
+ e_comp_wl->selection.data_source = NULL;
}
- e_comp->wl_comp_data->selection.data_source = sel_source = source;
- e_comp->wl_comp_data->clipboard.xwl_owner = NULL;
- e_comp->wl_comp_data->selection.serial = serial;
+ e_comp_wl->selection.data_source = sel_source = source;
+ e_comp_wl->clipboard.xwl_owner = NULL;
+ e_comp_wl->selection.serial = serial;
- if (e_comp->wl_comp_data->kbd.enabled)
- focus = e_comp->wl_comp_data->kbd.focus;
+ if (e_comp_wl->kbd.enabled)
+ focus = e_comp_wl->kbd.focus;
if (focus)
{
wl_data_device_send_selection(data_device_res, NULL);
}
- wl_signal_emit(&e_comp->wl_comp_data->selection.signal, e_comp->wl_comp_data);
+ wl_signal_emit(&e_comp_wl->selection.signal, e_comp->wl_comp_data);
if (source)
{
- e_comp->wl_comp_data->selection.data_source_listener.notify =
+ e_comp_wl->selection.data_source_listener.notify =
_e_comp_wl_data_device_destroy_selection_data_source;
wl_signal_add(&source->destroy_signal,
- &e_comp->wl_comp_data->selection.data_source_listener);
+ &e_comp_wl->selection.data_source_listener);
}
}
e_zoomap_child_set(o, NULL);
evas_object_hide(o);
evas_object_pass_events_set(o, 1);
- if (e_comp->wl_comp_data->drag != drag) return;
- e_comp->wl_comp_data->drag = NULL;
- e_comp->wl_comp_data->drag_client = NULL;
+ if (e_comp_wl->drag != drag) return;
+ e_comp_wl->drag = NULL;
+ e_comp_wl->drag_client = NULL;
e_screensaver_inhibit_toggle(0);
- if (e_comp->wl_comp_data->selection.target && (!dropped))
+ if (e_comp_wl->selection.target && (!dropped))
{
#ifndef HAVE_WAYLAND_ONLY
- if (e_client_has_xwindow(e_comp->wl_comp_data->selection.target))
+ if (e_client_has_xwindow(e_comp_wl->selection.target))
{
- ecore_x_client_message32_send(e_client_util_win_get(e_comp->wl_comp_data->selection.target),
+ ecore_x_client_message32_send(e_client_util_win_get(e_comp_wl->selection.target),
ECORE_X_ATOM_XDND_DROP, ECORE_X_EVENT_MASK_NONE,
e_comp->cm_selection, 0, ecore_x_current_time_get(), 0, 0);
}
{
struct wl_resource *res;
- res = e_comp_wl_data_find_for_client(wl_resource_get_client(e_comp->wl_comp_data->selection.target->comp_data->surface));
+ res = e_comp_wl_data_find_for_client(wl_resource_get_client(e_comp_wl->selection.target->comp_data->surface));
if (res)
{
wl_data_device_send_drop(res);
ecore_x_window_hide(e_comp->cm_selection);
}
#endif
- e_comp->wl_comp_data->selection.target = NULL;
- e_comp->wl_comp_data->drag_source = NULL;
+ e_comp_wl->selection.target = NULL;
+ e_comp_wl->drag_source = NULL;
}
}
}
DBG("Data Device Drag Start");
- if ((e_comp->wl_comp_data->kbd.focus) && (e_comp->wl_comp_data->kbd.focus != origin_resource)) return;
+ if ((e_comp_wl->kbd.focus) && (e_comp_wl->kbd.focus != origin_resource)) return;
if (!(source = wl_resource_get_user_data(source_resource))) return;
- e_comp->wl_comp_data->drag_source = source;
+ e_comp_wl->drag_source = source;
if (icon_resource)
{
evas_object_layer_set(ec->frame, E_LAYER_CLIENT_DRAG);
e_client_focus_stack_set(eina_list_remove(e_client_focus_stack_get(), ec));
EC_CHANGED(ec);
- e_comp->wl_comp_data->drag_client = ec;
+ e_comp_wl->drag_client = ec;
}
}
- EINA_LIST_FOREACH(e_comp->wl_comp_data->ptr.resources, l, res)
+ EINA_LIST_FOREACH(e_comp_wl->ptr.resources, l, res)
{
if (!e_comp_wl_input_pointer_check(res)) continue;
if (wl_resource_get_client(res) != client) continue;
- wl_pointer_send_leave(res, serial, e_comp->wl_comp_data->kbd.focus);
+ wl_pointer_send_leave(res, serial, e_comp_wl->kbd.focus);
}
evas_pointer_canvas_xy_get(e_comp->evas, &x, &y);
- e_comp->wl_comp_data->drag = e_drag_new(x, y,
+ e_comp_wl->drag = e_drag_new(x, y,
NULL, 0, NULL, 0, NULL, _e_comp_wl_data_device_drag_finished);
- e_comp->wl_comp_data->drag->button_mask = evas_pointer_button_down_mask_get(e_comp->evas);
+ e_comp_wl->drag->button_mask = evas_pointer_button_down_mask_get(e_comp->evas);
if (ec)
- e_drag_object_set(e_comp->wl_comp_data->drag, ec->frame);
- e_drag_start(e_comp->wl_comp_data->drag, x, y);
+ e_drag_object_set(e_comp_wl->drag, ec->frame);
+ e_drag_start(e_comp_wl->drag, x, y);
#ifndef HAVE_WAYLAND_ONLY
if (e_comp_util_has_xwayland())
{
ecore_x_selection_owner_set(e_comp->cm_selection, ECORE_X_ATOM_SELECTION_XDND, ecore_x_current_time_get());
}
#endif
- if (e_comp->wl_comp_data->ptr.ec)
- e_comp_wl_data_device_send_enter(e_comp->wl_comp_data->ptr.ec);
+ if (e_comp_wl->ptr.ec)
+ e_comp_wl_data_device_send_enter(e_comp_wl->ptr.ec);
e_screensaver_inhibit_toggle(1);
e_comp_canvas_feed_mouse_up(0);
}
_e_comp_wl_data_device_cb_unbind(struct wl_resource *resource)
{
struct wl_client *wc = wl_resource_get_client(resource);
- eina_hash_del_by_key(e_comp->wl_comp_data->mgr.data_resources, &wc);
+ eina_hash_del_by_key(e_comp_wl->mgr.data_resources, &wc);
}
static void
return;
}
- eina_hash_add(e_comp->wl_comp_data->mgr.data_resources, &client, res);
+ eina_hash_add(e_comp_wl->mgr.data_resources, &client, res);
wl_resource_set_implementation(res, &_e_data_device_interface, e_comp->wl_comp_data,
_e_comp_wl_data_device_cb_unbind);
}
/* if (!(e_comp->wl_comp_data = wl_resource_get_user_data(resource))) return; */
-/* e_comp->wl_comp_data->mgr.resource = NULL; */
+/* e_comp_wl->mgr.resource = NULL; */
/* } */
static void
struct wl_resource *res;
/* try to create data manager resource */
- e_comp->wl_comp_data->mgr.resource = res = wl_resource_create(client, &wl_data_device_manager_interface, 1, id);
+ e_comp_wl->mgr.resource = res = wl_resource_create(client, &wl_data_device_manager_interface, 1, id);
if (!res)
{
ERR("Could not create data device manager: %m");
int len, size;
- if (!(source = (E_Comp_Wl_Clipboard_Source*)e_comp->wl_comp_data->clipboard.source))
+ if (!(source = (E_Comp_Wl_Clipboard_Source*)e_comp_wl->clipboard.source))
return ECORE_CALLBACK_CANCEL;
/* extend contents buffer */
else if (len < 0)
{
e_comp_wl_clipboard_source_unref(source);
- e_comp->wl_comp_data->clipboard.source = NULL;
+ e_comp_wl->clipboard.source = NULL;
}
else
{
int p[2];
char *mime_type;
- sel_source = (E_Comp_Wl_Data_Source*) e_comp->wl_comp_data->selection.data_source;
- clip_source = (E_Comp_Wl_Clipboard_Source*) e_comp->wl_comp_data->clipboard.source;
+ sel_source = (E_Comp_Wl_Data_Source*) e_comp_wl->selection.data_source;
+ clip_source = (E_Comp_Wl_Clipboard_Source*) e_comp_wl->clipboard.source;
if (!sel_source)
{
if (clip_source)
e_comp_wl_clipboard_source_unref(clip_source);
- e_comp->wl_comp_data->clipboard.source = NULL;
+ e_comp_wl->clipboard.source = NULL;
mime_type = eina_array_data_get(sel_source->mime_types, 0);
if (pipe2(p, O_CLOEXEC) == -1)
sel_source->send(sel_source, mime_type, p[1]);
- e_comp->wl_comp_data->clipboard.source =
+ e_comp_wl->clipboard.source =
e_comp_wl_clipboard_source_create(mime_type,
- e_comp->wl_comp_data->selection.serial, p[0]);
+ e_comp_wl->selection.serial, p[0]);
- if (!e_comp->wl_comp_data->clipboard.source)
+ if (!e_comp_wl->clipboard.source)
close(p[0]);
}
static void
_e_comp_wl_clipboard_create(void)
{
- e_comp->wl_comp_data->clipboard.listener.notify = _e_comp_wl_clipboard_selection_set;
- wl_signal_add(&e_comp->wl_comp_data->selection.signal, &e_comp->wl_comp_data->clipboard.listener);
+ e_comp_wl->clipboard.listener.notify = _e_comp_wl_clipboard_selection_set;
+ wl_signal_add(&e_comp_wl->selection.signal, &e_comp_wl->clipboard.listener);
}
static void
{
E_Client *ec = data;
- if (e_comp->wl_comp_data->selection.target == ec)
- e_comp->wl_comp_data->selection.target = NULL;
+ if (e_comp_wl->selection.target == ec)
+ e_comp_wl->selection.target = NULL;
}
E_API void
uint32_t serial;
int x, y;
- if (e_client_has_xwindow(ec) && e_client_has_xwindow(e_comp->wl_comp_data->drag_client)) return;
+ if (e_client_has_xwindow(ec) && e_client_has_xwindow(e_comp_wl->drag_client)) return;
if (!e_client_has_xwindow(ec))
{
data_device_res =
e_comp_wl_data_find_for_client(wl_resource_get_client(ec->comp_data->surface));
if (!data_device_res) return;
offer_res = e_comp_wl_data_device_send_offer(ec);
- if (e_comp->wl_comp_data->drag_source && (!offer_res)) return;
+ if (e_comp_wl->drag_source && (!offer_res)) return;
}
- e_comp->wl_comp_data->selection.target = ec;
+ e_comp_wl->selection.target = ec;
evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_DEL, _e_comp_wl_data_device_target_del, ec);
#ifndef HAVE_WAYLAND_ONLY
E_Comp_Wl_Data_Source *source;
d2 = d3 = d4 = 0;
- source = e_comp->wl_comp_data->drag_source;
+ source = e_comp_wl->drag_source;
if (eina_array_count(source->mime_types) > 3)
{
return;
}
#endif
- x = wl_fixed_to_int(e_comp->wl_comp_data->ptr.x) - e_comp->wl_comp_data->selection.target->client.x;
- y = wl_fixed_to_int(e_comp->wl_comp_data->ptr.y) - e_comp->wl_comp_data->selection.target->client.y;
- serial = wl_display_next_serial(e_comp->wl_comp_data->wl.disp);
+ x = wl_fixed_to_int(e_comp_wl->ptr.x) - e_comp_wl->selection.target->client.x;
+ y = wl_fixed_to_int(e_comp_wl->ptr.y) - e_comp_wl->selection.target->client.y;
+ serial = wl_display_next_serial(e_comp_wl->wl.disp);
wl_data_device_send_enter(data_device_res, serial, ec->comp_data->surface,
wl_fixed_from_int(x), wl_fixed_from_int(y), offer_res);
}
{
struct wl_resource *res;
- if (e_client_has_xwindow(ec) && e_client_has_xwindow(e_comp->wl_comp_data->drag_client)) return;
+ if (e_client_has_xwindow(ec) && e_client_has_xwindow(e_comp_wl->drag_client)) return;
evas_object_event_callback_del_full(ec->frame, EVAS_CALLBACK_DEL, _e_comp_wl_data_device_target_del, ec);
- if (e_comp->wl_comp_data->selection.target == ec)
- e_comp->wl_comp_data->selection.target = NULL;
+ if (e_comp_wl->selection.target == ec)
+ e_comp_wl->selection.target = NULL;
#ifndef HAVE_WAYLAND_ONLY
if (e_client_has_xwindow(ec))
{
data_device_res =
e_comp_wl_data_find_for_client(wl_resource_get_client(ec->comp_data->surface));
if (!data_device_res) return NULL;
- source = e_comp->wl_comp_data->drag_source;
+ source = e_comp_wl->drag_source;
if (source)
offer_res = _e_comp_wl_data_device_data_offer_create(source, data_device_res);
return offer_res;
struct wl_resource *data_device_res, *offer_res = NULL, *focus;
E_Comp_Wl_Data_Source *source;
- if (!e_comp->wl_comp_data->kbd.enabled)
+ if (!e_comp_wl->kbd.enabled)
{
ERR("Keyboard not enabled");
return;
}
- if (!(focus = e_comp->wl_comp_data->kbd.focus))
+ if (!(focus = e_comp_wl->kbd.focus))
{
ERR("No focused resource");
return;
}
- source = (E_Comp_Wl_Data_Source*)e_comp->wl_comp_data->selection.data_source;
+ source = (E_Comp_Wl_Data_Source*)e_comp_wl->selection.data_source;
#ifndef HAVE_WAYLAND_ONLY
do
{
if (!e_comp_util_has_xwayland()) break;
- if (e_comp->wl_comp_data->clipboard.xwl_owner)
+ if (e_comp_wl->clipboard.xwl_owner)
{
if (e_client_has_xwindow(e_client_focused_get())) return;
break;
e_comp_wl_data_manager_init(void)
{
/* try to create global data manager */
- e_comp->wl_comp_data->mgr.global =
- wl_global_create(e_comp->wl_comp_data->wl.disp, &wl_data_device_manager_interface, 1,
+ e_comp_wl->mgr.global =
+ wl_global_create(e_comp_wl->wl.disp, &wl_data_device_manager_interface, 1,
e_comp->wl_comp_data, _e_comp_wl_data_cb_bind_manager);
- if (!e_comp->wl_comp_data->mgr.global)
+ if (!e_comp_wl->mgr.global)
{
ERR("Could not create global for data device manager: %m");
return EINA_FALSE;
}
- wl_signal_init(&e_comp->wl_comp_data->selection.signal);
+ wl_signal_init(&e_comp_wl->selection.signal);
/* create clipboard */
_e_comp_wl_clipboard_create();
- e_comp->wl_comp_data->mgr.data_resources = eina_hash_pointer_new(NULL);
+ e_comp_wl->mgr.data_resources = eina_hash_pointer_new(NULL);
return EINA_TRUE;
}
e_comp_wl_data_manager_shutdown(void)
{
/* destroy the global manager resource */
- /* if (e_comp->wl_comp_data->mgr.global) wl_global_destroy(e_comp->wl_comp_data->mgr.global); */
+ /* if (e_comp_wl->mgr.global) wl_global_destroy(e_comp_wl->mgr.global); */
- wl_list_remove(&e_comp->wl_comp_data->clipboard.listener.link);
- E_FREE_FUNC(e_comp->wl_comp_data->mgr.data_resources, eina_hash_free);
+ wl_list_remove(&e_comp_wl->clipboard.listener.link);
+ E_FREE_FUNC(e_comp_wl->mgr.data_resources, eina_hash_free);
}
E_API struct wl_resource *
e_comp_wl_data_find_for_client(struct wl_client *client)
{
- return eina_hash_find(e_comp->wl_comp_data->mgr.data_resources, &client);
+ return eina_hash_find(e_comp_wl->mgr.data_resources, &client);
}
E_API E_Comp_Wl_Data_Source *
struct wl_resource *res;
enum wl_seat_capability caps = 0;
- if (e_comp->wl_comp_data->ptr.enabled)
+ if (e_comp_wl->ptr.enabled)
caps |= WL_SEAT_CAPABILITY_POINTER;
- if (e_comp->wl_comp_data->kbd.enabled)
+ if (e_comp_wl->kbd.enabled)
caps |= WL_SEAT_CAPABILITY_KEYBOARD;
- if (e_comp->wl_comp_data->touch.enabled)
+ if (e_comp_wl->touch.enabled)
caps |= WL_SEAT_CAPABILITY_TOUCH;
- EINA_LIST_FOREACH(e_comp->wl_comp_data->seat.resources, l, res)
+ EINA_LIST_FOREACH(e_comp_wl->seat.resources, l, res)
wl_seat_send_capabilities(res, caps);
}
static void
_e_comp_wl_input_cb_pointer_unbind(struct wl_resource *resource)
{
- e_comp->wl_comp_data->ptr.resources =
- eina_list_remove(e_comp->wl_comp_data->ptr.resources, resource);
+ e_comp_wl->ptr.resources =
+ eina_list_remove(e_comp_wl->ptr.resources, resource);
}
static void
if (!res)
{
ERR("Could not create pointer on seat %s: %m",
- e_comp->wl_comp_data->seat.name);
+ e_comp_wl->seat.name);
wl_client_post_no_memory(client);
return;
}
- e_comp->wl_comp_data->ptr.resources =
- eina_list_append(e_comp->wl_comp_data->ptr.resources, res);
+ e_comp_wl->ptr.resources =
+ eina_list_append(e_comp_wl->ptr.resources, res);
wl_resource_set_implementation(res, &_e_pointer_interface,
e_comp->wl_comp_data,
_e_comp_wl_input_cb_pointer_unbind);
Eina_List *l, *ll;
struct wl_resource *res;
- e_comp->wl_comp_data->kbd.resources =
- eina_list_remove(e_comp->wl_comp_data->kbd.resources, resource);
- EINA_LIST_FOREACH_SAFE(e_comp->wl_comp_data->kbd.focused, l, ll, res)
+ e_comp_wl->kbd.resources =
+ eina_list_remove(e_comp_wl->kbd.resources, resource);
+ EINA_LIST_FOREACH_SAFE(e_comp_wl->kbd.focused, l, ll, res)
if (res == resource)
- e_comp->wl_comp_data->kbd.focused =
- eina_list_remove_list(e_comp->wl_comp_data->kbd.resources, l);
+ e_comp_wl->kbd.focused =
+ eina_list_remove_list(e_comp_wl->kbd.resources, l);
}
void
if (!ec->comp_data->surface) return;
- if (!e_comp->wl_comp_data->kbd.focused) return;
+ if (!e_comp_wl->kbd.focused) return;
e_comp_wl_input_keyboard_modifiers_serialize();
- serial = wl_display_next_serial(e_comp->wl_comp_data->wl.disp);
+ serial = wl_display_next_serial(e_comp_wl->wl.disp);
- EINA_LIST_FOREACH(e_comp->wl_comp_data->kbd.focused, l, res)
+ EINA_LIST_FOREACH(e_comp_wl->kbd.focused, l, res)
{
wl_keyboard_send_enter(res, serial, ec->comp_data->surface,
- &e_comp->wl_comp_data->kbd.keys);
+ &e_comp_wl->kbd.keys);
wl_keyboard_send_modifiers(res, serial,
- e_comp->wl_comp_data->kbd.mod_depressed,
- e_comp->wl_comp_data->kbd.mod_latched,
- e_comp->wl_comp_data->kbd.mod_locked,
- e_comp->wl_comp_data->kbd.mod_group);
+ e_comp_wl->kbd.mod_depressed,
+ e_comp_wl->kbd.mod_latched,
+ e_comp_wl->kbd.mod_locked,
+ e_comp_wl->kbd.mod_group);
}
}
if (!res)
{
ERR("Could not create keyboard on seat %s: %m",
- e_comp->wl_comp_data->seat.name);
+ e_comp_wl->seat.name);
wl_client_post_no_memory(client);
return;
}
- e_comp->wl_comp_data->kbd.resources =
- eina_list_append(e_comp->wl_comp_data->kbd.resources, res);
+ e_comp_wl->kbd.resources =
+ eina_list_append(e_comp_wl->kbd.resources, res);
wl_resource_set_implementation(res, &_e_keyboard_interface,
e_comp->wl_comp_data,
_e_comp_wl_input_cb_keyboard_unbind);
/* send current keymap */
wl_keyboard_send_keymap(res, WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1,
- e_comp->wl_comp_data->xkb.fd,
- e_comp->wl_comp_data->xkb.size);
+ e_comp_wl->xkb.fd,
+ e_comp_wl->xkb.size);
/* if the client owns the focused surface, we need to send an enter */
focused = e_client_focused_get();
static void
_e_comp_wl_input_cb_touch_unbind(struct wl_resource *resource)
{
- e_comp->wl_comp_data->touch.resources =
- eina_list_remove(e_comp->wl_comp_data->touch.resources, resource);
+ e_comp_wl->touch.resources =
+ eina_list_remove(e_comp_wl->touch.resources, resource);
}
static void
if (!res)
{
ERR("Could not create touch on seat %s: %m",
- e_comp->wl_comp_data->seat.name);
+ e_comp_wl->seat.name);
wl_client_post_no_memory(client);
return;
}
- e_comp->wl_comp_data->touch.resources =
- eina_list_append(e_comp->wl_comp_data->touch.resources, res);
+ e_comp_wl->touch.resources =
+ eina_list_append(e_comp_wl->touch.resources, res);
wl_resource_set_implementation(res, &_e_touch_interface,
e_comp->wl_comp_data,
_e_comp_wl_input_cb_touch_unbind);
static void
_e_comp_wl_input_cb_unbind_seat(struct wl_resource *resource)
{
- e_comp->wl_comp_data->seat.resources =
- eina_list_remove(e_comp->wl_comp_data->seat.resources, resource);
+ e_comp_wl->seat.resources =
+ eina_list_remove(e_comp_wl->seat.resources, resource);
}
static void
}
/* store version of seat interface for reuse in updating capabilities */
- e_comp->wl_comp_data->seat.version = version;
- e_comp->wl_comp_data->seat.resources =
- eina_list_append(e_comp->wl_comp_data->seat.resources, res);
+ e_comp_wl->seat.version = version;
+ e_comp_wl->seat.resources =
+ eina_list_append(e_comp_wl->seat.resources, res);
wl_resource_set_implementation(res, &_e_seat_interface,
e_comp->wl_comp_data,
_e_comp_wl_input_cb_unbind_seat);
_e_comp_wl_input_update_seat_caps();
- if (e_comp->wl_comp_data->seat.version >= WL_SEAT_NAME_SINCE_VERSION)
- wl_seat_send_name(res, e_comp->wl_comp_data->seat.name);
+ if (e_comp_wl->seat.version >= WL_SEAT_NAME_SINCE_VERSION)
+ wl_seat_send_name(res, e_comp_wl->seat.name);
}
static int
Eina_List *l;
/* unreference any existing keymap */
- if (e_comp->wl_comp_data->xkb.keymap)
- xkb_map_unref(e_comp->wl_comp_data->xkb.keymap);
+ if (e_comp_wl->xkb.keymap)
+ xkb_map_unref(e_comp_wl->xkb.keymap);
/* unmap any existing keyboard area */
- if (e_comp->wl_comp_data->xkb.area)
- munmap(e_comp->wl_comp_data->xkb.area, e_comp->wl_comp_data->xkb.size);
- if (e_comp->wl_comp_data->xkb.fd >= 0) close(e_comp->wl_comp_data->xkb.fd);
+ if (e_comp_wl->xkb.area)
+ munmap(e_comp_wl->xkb.area, e_comp_wl->xkb.size);
+ if (e_comp_wl->xkb.fd >= 0) close(e_comp_wl->xkb.fd);
/* unreference any existing keyboard state */
- if (e_comp->wl_comp_data->xkb.state)
+ if (e_comp_wl->xkb.state)
{
latched =
- xkb_state_serialize_mods(e_comp->wl_comp_data->xkb.state,
+ xkb_state_serialize_mods(e_comp_wl->xkb.state,
XKB_STATE_MODS_LATCHED);
locked =
- xkb_state_serialize_mods(e_comp->wl_comp_data->xkb.state,
+ xkb_state_serialize_mods(e_comp_wl->xkb.state,
XKB_STATE_MODS_LOCKED);
group =
- xkb_state_serialize_layout(e_comp->wl_comp_data->xkb.state,
+ xkb_state_serialize_layout(e_comp_wl->xkb.state,
XKB_STATE_LAYOUT_EFFECTIVE);
- xkb_state_unref(e_comp->wl_comp_data->xkb.state);
+ xkb_state_unref(e_comp_wl->xkb.state);
}
/* create a new xkb state */
- e_comp->wl_comp_data->xkb.state = xkb_state_new(keymap);
+ e_comp_wl->xkb.state = xkb_state_new(keymap);
if ((latched) || (locked) || (group))
- xkb_state_update_mask(e_comp->wl_comp_data->xkb.state, 0,
+ xkb_state_update_mask(e_comp_wl->xkb.state, 0,
latched, locked, 0, 0, group);
/* increment keymap reference */
- e_comp->wl_comp_data->xkb.keymap = xkb_map_ref(keymap);
+ e_comp_wl->xkb.keymap = xkb_map_ref(keymap);
/* fetch updated modifiers */
- e_comp->wl_comp_data->kbd.mod_shift =
+ e_comp_wl->kbd.mod_shift =
xkb_map_mod_get_index(keymap, XKB_MOD_NAME_SHIFT);
- e_comp->wl_comp_data->kbd.mod_caps =
+ e_comp_wl->kbd.mod_caps =
xkb_map_mod_get_index(keymap, XKB_MOD_NAME_CAPS);
- e_comp->wl_comp_data->kbd.mod_ctrl =
+ e_comp_wl->kbd.mod_ctrl =
xkb_map_mod_get_index(keymap, XKB_MOD_NAME_CTRL);
- e_comp->wl_comp_data->kbd.mod_alt =
+ e_comp_wl->kbd.mod_alt =
xkb_map_mod_get_index(keymap, XKB_MOD_NAME_ALT);
- e_comp->wl_comp_data->kbd.mod_super =
+ e_comp_wl->kbd.mod_super =
xkb_map_mod_get_index(keymap, XKB_MOD_NAME_LOGO);
if (!(tmp = xkb_map_get_as_string(keymap)))
return;
}
- e_comp->wl_comp_data->xkb.size = strlen(tmp) + 1;
- e_comp->wl_comp_data->xkb.fd =
- _e_comp_wl_input_keymap_fd_get(e_comp->wl_comp_data->xkb.size);
- if (e_comp->wl_comp_data->xkb.fd < 0)
+ e_comp_wl->xkb.size = strlen(tmp) + 1;
+ e_comp_wl->xkb.fd =
+ _e_comp_wl_input_keymap_fd_get(e_comp_wl->xkb.size);
+ if (e_comp_wl->xkb.fd < 0)
{
ERR("Could not create keymap file");
free(tmp);
return;
}
- e_comp->wl_comp_data->xkb.area =
- mmap(NULL, e_comp->wl_comp_data->xkb.size, (PROT_READ | PROT_WRITE),
- MAP_SHARED, e_comp->wl_comp_data->xkb.fd, 0);
- if (e_comp->wl_comp_data->xkb.area == MAP_FAILED)
+ e_comp_wl->xkb.area =
+ mmap(NULL, e_comp_wl->xkb.size, (PROT_READ | PROT_WRITE),
+ MAP_SHARED, e_comp_wl->xkb.fd, 0);
+ if (e_comp_wl->xkb.area == MAP_FAILED)
{
ERR("Failed to mmap keymap area: %m");
free(tmp);
return;
}
- strcpy(e_comp->wl_comp_data->xkb.area, tmp);
+ strcpy(e_comp_wl->xkb.area, tmp);
free(tmp);
/* send updated keymap */
- EINA_LIST_FOREACH(e_comp->wl_comp_data->kbd.resources, l, res)
+ EINA_LIST_FOREACH(e_comp_wl->kbd.resources, l, res)
wl_keyboard_send_keymap(res, WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1,
- e_comp->wl_comp_data->xkb.fd,
- e_comp->wl_comp_data->xkb.size);
+ e_comp_wl->xkb.fd,
+ e_comp_wl->xkb.size);
/* update modifiers */
e_comp_wl_input_keyboard_modifiers_update();
e_comp_wl_input_init(void)
{
/* set default seat name */
- if (!e_comp->wl_comp_data->seat.name)
- e_comp->wl_comp_data->seat.name = "default";
+ if (!e_comp_wl->seat.name)
+ e_comp_wl->seat.name = "default";
- e_comp->wl_comp_data->xkb.fd = -1;
+ e_comp_wl->xkb.fd = -1;
/* create the global resource for input seat */
- e_comp->wl_comp_data->seat.global =
- wl_global_create(e_comp->wl_comp_data->wl.disp, &wl_seat_interface, 4,
+ e_comp_wl->seat.global =
+ wl_global_create(e_comp_wl->wl.disp, &wl_seat_interface, 4,
e_comp->wl_comp_data, _e_comp_wl_input_cb_bind_seat);
- if (!e_comp->wl_comp_data->seat.global)
+ if (!e_comp_wl->seat.global)
{
ERR("Could not create global for seat: %m");
return EINA_FALSE;
}
- wl_array_init(&e_comp->wl_comp_data->kbd.keys);
+ wl_array_init(&e_comp_wl->kbd.keys);
return EINA_TRUE;
}
struct wl_resource *res;
/* destroy pointer resources */
- EINA_LIST_FREE(e_comp->wl_comp_data->ptr.resources, res)
+ EINA_LIST_FREE(e_comp_wl->ptr.resources, res)
wl_resource_destroy(res);
/* destroy keyboard resources */
- EINA_LIST_FREE(e_comp->wl_comp_data->kbd.resources, res)
+ EINA_LIST_FREE(e_comp_wl->kbd.resources, res)
wl_resource_destroy(res);
- e_comp->wl_comp_data->kbd.resources = eina_list_free(e_comp->wl_comp_data->kbd.resources);
+ e_comp_wl->kbd.resources = eina_list_free(e_comp_wl->kbd.resources);
/* destroy touch resources */
- EINA_LIST_FREE(e_comp->wl_comp_data->touch.resources, res)
+ EINA_LIST_FREE(e_comp_wl->touch.resources, res)
wl_resource_destroy(res);
- /* destroy e_comp->wl_comp_data->kbd.keys array */
- wl_array_release(&e_comp->wl_comp_data->kbd.keys);
+ /* destroy e_comp_wl->kbd.keys array */
+ wl_array_release(&e_comp_wl->kbd.keys);
/* unmap any existing keyboard area */
- if (e_comp->wl_comp_data->xkb.area)
- munmap(e_comp->wl_comp_data->xkb.area, e_comp->wl_comp_data->xkb.size);
- if (e_comp->wl_comp_data->xkb.fd >= 0) close(e_comp->wl_comp_data->xkb.fd);
+ if (e_comp_wl->xkb.area)
+ munmap(e_comp_wl->xkb.area, e_comp_wl->xkb.size);
+ if (e_comp_wl->xkb.fd >= 0) close(e_comp_wl->xkb.fd);
/* unreference any existing keyboard state */
- if (e_comp->wl_comp_data->xkb.state)
- xkb_state_unref(e_comp->wl_comp_data->xkb.state);
+ if (e_comp_wl->xkb.state)
+ xkb_state_unref(e_comp_wl->xkb.state);
/* unreference any existing keymap */
- if (e_comp->wl_comp_data->xkb.keymap)
- xkb_map_unref(e_comp->wl_comp_data->xkb.keymap);
+ if (e_comp_wl->xkb.keymap)
+ xkb_map_unref(e_comp_wl->xkb.keymap);
/* unreference any existing context */
- if (e_comp->wl_comp_data->xkb.context)
- xkb_context_unref(e_comp->wl_comp_data->xkb.context);
+ if (e_comp_wl->xkb.context)
+ xkb_context_unref(e_comp_wl->xkb.context);
/* destroy the global seat resource */
- if (e_comp->wl_comp_data->seat.global)
- wl_global_destroy(e_comp->wl_comp_data->seat.global);
- e_comp->wl_comp_data->seat.global = NULL;
+ if (e_comp_wl->seat.global)
+ wl_global_destroy(e_comp_wl->seat.global);
+ e_comp_wl->seat.global = NULL;
}
EINTERN Eina_Bool
xkb_mod_mask_t mod;
xkb_layout_index_t grp;
- mod = xkb_state_serialize_mods(e_comp->wl_comp_data->xkb.state,
+ mod = xkb_state_serialize_mods(e_comp_wl->xkb.state,
XKB_STATE_DEPRESSED);
- changed |= mod != e_comp->wl_comp_data->kbd.mod_depressed;
- e_comp->wl_comp_data->kbd.mod_depressed = mod;
+ changed |= mod != e_comp_wl->kbd.mod_depressed;
+ e_comp_wl->kbd.mod_depressed = mod;
- mod = xkb_state_serialize_mods(e_comp->wl_comp_data->xkb.state,
+ mod = xkb_state_serialize_mods(e_comp_wl->xkb.state,
XKB_STATE_MODS_LATCHED);
- changed |= mod != e_comp->wl_comp_data->kbd.mod_latched;
- e_comp->wl_comp_data->kbd.mod_latched = mod;
+ changed |= mod != e_comp_wl->kbd.mod_latched;
+ e_comp_wl->kbd.mod_latched = mod;
- mod = xkb_state_serialize_mods(e_comp->wl_comp_data->xkb.state,
+ mod = xkb_state_serialize_mods(e_comp_wl->xkb.state,
XKB_STATE_MODS_LOCKED);
- changed |= mod != e_comp->wl_comp_data->kbd.mod_locked;
- e_comp->wl_comp_data->kbd.mod_locked = mod;
+ changed |= mod != e_comp_wl->kbd.mod_locked;
+ e_comp_wl->kbd.mod_locked = mod;
- grp = xkb_state_serialize_layout(e_comp->wl_comp_data->xkb.state,
+ grp = xkb_state_serialize_layout(e_comp_wl->xkb.state,
XKB_STATE_LAYOUT_EFFECTIVE);
- changed |= grp != e_comp->wl_comp_data->kbd.mod_group;
- e_comp->wl_comp_data->kbd.mod_group = grp;
+ changed |= grp != e_comp_wl->kbd.mod_group;
+ e_comp_wl->kbd.mod_group = grp;
return changed;
}
if (!e_comp_wl_input_keyboard_modifiers_serialize()) return;
- if (!e_comp->wl_comp_data->kbd.focused) return;
+ if (!e_comp_wl->kbd.focused) return;
- serial = wl_display_next_serial(e_comp->wl_comp_data->wl.disp);
- EINA_LIST_FOREACH(e_comp->wl_comp_data->kbd.focused, l, res)
+ serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ EINA_LIST_FOREACH(e_comp_wl->kbd.focused, l, res)
wl_keyboard_send_modifiers(res, serial,
- e_comp->wl_comp_data->kbd.mod_depressed,
- e_comp->wl_comp_data->kbd.mod_latched,
- e_comp->wl_comp_data->kbd.mod_locked,
- e_comp->wl_comp_data->kbd.mod_group);
+ e_comp_wl->kbd.mod_depressed,
+ e_comp_wl->kbd.mod_latched,
+ e_comp_wl->kbd.mod_locked,
+ e_comp_wl->kbd.mod_group);
}
EINTERN void
{
enum xkb_key_direction dir;
- if (!e_comp->wl_comp_data->xkb.state) return;
+ if (!e_comp_wl->xkb.state) return;
if (pressed) dir = XKB_KEY_DOWN;
else dir = XKB_KEY_UP;
- e_comp->wl_comp_data->kbd.mod_changed =
- xkb_state_update_key(e_comp->wl_comp_data->xkb.state, keycode + 8, dir);
+ e_comp_wl->kbd.mod_changed =
+ xkb_state_update_key(e_comp_wl->xkb.state, keycode + 8, dir);
e_comp_wl_input_keyboard_modifiers_update();
}
return;
}
- e_comp->wl_comp_data->ptr.enabled = !!enabled;
+ e_comp_wl->ptr.enabled = !!enabled;
_e_comp_wl_input_update_seat_caps();
}
return;
}
- e_comp->wl_comp_data->kbd.enabled = !!enabled;
+ e_comp_wl->kbd.enabled = !!enabled;
_e_comp_wl_input_update_seat_caps();
}
else names.layout = strdup("us");
/* unreference any existing context */
- if (e_comp->wl_comp_data->xkb.context)
- xkb_context_unref(e_comp->wl_comp_data->xkb.context);
+ if (e_comp_wl->xkb.context)
+ xkb_context_unref(e_comp_wl->xkb.context);
/* create a new xkb context */
- e_comp->wl_comp_data->xkb.context = xkb_context_new(0);
+ e_comp_wl->xkb.context = xkb_context_new(0);
/* fetch new keymap based on names */
- keymap = xkb_map_new_from_names(e_comp->wl_comp_data->xkb.context, &names, 0);
+ keymap = xkb_map_new_from_names(e_comp_wl->xkb.context, &names, 0);
if (keymap)
{
/* update compositor keymap */
return;
}
- e_comp->wl_comp_data->touch.enabled = !!enabled;
+ e_comp_wl->touch.enabled = !!enabled;
_e_comp_wl_input_update_seat_caps();
}
ec->post_move = 0;
ec->post_resize = 0;
}
- if (e_comp->x_comp_data->restack && (!e_comp->new_clients))
+ if (e_comp_x->restack && (!e_comp->new_clients))
{
e_hints_client_stacking_set();
- e_comp->x_comp_data->restack = 0;
+ e_comp_x->restack = 0;
}
_e_comp_x_post_client_idler = NULL;
return EINA_FALSE;
ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE,
0, 0, 0, 0, 0, win, mode);
_e_comp_x_post_client_idler_add(ec);
- e_comp->x_comp_data->restack = 1;
+ e_comp_x->restack = 1;
EINA_LIST_FOREACH(ec->e.state.video_child, l, ec2)
evas_object_stack_below(ec2->frame, ec->frame);
}
ec = _e_comp_x_client_find_by_window(ev->win);
if (!ec)
{
- if (!e_comp->x_comp_data->retry_clients) return ECORE_CALLBACK_RENEW;
- e_comp->x_comp_data->retry_clients = eina_list_remove(e_comp->x_comp_data->retry_clients, (uintptr_t*)(unsigned long)ev->win);
- if (!e_comp->x_comp_data->retry_clients)
- E_FREE_FUNC(e_comp->x_comp_data->retry_timer, ecore_timer_del);
+ if (!e_comp_x->retry_clients) return ECORE_CALLBACK_RENEW;
+ e_comp_x->retry_clients = eina_list_remove(e_comp_x->retry_clients, (uintptr_t*)(unsigned long)ev->win);
+ if (!e_comp_x->retry_clients)
+ E_FREE_FUNC(e_comp_x->retry_timer, ecore_timer_del);
return ECORE_CALLBACK_PASS_ON;
}
if (_e_comp_x_client_data_get(ec))
_e_comp_x_post_client_idler_add(ec);
ec->post_move = 1;
ec->post_resize = 1;
- e_comp->x_comp_data->restack = 1;
+ e_comp_x->restack = 1;
}
}
}
{
uintptr_t *win;
- EINA_LIST_FREE(e_comp->x_comp_data->retry_clients, win)
+ EINA_LIST_FREE(e_comp_x->retry_clients, win)
{
E_Client *ec;
if (ec) _e_comp_x_show_helper(ec);
}
- e_comp->x_comp_data->retry_timer = NULL;
+ e_comp_x->retry_timer = NULL;
return EINA_FALSE;
}
ec = _e_comp_x_client_find_by_window(ev->win);
if (!ec)
{
- if (!e_comp->x_comp_data->retry_clients) return ECORE_CALLBACK_RENEW;
- e_comp->x_comp_data->retry_clients = eina_list_remove(e_comp->x_comp_data->retry_clients, (uintptr_t*)(unsigned long)ev->win);
- if (!e_comp->x_comp_data->retry_clients)
- E_FREE_FUNC(e_comp->x_comp_data->retry_timer, ecore_timer_del);
+ if (!e_comp_x->retry_clients) return ECORE_CALLBACK_RENEW;
+ e_comp_x->retry_clients = eina_list_remove(e_comp_x->retry_clients, (uintptr_t*)(unsigned long)ev->win);
+ if (!e_comp_x->retry_clients)
+ E_FREE_FUNC(e_comp_x->retry_timer, ecore_timer_del);
return ECORE_CALLBACK_PASS_ON;
}
if ((!ec->visible) || (ec->hidden && ec->unredirected_single))
E_Client *wc = NULL;
if (e_comp->comp_type != E_PIXMAP_TYPE_WL) return ECORE_CALLBACK_RENEW;
- res = wl_client_get_object(e_comp->wl_comp_data->xwl_client, ev->data.l[0]);
+ res = wl_client_get_object(e_comp_wl->xwl_client, ev->data.l[0]);
if (res)
wc = wl_resource_get_user_data(res);
if (wc)
_e_comp_x_hook_client_eval_end(void *d EINA_UNUSED, E_Client *ec)
{
E_COMP_X_PIXMAP_CHECK;
- if (e_comp->x_comp_data->restack && (!e_comp->new_clients))
+ if (e_comp_x->restack && (!e_comp->new_clients))
{
e_hints_client_stacking_set();
- e_comp->x_comp_data->restack = 0;
+ e_comp_x->restack = 0;
}
}
static Eina_Bool
_e_comp_x_desklock_key_down(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Key *ev)
{
- return (ev->window == e_comp->x_comp_data->lock_win);
+ return (ev->window == e_comp_x->lock_win);
}
static void
_e_comp_x_desklock_hide(void)
{
- if (e_comp->x_comp_data->lock_win)
+ if (e_comp_x->lock_win)
{
- e_grabinput_release(e_comp->x_comp_data->lock_win, e_comp->x_comp_data->lock_win);
- ecore_x_window_free(e_comp->x_comp_data->lock_win);
- e_comp->x_comp_data->lock_win = 0;
+ e_grabinput_release(e_comp_x->lock_win, e_comp_x->lock_win);
+ ecore_x_window_free(e_comp_x->lock_win);
+ e_comp_x->lock_win = 0;
}
- if (e_comp->x_comp_data->lock_grab_break_wnd)
- ecore_x_window_show(e_comp->x_comp_data->lock_grab_break_wnd);
- e_comp->x_comp_data->lock_grab_break_wnd = 0;
- E_FREE_FUNC(e_comp->x_comp_data->lock_key_handler, ecore_event_handler_del);
+ if (e_comp_x->lock_grab_break_wnd)
+ ecore_x_window_show(e_comp_x->lock_grab_break_wnd);
+ e_comp_x->lock_grab_break_wnd = 0;
+ E_FREE_FUNC(e_comp_x->lock_key_handler, ecore_event_handler_del);
e_comp_override_del();
}
{
Ecore_X_Window win;
- win = e_comp->x_comp_data->lock_win =
+ win = e_comp_x->lock_win =
ecore_x_window_input_new(e_comp->root, 0, 0, 1, 1);
ecore_x_window_show(win);
if (!e_grabinput_get(win, 0, win))
ecore_x_window_hide(windows[i]);
if (e_grabinput_get(win, 0, win))
{
- e_comp->x_comp_data->lock_grab_break_wnd = windows[i];
+ e_comp_x->lock_grab_break_wnd = windows[i];
free(windows);
goto works;
}
}
works:
e_comp_override_add();
- e_comp_ignore_win_add(E_PIXMAP_TYPE_X, e_comp->x_comp_data->lock_win);
- e_comp->x_comp_data->lock_key_handler =
+ e_comp_ignore_win_add(E_PIXMAP_TYPE_X, e_comp_x->lock_win);
+ e_comp_x->lock_key_handler =
ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, (Ecore_Event_Handler_Cb)_e_comp_x_desklock_key_down, e_comp);
return EINA_TRUE;
# ifdef HAVE_WAYLAND
if (e_comp_util_has_xwayland())
{
- if (e_comp->wl_comp_data->drag != _drag_current) return ECORE_CALLBACK_RENEW;
- if (!e_comp->wl_comp_data->ptr.ec) return ECORE_CALLBACK_RENEW;
- if (!e_client_has_xwindow(e_comp->wl_comp_data->ptr.ec)) return ECORE_CALLBACK_RENEW;
- if (e_client_has_xwindow(e_comp->wl_comp_data->drag_client)) return ECORE_CALLBACK_RENEW;
- ecore_x_client_message32_send(e_client_util_win_get(e_comp->wl_comp_data->ptr.ec),
+ if (e_comp_wl->drag != _drag_current) return ECORE_CALLBACK_RENEW;
+ if (!e_comp_wl->ptr.ec) return ECORE_CALLBACK_RENEW;
+ if (!e_client_has_xwindow(e_comp_wl->ptr.ec)) return ECORE_CALLBACK_RENEW;
+ if (e_client_has_xwindow(e_comp_wl->drag_client)) return ECORE_CALLBACK_RENEW;
+ ecore_x_client_message32_send(e_client_util_win_get(e_comp_wl->ptr.ec),
ECORE_X_ATOM_XDND_POSITION, ECORE_X_EVENT_MASK_NONE,
e_comp->cm_selection, 0, ((ev->x << 16) & 0xffff0000) | (ev->y & 0xffff),
ev->timestamp, ECORE_X_ATOM_XDND_ACTION_COPY);
Eina_List *l;
E_Comp_Wl_Output *output;
- EINA_LIST_FOREACH(e_comp->wl_comp_data->outputs, l, output)
+ EINA_LIST_FOREACH(e_comp_wl->outputs, l, output)
output->scale = e_scale;
#else
sh = E_CLAMP(sh, 1, ec->zone->y + ec->zone->h - y);
}
- shm = e_comp->wl_comp_data->wl.shm ?: ecore_wl_shm_get();
+ shm = e_comp_wl->wl.shm ?: ecore_wl_shm_get();
EINA_LIST_FOREACH(_outputs, l, output)
{
Ecore_Wl_Global *global;
struct wl_registry *reg;
- reg = e_comp->wl_comp_data->wl.registry ?: ecore_wl_registry_get();
- if (e_comp->wl_comp_data->wl.registry)
- globals = e_comp->wl_comp_data->wl.globals;
+ reg = e_comp_wl->wl.registry ?: ecore_wl_registry_get();
+ if (e_comp_wl->wl.registry)
+ globals = e_comp_wl->wl.globals;
else
globals = ecore_wl_globals_get();
if (!globals)
{
if (!wl_global_handler)
{
- if (e_comp->wl_comp_data->wl.registry)
+ if (e_comp_wl->wl.registry)
wl_global_handler = ecore_event_handler_add(E_EVENT_WAYLAND_GLOBAL_ADD,
(Ecore_Event_Handler_Cb)_wl_init, NULL);
else
if ((ec->maximized) || (ec->fullscreen)) return;
- switch (e_comp->wl_comp_data->ptr.button)
+ switch (e_comp_wl->ptr.button)
{
case BTN_LEFT:
ev.button = 1;
ev.button = 3;
break;
default:
- ev.button = e_comp->wl_comp_data->ptr.button;
+ ev.button = e_comp_wl->ptr.button;
break;
}
e_comp_object_frame_xy_unadjust(ec->frame,
- wl_fixed_to_int(e_comp->wl_comp_data->ptr.x),
- wl_fixed_to_int(e_comp->wl_comp_data->ptr.y),
+ wl_fixed_to_int(e_comp_wl->ptr.x),
+ wl_fixed_to_int(e_comp_wl->ptr.y),
&ev.canvas.x, &ev.canvas.y);
_e_shell_surface_mouse_down_helper(ec, &ev, EINA_TRUE);
DBG("Comp Resize Edges Set: %d", edges);
- e_comp->wl_comp_data->resize.resource = resource;
- e_comp->wl_comp_data->resize.edges = edges;
- e_comp->wl_comp_data->ptr.grab_x = e_comp->wl_comp_data->ptr.x - wl_fixed_from_int(ec->client.x);
- e_comp->wl_comp_data->ptr.grab_y = e_comp->wl_comp_data->ptr.y - wl_fixed_from_int(ec->client.y);
+ e_comp_wl->resize.resource = resource;
+ e_comp_wl->resize.edges = edges;
+ e_comp_wl->ptr.grab_x = e_comp_wl->ptr.x - wl_fixed_from_int(ec->client.x);
+ e_comp_wl->ptr.grab_y = e_comp_wl->ptr.y - wl_fixed_from_int(ec->client.y);
- switch (e_comp->wl_comp_data->ptr.button)
+ switch (e_comp_wl->ptr.button)
{
case BTN_LEFT:
ev.button = 1;
ev.button = 3;
break;
default:
- ev.button = e_comp->wl_comp_data->ptr.button;
+ ev.button = e_comp_wl->ptr.button;
break;
}
e_comp_object_frame_xy_unadjust(ec->frame,
- wl_fixed_to_int(e_comp->wl_comp_data->ptr.x),
- wl_fixed_to_int(e_comp->wl_comp_data->ptr.y),
+ wl_fixed_to_int(e_comp_wl->ptr.x),
+ wl_fixed_to_int(e_comp_wl->ptr.y),
&ev.canvas.x, &ev.canvas.y);
_e_shell_surface_mouse_down_helper(ec, &ev, EINA_FALSE);
return;
}
- serial = wl_display_next_serial(e_comp->wl_comp_data->wl.disp);
+ serial = wl_display_next_serial(e_comp_wl->wl.disp);
wl_shell_surface_send_ping(ec->comp_data->shell.surface, serial);
}
if (ec->netwm.type != E_WINDOW_TYPE_POPUP_MENU)
{
- serial = wl_display_next_serial(e_comp->wl_comp_data->wl.disp);
+ serial = wl_display_next_serial(e_comp_wl->wl.disp);
xdg_surface_send_configure(resource, width, height, &states, serial);
}
if ((ec->maximized) || (ec->fullscreen)) return;
- switch (e_comp->wl_comp_data->ptr.button)
+ switch (e_comp_wl->ptr.button)
{
case BTN_LEFT:
ev.button = 1;
ev.button = 3;
break;
default:
- ev.button = e_comp->wl_comp_data->ptr.button;
+ ev.button = e_comp_wl->ptr.button;
break;
}
e_comp_object_frame_xy_unadjust(ec->frame,
- wl_fixed_to_int(e_comp->wl_comp_data->ptr.x),
- wl_fixed_to_int(e_comp->wl_comp_data->ptr.y),
+ wl_fixed_to_int(e_comp_wl->ptr.x),
+ wl_fixed_to_int(e_comp_wl->ptr.y),
&ev.canvas.x, &ev.canvas.y);
_e_shell_surface_mouse_down_helper(ec, &ev, EINA_TRUE);
if ((ec->maximized) || (ec->fullscreen)) return;
- e_comp->wl_comp_data->resize.resource = resource;
- e_comp->wl_comp_data->resize.edges = edges;
- e_comp->wl_comp_data->ptr.grab_x = e_comp->wl_comp_data->ptr.x - wl_fixed_from_int(ec->client.x);
- e_comp->wl_comp_data->ptr.grab_y = e_comp->wl_comp_data->ptr.y - wl_fixed_from_int(ec->client.y);
+ e_comp_wl->resize.resource = resource;
+ e_comp_wl->resize.edges = edges;
+ e_comp_wl->ptr.grab_x = e_comp_wl->ptr.x - wl_fixed_from_int(ec->client.x);
+ e_comp_wl->ptr.grab_y = e_comp_wl->ptr.y - wl_fixed_from_int(ec->client.y);
- switch (e_comp->wl_comp_data->ptr.button)
+ switch (e_comp_wl->ptr.button)
{
case BTN_LEFT:
ev.button = 1;
ev.button = 3;
break;
default:
- ev.button = e_comp->wl_comp_data->ptr.button;
+ ev.button = e_comp_wl->ptr.button;
break;
}
e_comp_object_frame_xy_unadjust(ec->frame,
- wl_fixed_to_int(e_comp->wl_comp_data->ptr.x),
- wl_fixed_to_int(e_comp->wl_comp_data->ptr.y),
+ wl_fixed_to_int(e_comp_wl->ptr.x),
+ wl_fixed_to_int(e_comp_wl->ptr.y),
&ev.canvas.x, &ev.canvas.y);
_e_shell_surface_mouse_down_helper(ec, &ev, EINA_FALSE);
return;
}
- if (e_comp->wl_comp_data->shell_interface.xdg_shell)
+ if (e_comp_wl->shell_interface.xdg_shell)
{
- serial = wl_display_next_serial(e_comp->wl_comp_data->wl.disp);
- xdg_shell_send_ping(e_comp->wl_comp_data->shell_interface.xdg_shell, serial);
+ serial = wl_display_next_serial(e_comp_wl->wl.disp);
+ xdg_shell_send_ping(e_comp_wl->shell_interface.xdg_shell, serial);
}
}
static void
_e_xdg_shell_cb_unbind(struct wl_resource *resource EINA_UNUSED)
{
- e_comp->wl_comp_data->shell_interface.xdg_shell = NULL;
+ e_comp_wl->shell_interface.xdg_shell = NULL;
}
static int
static void
_e_shell_cb_unbind(struct wl_resource *resource EINA_UNUSED)
{
- e_comp->wl_comp_data->shell_interface.shell = NULL;
+ e_comp_wl->shell_interface.shell = NULL;
}
static void
return;
}
- e_comp->wl_comp_data->shell_interface.shell = res;
+ e_comp_wl->shell_interface.shell = res;
wl_resource_set_implementation(res, &_e_shell_interface,
e_comp->wl_comp_data,
_e_shell_cb_unbind);
return;
}
- e_comp->wl_comp_data->shell_interface.xdg_shell = res;
+ e_comp_wl->shell_interface.xdg_shell = res;
wl_resource_set_dispatcher(res, _e_xdg_shell_cb_dispatch, NULL,
e_comp->wl_comp_data, NULL);
}
if (!e_comp->wl_comp_data) return NULL;
/* try to create global shell interface */
- if (!wl_global_create(e_comp->wl_comp_data->wl.disp, &wl_shell_interface, 1,
+ if (!wl_global_create(e_comp_wl->wl.disp, &wl_shell_interface, 1,
e_comp->wl_comp_data, _e_shell_cb_bind))
{
ERR("Could not create shell global: %m");
}
/* try to create global xdg_shell interface */
- if (!wl_global_create(e_comp->wl_comp_data->wl.disp, &xdg_shell_interface, 1,
+ if (!wl_global_create(e_comp_wl->wl.disp, &xdg_shell_interface, 1,
e_comp->wl_comp_data, _e_xdg_shell_cb_bind))
{
ERR("Could not create xdg_shell global: %m");
if (!e_comp_wl_init()) return NULL;
if (!e_comp_canvas_init(w, h)) return NULL;
- e_comp->wl_comp_data->screenshooter.read_pixels = _drm_read_pixels;
+ e_comp_wl->screenshooter.read_pixels = _drm_read_pixels;
- ecore_evas_pointer_xy_get(e_comp->ee, &e_comp->wl_comp_data->ptr.x,
- &e_comp->wl_comp_data->ptr.y);
+ ecore_evas_pointer_xy_get(e_comp->ee, &e_comp_wl->ptr.x,
+ &e_comp_wl->ptr.y);
evas_event_feed_mouse_in(e_comp->evas, 0, NULL);
e_comp_wl_input_pointer_enabled_set(EINA_TRUE);
if (!e_comp_wl_init()) return NULL;
if (!e_comp_canvas_init(w * 3 / 4, h * 3 / 4)) return NULL;
- ecore_evas_pointer_xy_get(e_comp->ee, &e_comp->wl_comp_data->ptr.x,
- &e_comp->wl_comp_data->ptr.y);
+ ecore_evas_pointer_xy_get(e_comp->ee, &e_comp_wl->ptr.x,
+ &e_comp_wl->ptr.y);
e_comp_wl_input_pointer_enabled_set(EINA_TRUE);
e_comp_wl_input_keyboard_enabled_set(EINA_TRUE);
e_comp_wl_input_touch_enabled_set(EINA_TRUE);
global->id = id;
global->interface = strdup(interface);
global->version = version;
- e_comp->wl_comp_data->wl.globals = eina_inlist_append(e_comp->wl_comp_data->wl.globals, EINA_INLIST_GET(global));
+ e_comp_wl->wl.globals = eina_inlist_append(e_comp_wl->wl.globals, EINA_INLIST_GET(global));
if (!strcmp(interface, "wl_shm"))
- e_comp->wl_comp_data->wl.shm = wl_registry_bind(registry, id, &wl_shm_interface, 1);
+ e_comp_wl->wl.shm = wl_registry_bind(registry, id, &wl_shm_interface, 1);
ecore_event_add(E_EVENT_WAYLAND_GLOBAL_ADD, NULL, NULL, NULL);
}
Ecore_Wl_Global *global;
Eina_Inlist *tmp;
- EINA_INLIST_FOREACH_SAFE(e_comp->wl_comp_data->wl.globals, tmp, global)
+ EINA_INLIST_FOREACH_SAFE(e_comp_wl->wl.globals, tmp, global)
{
if (global->id != id) continue;
- e_comp->wl_comp_data->wl.globals =
- eina_inlist_remove(e_comp->wl_comp_data->wl.globals, EINA_INLIST_GET(global));
+ e_comp_wl->wl.globals =
+ eina_inlist_remove(e_comp_wl->wl.globals, EINA_INLIST_GET(global));
free(global->interface);
free(global);
}
disp = wl_display_connect(getenv("WAYLAND_DISPLAY"));
ecore_main_fd_handler_add(wl_display_get_fd(disp), ECORE_FD_READ | ECORE_FD_WRITE | ECORE_FD_ERROR,
_ecore_wl_cb_handle_data, NULL, NULL, NULL);
- e_comp->wl_comp_data->wl.registry = wl_display_get_registry(disp);
- wl_registry_add_listener(e_comp->wl_comp_data->wl.registry, &_global_registry_listener, NULL);
+ e_comp_wl->wl.registry = wl_display_get_registry(disp);
+ wl_registry_add_listener(e_comp_wl->wl.registry, &_global_registry_listener, NULL);
ecore_idle_enterer_add(_ecore_wl_cb_idle_enterer, NULL);
}
static void
_xdnd_finish(Eina_Bool success)
{
- ecore_x_client_message32_send(e_client_util_win_get(e_comp->wl_comp_data->drag_client), ECORE_X_ATOM_XDND_FINISHED, ECORE_X_EVENT_MASK_NONE,
+ ecore_x_client_message32_send(e_client_util_win_get(e_comp_wl->drag_client), ECORE_X_ATOM_XDND_FINISHED, ECORE_X_EVENT_MASK_NONE,
e_comp->cm_selection, !!success, (!!success) * ECORE_X_ATOM_XDND_ACTION_COPY, 0, 0);
}
{
ecore_x_window_hide(e_comp->cm_selection);
ecore_x_window_prop_property_del(e_comp->cm_selection, ECORE_X_ATOM_XDND_TYPE_LIST);
- e_comp->wl_comp_data->drag_client = NULL;
- e_comp->wl_comp_data->drag_source = NULL;
+ e_comp_wl->drag_client = NULL;
+ e_comp_wl->drag_source = NULL;
cur_fd = -1;
e_screensaver_inhibit_toggle(0);
}
_xwayland_drop(E_Drag *drag, int dropped)
{
if (e_comp->comp_type != E_PIXMAP_TYPE_WL) return;
- e_comp->wl_comp_data->drag = NULL;
- if ((!e_comp->wl_comp_data->ptr.ec) ||
- (wl_resource_get_client(e_comp->wl_comp_data->ptr.ec->comp_data->surface) != e_comp->wl_comp_data->xwl_client))
- e_comp_wl_evas_handle_mouse_button(e_comp->wl_comp_data->drag_client, 0,
- e_comp->wl_comp_data->ptr.button, WL_POINTER_BUTTON_STATE_RELEASED);
- if (dropped || e_object_is_del(E_OBJECT(drag)) || (!e_comp->wl_comp_data->selection.target))
+ e_comp_wl->drag = NULL;
+ if ((!e_comp_wl->ptr.ec) ||
+ (wl_resource_get_client(e_comp_wl->ptr.ec->comp_data->surface) != e_comp_wl->xwl_client))
+ e_comp_wl_evas_handle_mouse_button(e_comp_wl->drag_client, 0,
+ e_comp_wl->ptr.button, WL_POINTER_BUTTON_STATE_RELEASED);
+ if (dropped || e_object_is_del(E_OBJECT(drag)) || (!e_comp_wl->selection.target))
_xdnd_finish(0);
else
{
struct wl_resource *res;
- res = e_comp_wl_data_find_for_client(wl_resource_get_client(e_comp->wl_comp_data->selection.target->comp_data->surface));
+ res = e_comp_wl_data_find_for_client(wl_resource_get_client(e_comp_wl->selection.target->comp_data->surface));
if (res)
{
wl_data_device_send_drop(res);
_xwayland_target_send(E_Comp_Wl_Data_Source *source EINA_UNUSED, uint32_t serial EINA_UNUSED, const char* mime_type)
{
DBG("XWL Data Source Target Send");
- ecore_x_client_message32_send(e_client_util_win_get(e_comp->wl_comp_data->drag_client), ECORE_X_ATOM_XDND_STATUS, ECORE_X_EVENT_MASK_NONE,
+ ecore_x_client_message32_send(e_client_util_win_get(e_comp_wl->drag_client), ECORE_X_ATOM_XDND_STATUS, ECORE_X_EVENT_MASK_NONE,
e_comp->cm_selection, 2 | !!mime_type, 0, 0, (!!mime_type) * ECORE_X_ATOM_XDND_ACTION_COPY);
}
DBG("XWL Data Source Source Send");
- if (e_comp->wl_comp_data->drag_client)
+ if (e_comp_wl->drag_client)
{
_xdnd_finish(0);
sel = ECORE_X_ATOM_SELECTION_XDND;
_xwayland_cancelled_send(E_Comp_Wl_Data_Source *source EINA_UNUSED)
{
DBG("XWL Data Source Cancelled Send");
- e_object_del(E_OBJECT(e_comp->wl_comp_data->drag));
+ e_object_del(E_OBJECT(e_comp_wl->drag));
}
static Eina_Bool
{
if (ev->owner == e_comp->cm_selection)
{
- e_comp->wl_comp_data->clipboard.xwl_owner = NULL;
+ e_comp_wl->clipboard.xwl_owner = NULL;
return ECORE_CALLBACK_RENEW;
}
if (ev->atom == ECORE_X_ATOM_SELECTION_XDND)
free(data);
}
evas_pointer_canvas_xy_get(e_comp->evas, &x, &y);
- e_comp->wl_comp_data->drag_client = e_pixmap_find_client(E_PIXMAP_TYPE_X, ev->owner);
- e_comp->wl_comp_data->drag = e_drag_new(x, y, names, num, NULL, 0, NULL, _xwayland_drop);
- e_comp->wl_comp_data->drag->button_mask = evas_pointer_button_down_mask_get(e_comp->evas);
+ e_comp_wl->drag_client = e_pixmap_find_client(E_PIXMAP_TYPE_X, ev->owner);
+ e_comp_wl->drag = e_drag_new(x, y, names, num, NULL, 0, NULL, _xwayland_drop);
+ e_comp_wl->drag->button_mask = evas_pointer_button_down_mask_get(e_comp->evas);
ecore_x_window_move_resize(e_comp->cm_selection, 0, 0, e_comp->w, e_comp->h);
ecore_x_window_show(e_comp->cm_selection);
- e_drag_start(e_comp->wl_comp_data->drag, x, y);
- if (e_comp->wl_comp_data->ptr.ec)
- e_comp_wl_data_device_send_enter(e_comp->wl_comp_data->ptr.ec);
+ e_drag_start(e_comp_wl->drag, x, y);
+ if (e_comp_wl->ptr.ec)
+ e_comp_wl_data_device_send_enter(e_comp_wl->ptr.ec);
e_comp_canvas_feed_mouse_up(0);
- source = e_comp_wl_data_manager_source_create(e_comp->wl_comp_data->xwl_client,
- e_comp->wl_comp_data->mgr.resource, 1);
- e_comp->wl_comp_data->drag_source = source;
+ source = e_comp_wl_data_manager_source_create(e_comp_wl->xwl_client,
+ e_comp_wl->mgr.resource, 1);
+ e_comp_wl->drag_source = source;
source->target = _xwayland_target_send;
source->send = _xwayland_send_send;
source->cancelled = _xwayland_cancelled_send;
}
else
{
- if (e_comp->wl_comp_data->drag &&
- e_comp->wl_comp_data->drag_client &&
- e_client_has_xwindow(e_comp->wl_comp_data->drag_client))
- e_object_del(E_OBJECT(e_comp->wl_comp_data->drag));
+ if (e_comp_wl->drag &&
+ e_comp_wl->drag_client &&
+ e_client_has_xwindow(e_comp_wl->drag_client))
+ e_object_del(E_OBJECT(e_comp_wl->drag));
}
e_screensaver_inhibit_toggle(!!ev->owner);
return ECORE_CALLBACK_RENEW;
{
if (ev->owner)
{
- if (e_comp->wl_comp_data->clipboard.source)
- e_comp_wl_clipboard_source_unref(e_comp->wl_comp_data->clipboard.source);
- e_comp->wl_comp_data->clipboard.source = NULL;
- e_comp->wl_comp_data->clipboard.xwl_owner = ev->owner ? e_pixmap_find_client(E_PIXMAP_TYPE_X, ev->owner) : NULL;
+ if (e_comp_wl->clipboard.source)
+ e_comp_wl_clipboard_source_unref(e_comp_wl->clipboard.source);
+ e_comp_wl->clipboard.source = NULL;
+ e_comp_wl->clipboard.xwl_owner = ev->owner ? e_pixmap_find_client(E_PIXMAP_TYPE_X, ev->owner) : NULL;
xconvertselection(ecore_x_display_get(), ECORE_X_ATOM_SELECTION_CLIPBOARD,
ECORE_X_ATOM_SELECTION_TARGETS, xwl_dnd_atom, e_comp->cm_selection, 0);
}
else
- e_comp->wl_comp_data->clipboard.xwl_owner = NULL;
+ e_comp_wl->clipboard.xwl_owner = NULL;
}
return ECORE_CALLBACK_RENEW;
}
DBG("XWL SELECTION NOTIFY");
if ((ev->selection != ECORE_X_SELECTION_XDND) && (ev->selection != ECORE_X_SELECTION_CLIPBOARD))
{
- e_object_del(E_OBJECT(e_comp->wl_comp_data->drag));
+ e_object_del(E_OBJECT(e_comp_wl->drag));
return ECORE_CALLBACK_RENEW;
}
if (ev->selection == ECORE_X_SELECTION_CLIPBOARD)
int i;
source = e_comp_wl_clipboard_source_create(NULL, 0, -1);
- dsource = e_comp_wl_data_manager_source_create(e_comp->wl_comp_data->xwl_client,
- e_comp->wl_comp_data->mgr.resource, 1);
+ dsource = e_comp_wl_data_manager_source_create(e_comp_wl->xwl_client,
+ e_comp_wl->mgr.resource, 1);
source->data_source.mime_types = eina_array_new(tgs->num_targets);
for (i = 0; i < tgs->num_targets; i++)
if (tgs->targets[i])
eina_array_push(source->data_source.mime_types, eina_stringshare_add(tgs->targets[i]));
- e_comp->wl_comp_data->clipboard.source = source;
- e_comp->wl_comp_data->selection.data_source = &source->data_source;
+ e_comp_wl->clipboard.source = source;
+ e_comp_wl->selection.data_source = &source->data_source;
source->data_source.resource = dsource->resource;
source->data_source.send = _xwayland_send_send;
free(dsource);
const char *type;
Eina_Iterator *it = NULL;
- if (e_comp->wl_comp_data->drag_source)
- source = e_comp->wl_comp_data->drag_source;
- else if (e_comp->wl_comp_data->selection.data_source)
- source = e_comp->wl_comp_data->selection.data_source;
+ if (e_comp_wl->drag_source)
+ source = e_comp_wl->drag_source;
+ else if (e_comp_wl->selection.data_source)
+ source = e_comp_wl->selection.data_source;
else
return ECORE_CALLBACK_RENEW;
default:
close(socks[1]);
- e_comp->wl_comp_data->xwl_client = wl_client_create(exs->wl_disp, socks[0]);
+ e_comp_wl->xwl_client = wl_client_create(exs->wl_disp, socks[0]);
close(wms[1]);
exs->wm_fd = wms[0];
return NULL;
/* record wayland display */
- exs->wl_disp = e_comp->wl_comp_data->wl.disp;
+ exs->wl_disp = e_comp_wl->wl.disp;
/* default display to zero */
exs->disp = 0;