forked from enlightenment/enlightenment
Compare commits
17 Commits
master
...
devs/devil
Author | SHA1 | Date |
---|---|---|
Chris Michael | c74e7102d3 | |
Chris Michael | efa015f926 | |
Mike Blumenkrantz | 1411222a7a | |
Mike Blumenkrantz | 3f57674e35 | |
Chris Michael | cbed2658b1 | |
Chris Michael | 5c2b91e7b2 | |
Chris Michael | fb5fce9720 | |
Chris Michael | 7e0c617fa5 | |
Chris Michael | 9aa851f4fb | |
Chris Michael | 9db7ce3c0a | |
Chris Michael | d0e7e77187 | |
Chris Michael | 7f468681ae | |
Chris Michael | 5bbbd488d2 | |
Chris Michael | 4a70c192ca | |
Chris Michael | 6b25e902c7 | |
Chris Michael | 5ab2de727b | |
Chris Michael | 8fcdf3cb9f |
|
@ -742,7 +742,7 @@ AC_MSG_CHECKING([whether wayland EGL support is enabled])
|
||||||
AC_MSG_RESULT([${e_cv_want_wayland_egl}])
|
AC_MSG_RESULT([${e_cv_want_wayland_egl}])
|
||||||
|
|
||||||
if test "x${e_cv_want_wayland_only}" != "xno" ;then
|
if test "x${e_cv_want_wayland_only}" != "xno" ;then
|
||||||
PKG_CHECK_MODULES([WAYLAND], [ecore-wayland >= 1.16 wayland-server >= 1.8.0 wayland-client >= 1.8.0 xkbcommon uuid],
|
PKG_CHECK_MODULES([WAYLAND], [ecore-wl2 wayland-server >= 1.8.0 wayland-client >= 1.8.0 xkbcommon uuid],
|
||||||
[
|
[
|
||||||
have_wayland=yes
|
have_wayland=yes
|
||||||
AC_DEFINE_UNQUOTED([HAVE_WAYLAND],[1],[enable wayland support])
|
AC_DEFINE_UNQUOTED([HAVE_WAYLAND],[1],[enable wayland support])
|
||||||
|
@ -859,7 +859,7 @@ WL_WEEKEYBOARD=false
|
||||||
define([CHECK_MODULE_WL_WEEKEYBOARD],
|
define([CHECK_MODULE_WL_WEEKEYBOARD],
|
||||||
[
|
[
|
||||||
if test "x${have_wayland}" = "xyes" ; then
|
if test "x${have_wayland}" = "xyes" ; then
|
||||||
AC_E_CHECK_PKG(WL_WEEKEYBOARD, [ eina >= 1.8.0 evas >= 1.8.0 ecore >= 1.8.0 ecore-evas >= 1.8.0 ecore-wayland >= 1.8.0 edje >= 1.8.0 ], [WL_WEEKEYBOARD=true], [WL_WEEKEYBOARD=false])
|
AC_E_CHECK_PKG(WL_WEEKEYBOARD, [ eina >= 1.8.0 evas >= 1.8.0 ecore >= 1.8.0 ecore-evas >= 1.8.0 ecore-wl2 >= 1.8.0 edje >= 1.8.0 ], [WL_WEEKEYBOARD=true], [WL_WEEKEYBOARD=false])
|
||||||
else
|
else
|
||||||
WL_WEEKEYBOARD=false
|
WL_WEEKEYBOARD=false
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -127,7 +127,7 @@ void *alloca (size_t);
|
||||||
# include <Elementary.h>
|
# include <Elementary.h>
|
||||||
|
|
||||||
# ifdef HAVE_WAYLAND
|
# ifdef HAVE_WAYLAND
|
||||||
# include <Ecore_Wayland.h>
|
# include <Ecore_Wl2.h>
|
||||||
# include <uuid.h>
|
# include <uuid.h>
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#define COMPOSITOR_VERSION 3
|
#define COMPOSITOR_VERSION 3
|
||||||
|
|
||||||
E_API int E_EVENT_WAYLAND_GLOBAL_ADD = -1;
|
E_API int E_EVENT_WAYLAND_GLOBAL_ADD = -1;
|
||||||
|
|
||||||
#include "session-recovery-server-protocol.h"
|
#include "session-recovery-server-protocol.h"
|
||||||
|
|
||||||
#ifndef EGL_HEIGHT
|
#ifndef EGL_HEIGHT
|
||||||
|
@ -69,27 +70,11 @@ _e_comp_wl_focus_check(void)
|
||||||
e_grabinput_focus(e_comp->ee_win, E_FOCUS_METHOD_PASSIVE);
|
e_grabinput_focus(e_comp->ee_win, E_FOCUS_METHOD_PASSIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
/* static void */
|
||||||
_e_comp_wl_log_cb_print(const char *format, va_list args)
|
/* _e_comp_wl_log_cb_print(const char *format, va_list args) */
|
||||||
{
|
/* { */
|
||||||
EINA_LOG_DOM_INFO(e_log_dom, format, args);
|
/* EINA_LOG_DOM_INFO(e_log_dom, format, args); */
|
||||||
}
|
/* } */
|
||||||
|
|
||||||
static Eina_Bool
|
|
||||||
_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->wl.loop, 0);
|
|
||||||
|
|
||||||
return ECORE_CALLBACK_RENEW;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_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->wl.disp);
|
|
||||||
}
|
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_e_comp_wl_cb_module_idle(void *data EINA_UNUSED)
|
_e_comp_wl_cb_module_idle(void *data EINA_UNUSED)
|
||||||
|
@ -1599,7 +1584,7 @@ _e_comp_wl_compositor_cb_del(void *data EINA_UNUSED)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* delete fd handler */
|
/* delete fd handler */
|
||||||
if (e_comp_wl->fd_hdlr) ecore_main_fd_handler_del(e_comp_wl->fd_hdlr);
|
/* if (e_comp_wl->fd_hdlr) ecore_main_fd_handler_del(e_comp_wl->fd_hdlr); */
|
||||||
|
|
||||||
/* free allocated data structure */
|
/* free allocated data structure */
|
||||||
free(e_comp_wl);
|
free(e_comp_wl);
|
||||||
|
@ -2459,8 +2444,6 @@ static Eina_Bool
|
||||||
_e_comp_wl_compositor_create(void)
|
_e_comp_wl_compositor_create(void)
|
||||||
{
|
{
|
||||||
E_Comp_Wl_Data *cdata;
|
E_Comp_Wl_Data *cdata;
|
||||||
const char *name;
|
|
||||||
int fd = 0;
|
|
||||||
|
|
||||||
/* check for existing compositor. create if needed */
|
/* check for existing compositor. create if needed */
|
||||||
if (e_comp->comp_type == E_PIXMAP_TYPE_NONE)
|
if (e_comp->comp_type == E_PIXMAP_TYPE_NONE)
|
||||||
|
@ -2477,24 +2460,25 @@ _e_comp_wl_compositor_create(void)
|
||||||
e_comp_wl = e_comp->wl_comp_data = cdata;
|
e_comp_wl = e_comp->wl_comp_data = cdata;
|
||||||
|
|
||||||
/* set wayland log handler */
|
/* set wayland log handler */
|
||||||
wl_log_set_handler_server(_e_comp_wl_log_cb_print);
|
/* wl_log_set_handler_server(_e_comp_wl_log_cb_print); */
|
||||||
|
|
||||||
/* try to create a wayland display */
|
/* try to create an ecore_wl2 display */
|
||||||
if (!(cdata->wl.disp = wl_display_create()))
|
cdata->ewd = ecore_wl2_display_create(NULL);
|
||||||
|
if (!cdata->ewd)
|
||||||
|
{
|
||||||
|
ERR("Could not create a Wayland display: %m");
|
||||||
|
free(cdata);
|
||||||
|
return EINA_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
cdata->wl.disp = ecore_wl2_display_get(cdata->ewd);
|
||||||
|
if (!cdata->wl.disp)
|
||||||
{
|
{
|
||||||
ERR("Could not create a Wayland display: %m");
|
ERR("Could not create a Wayland display: %m");
|
||||||
goto disp_err;
|
goto disp_err;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* try to setup wayland socket */
|
/* e_env_set("WAYLAND_DISPLAY", name); */
|
||||||
if (!(name = wl_display_add_socket_auto(cdata->wl.disp)))
|
|
||||||
{
|
|
||||||
ERR("Could not create Wayland display socket: %m");
|
|
||||||
goto sock_err;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* set wayland display environment variable */
|
|
||||||
e_env_set("WAYLAND_DISPLAY", name);
|
|
||||||
|
|
||||||
/* initialize compositor signals */
|
/* initialize compositor signals */
|
||||||
wl_signal_init(&cdata->signals.surface.create);
|
wl_signal_init(&cdata->signals.surface.create);
|
||||||
|
@ -2595,19 +2579,7 @@ _e_comp_wl_compositor_create(void)
|
||||||
e_comp_wl_input_keymap_set(rules, model, layout);
|
e_comp_wl_input_keymap_set(rules, model, layout);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
e_comp_wl->wl.client_disp = ecore_wl2_display_connect(NULL);
|
||||||
/* get the wayland display loop */
|
|
||||||
cdata->wl.loop = wl_display_get_event_loop(cdata->wl.disp);
|
|
||||||
|
|
||||||
/* get the file descriptor of the wayland event loop */
|
|
||||||
fd = wl_event_loop_get_fd(cdata->wl.loop);
|
|
||||||
|
|
||||||
/* create a listener for wayland main loop events */
|
|
||||||
cdata->fd_hdlr =
|
|
||||||
ecore_main_fd_handler_add(fd, (ECORE_FD_READ | ECORE_FD_ERROR),
|
|
||||||
_e_comp_wl_cb_read, cdata, NULL, NULL);
|
|
||||||
ecore_main_fd_handler_prepare_callback_set(cdata->fd_hdlr,
|
|
||||||
_e_comp_wl_cb_prepare, cdata);
|
|
||||||
|
|
||||||
/* setup module idler to load shell mmodule */
|
/* setup module idler to load shell mmodule */
|
||||||
ecore_idler_add(_e_comp_wl_cb_module_idle, cdata);
|
ecore_idler_add(_e_comp_wl_cb_module_idle, cdata);
|
||||||
|
@ -2625,9 +2597,9 @@ input_err:
|
||||||
e_comp_wl_data_manager_shutdown();
|
e_comp_wl_data_manager_shutdown();
|
||||||
data_err:
|
data_err:
|
||||||
comp_global_err:
|
comp_global_err:
|
||||||
e_env_unset("WAYLAND_DISPLAY");
|
/* e_env_unset("WAYLAND_DISPLAY"); */
|
||||||
sock_err:
|
/* sock_err: */
|
||||||
wl_display_destroy(cdata->wl.disp);
|
ecore_wl2_display_destroy(cdata->ewd);
|
||||||
disp_err:
|
disp_err:
|
||||||
free(cdata);
|
free(cdata);
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
|
@ -2685,6 +2657,13 @@ _e_comp_wl_gl_init(void *d EINA_UNUSED)
|
||||||
E_API Eina_Bool
|
E_API Eina_Bool
|
||||||
e_comp_wl_init(void)
|
e_comp_wl_init(void)
|
||||||
{
|
{
|
||||||
|
/* try to init ecore_wayland */
|
||||||
|
if (!ecore_wl2_init())
|
||||||
|
{
|
||||||
|
e_error_message_show(_("Enlightenment cannot initialize Ecore_Wl2!\n"));
|
||||||
|
return EINA_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/* set gl available if we have ecore_evas support */
|
/* set gl available if we have ecore_evas support */
|
||||||
if (ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_WAYLAND_EGL) ||
|
if (ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_WAYLAND_EGL) ||
|
||||||
ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_OPENGL_DRM))
|
ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_OPENGL_DRM))
|
||||||
|
@ -2697,15 +2676,6 @@ e_comp_wl_init(void)
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
ecore_wl_server_mode_set(1);
|
|
||||||
|
|
||||||
/* try to init ecore_wayland */
|
|
||||||
if (!ecore_wl_init(NULL))
|
|
||||||
{
|
|
||||||
e_error_message_show(_("Enlightenment cannot initialize Ecore_Wayland!\n"));
|
|
||||||
return EINA_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* create hash to store clients */
|
/* create hash to store clients */
|
||||||
/* clients_win_hash = eina_hash_int64_new(NULL); */
|
/* clients_win_hash = eina_hash_int64_new(NULL); */
|
||||||
|
|
||||||
|
@ -2774,24 +2744,27 @@ e_comp_wl_shutdown(void)
|
||||||
/* free handlers */
|
/* free handlers */
|
||||||
E_FREE_LIST(handlers, ecore_event_handler_del);
|
E_FREE_LIST(handlers, ecore_event_handler_del);
|
||||||
|
|
||||||
while (e_comp_wl->wl.globals)
|
/* while (e_comp_wl->wl.globals) */
|
||||||
{
|
/* { */
|
||||||
Ecore_Wl_Global *global;
|
/* Ecore_Wl_Global *global; */
|
||||||
|
|
||||||
global =
|
/* global = */
|
||||||
EINA_INLIST_CONTAINER_GET(e_comp_wl->wl.globals, Ecore_Wl_Global);
|
/* EINA_INLIST_CONTAINER_GET(e_comp_wl->wl.globals, Ecore_Wl_Global); */
|
||||||
|
|
||||||
e_comp_wl->wl.globals =
|
/* e_comp_wl->wl.globals = */
|
||||||
eina_inlist_remove(e_comp_wl->wl.globals, e_comp_wl->wl.globals);
|
/* eina_inlist_remove(e_comp_wl->wl.globals, e_comp_wl->wl.globals); */
|
||||||
|
|
||||||
|
/* free(global->interface); */
|
||||||
|
/* free(global); */
|
||||||
|
/* } */
|
||||||
|
|
||||||
free(global->interface);
|
|
||||||
free(global);
|
|
||||||
}
|
|
||||||
if (e_comp_wl->wl.shm) wl_shm_destroy(e_comp_wl->wl.shm);
|
if (e_comp_wl->wl.shm) wl_shm_destroy(e_comp_wl->wl.shm);
|
||||||
_e_comp_wl_gl_shutdown();
|
_e_comp_wl_gl_shutdown();
|
||||||
|
|
||||||
|
ecore_wl2_display_destroy(e_comp_wl->ewd);
|
||||||
|
|
||||||
/* shutdown ecore_wayland */
|
/* shutdown ecore_wayland */
|
||||||
ecore_wl_shutdown();
|
ecore_wl2_shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
EINTERN struct wl_resource *
|
EINTERN struct wl_resource *
|
||||||
|
|
|
@ -98,11 +98,14 @@ struct _E_Comp_Wl_Subsurf_Data
|
||||||
|
|
||||||
struct _E_Comp_Wl_Data
|
struct _E_Comp_Wl_Data
|
||||||
{
|
{
|
||||||
|
Ecore_Wl2_Display *ewd;
|
||||||
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
struct wl_display *disp;
|
struct wl_display *disp;
|
||||||
|
Ecore_Wl2_Display *client_disp;
|
||||||
struct wl_registry *registry; // only used for nested wl compositors
|
struct wl_registry *registry; // only used for nested wl compositors
|
||||||
struct wl_event_loop *loop;
|
/* struct wl_event_loop *loop; */
|
||||||
Eina_Inlist *globals; // only used for nested wl compositors
|
Eina_Inlist *globals; // only used for nested wl compositors
|
||||||
struct wl_shm *shm; // only used for nested wl compositors
|
struct wl_shm *shm; // only used for nested wl compositors
|
||||||
Evas_GL *gl;
|
Evas_GL *gl;
|
||||||
|
|
|
@ -263,7 +263,6 @@ _e_comp_wl_data_device_selection_set(void *data EINA_UNUSED, E_Comp_Wl_Data_Sour
|
||||||
_e_comp_wl_data_device_data_offer_create(source,
|
_e_comp_wl_data_device_data_offer_create(source,
|
||||||
data_device_res);
|
data_device_res);
|
||||||
wl_data_device_send_selection(data_device_res, offer_res);
|
wl_data_device_send_selection(data_device_res, offer_res);
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (data_device_res)
|
else if (data_device_res)
|
||||||
wl_data_device_send_selection(data_device_res, NULL);
|
wl_data_device_send_selection(data_device_res, NULL);
|
||||||
|
@ -302,8 +301,10 @@ _e_comp_wl_data_device_drag_finished(E_Drag *drag, int dropped)
|
||||||
if (e_client_has_xwindow(e_comp_wl->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->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,
|
ECORE_X_ATOM_XDND_DROP,
|
||||||
e_comp->cm_selection, 0, ecore_x_current_time_get(), 0, 0);
|
ECORE_X_EVENT_MASK_NONE,
|
||||||
|
e_comp->cm_selection, 0,
|
||||||
|
ecore_x_current_time_get(), 0, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
|
@ -319,7 +320,8 @@ _e_comp_wl_data_device_drag_finished(E_Drag *drag, int dropped)
|
||||||
#ifndef HAVE_WAYLAND_ONLY
|
#ifndef HAVE_WAYLAND_ONLY
|
||||||
if (e_comp_util_has_xwayland())
|
if (e_comp_util_has_xwayland())
|
||||||
{
|
{
|
||||||
ecore_x_selection_owner_set(0, ECORE_X_ATOM_SELECTION_XDND, ecore_x_current_time_get());
|
ecore_x_selection_owner_set(0, ECORE_X_ATOM_SELECTION_XDND,
|
||||||
|
ecore_x_current_time_get());
|
||||||
ecore_x_window_hide(e_comp->cm_selection);
|
ecore_x_window_hide(e_comp->cm_selection);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -340,7 +342,8 @@ _e_comp_wl_data_device_cb_drag_start(struct wl_client *client, struct wl_resourc
|
||||||
|
|
||||||
DBG("Data Device Drag Start");
|
DBG("Data Device Drag Start");
|
||||||
|
|
||||||
if ((e_comp_wl->kbd.focus) && (e_comp_wl->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;
|
if (!(source = wl_resource_get_user_data(source_resource))) return;
|
||||||
e_comp_wl->drag_source = source;
|
e_comp_wl->drag_source = source;
|
||||||
|
@ -371,9 +374,10 @@ _e_comp_wl_data_device_cb_drag_start(struct wl_client *client, struct wl_resourc
|
||||||
}
|
}
|
||||||
|
|
||||||
evas_pointer_canvas_xy_get(e_comp->evas, &x, &y);
|
evas_pointer_canvas_xy_get(e_comp->evas, &x, &y);
|
||||||
e_comp_wl->drag = e_drag_new(x, y,
|
e_comp_wl->drag = e_drag_new(x, y, NULL, 0, NULL, 0, NULL,
|
||||||
NULL, 0, NULL, 0, NULL, _e_comp_wl_data_device_drag_finished);
|
_e_comp_wl_data_device_drag_finished);
|
||||||
e_comp_wl->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)
|
if (ec)
|
||||||
e_drag_object_set(e_comp_wl->drag, ec->frame);
|
e_drag_object_set(e_comp_wl->drag, ec->frame);
|
||||||
e_drag_start(e_comp_wl->drag, x, y);
|
e_drag_start(e_comp_wl->drag, x, y);
|
||||||
|
@ -381,7 +385,9 @@ _e_comp_wl_data_device_cb_drag_start(struct wl_client *client, struct wl_resourc
|
||||||
if (e_comp_util_has_xwayland())
|
if (e_comp_util_has_xwayland())
|
||||||
{
|
{
|
||||||
ecore_x_window_show(e_comp->cm_selection);
|
ecore_x_window_show(e_comp->cm_selection);
|
||||||
ecore_x_selection_owner_set(e_comp->cm_selection, ECORE_X_ATOM_SELECTION_XDND, ecore_x_current_time_get());
|
ecore_x_selection_owner_set(e_comp->cm_selection,
|
||||||
|
ECORE_X_ATOM_SELECTION_XDND,
|
||||||
|
ecore_x_current_time_get());
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (e_comp_wl->ptr.ec)
|
if (e_comp_wl->ptr.ec)
|
||||||
|
@ -441,7 +447,8 @@ _e_comp_wl_data_manager_cb_device_get(struct wl_client *client, struct wl_resour
|
||||||
}
|
}
|
||||||
|
|
||||||
eina_hash_add(e_comp_wl->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,
|
wl_resource_set_implementation(res, &_e_data_device_interface,
|
||||||
|
e_comp->wl_comp_data,
|
||||||
_e_comp_wl_data_device_cb_unbind);
|
_e_comp_wl_data_device_cb_unbind);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -469,7 +476,8 @@ _e_comp_wl_data_cb_bind_manager(struct wl_client *client, void *data EINA_UNUSED
|
||||||
struct wl_resource *res;
|
struct wl_resource *res;
|
||||||
|
|
||||||
/* try to create data manager resource */
|
/* try to create data manager resource */
|
||||||
e_comp_wl->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)
|
if (!res)
|
||||||
{
|
{
|
||||||
ERR("Could not create data device manager: %m");
|
ERR("Could not create data device manager: %m");
|
||||||
|
@ -658,7 +666,9 @@ e_comp_wl_data_device_send_enter(E_Client *ec)
|
||||||
uint32_t serial;
|
uint32_t serial;
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
if (e_client_has_xwindow(ec) && e_client_has_xwindow(e_comp_wl->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))
|
if (!e_client_has_xwindow(ec))
|
||||||
{
|
{
|
||||||
data_device_res =
|
data_device_res =
|
||||||
|
@ -668,7 +678,8 @@ e_comp_wl_data_device_send_enter(E_Client *ec)
|
||||||
if (e_comp_wl->drag_source && (!offer_res)) return;
|
if (e_comp_wl->drag_source && (!offer_res)) return;
|
||||||
}
|
}
|
||||||
e_comp_wl->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);
|
evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_DEL,
|
||||||
|
_e_comp_wl_data_device_target_del, ec);
|
||||||
|
|
||||||
#ifndef HAVE_WAYLAND_ONLY
|
#ifndef HAVE_WAYLAND_ONLY
|
||||||
if (e_client_has_xwindow(ec))
|
if (e_client_has_xwindow(ec))
|
||||||
|
@ -703,8 +714,10 @@ e_comp_wl_data_device_send_enter(E_Client *ec)
|
||||||
}
|
}
|
||||||
|
|
||||||
ecore_x_client_message32_send(e_client_util_win_get(ec),
|
ecore_x_client_message32_send(e_client_util_win_get(ec),
|
||||||
ECORE_X_ATOM_XDND_ENTER, ECORE_X_EVENT_MASK_NONE,
|
ECORE_X_ATOM_XDND_ENTER,
|
||||||
|
ECORE_X_EVENT_MASK_NONE,
|
||||||
e_comp->cm_selection, d1, d2, d3, d4);
|
e_comp->cm_selection, d1, d2, d3, d4);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -712,7 +725,8 @@ e_comp_wl_data_device_send_enter(E_Client *ec)
|
||||||
y = wl_fixed_to_int(e_comp_wl->ptr.y) - e_comp_wl->selection.target->client.y;
|
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);
|
serial = wl_display_next_serial(e_comp_wl->wl.disp);
|
||||||
wl_data_device_send_enter(data_device_res, serial, ec->comp_data->surface,
|
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);
|
wl_fixed_from_int(x), wl_fixed_from_int(y),
|
||||||
|
offer_res);
|
||||||
}
|
}
|
||||||
|
|
||||||
E_API void
|
E_API void
|
||||||
|
@ -720,15 +734,19 @@ e_comp_wl_data_device_send_leave(E_Client *ec)
|
||||||
{
|
{
|
||||||
struct wl_resource *res;
|
struct wl_resource *res;
|
||||||
|
|
||||||
if (e_client_has_xwindow(ec) && e_client_has_xwindow(e_comp_wl->drag_client)) return;
|
if (e_client_has_xwindow(ec) &&
|
||||||
evas_object_event_callback_del_full(ec->frame, EVAS_CALLBACK_DEL, _e_comp_wl_data_device_target_del, 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->selection.target == ec)
|
if (e_comp_wl->selection.target == ec)
|
||||||
e_comp_wl->selection.target = NULL;
|
e_comp_wl->selection.target = NULL;
|
||||||
#ifndef HAVE_WAYLAND_ONLY
|
#ifndef HAVE_WAYLAND_ONLY
|
||||||
if (e_client_has_xwindow(ec))
|
if (e_client_has_xwindow(ec))
|
||||||
{
|
{
|
||||||
ecore_x_client_message32_send(e_client_util_win_get(ec),
|
ecore_x_client_message32_send(e_client_util_win_get(ec),
|
||||||
ECORE_X_ATOM_XDND_LEAVE, ECORE_X_EVENT_MASK_NONE,
|
ECORE_X_ATOM_XDND_LEAVE,
|
||||||
|
ECORE_X_EVENT_MASK_NONE,
|
||||||
e_comp->cm_selection, 0, 0, 0, 0);
|
e_comp->cm_selection, 0, 0, 0, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -749,7 +767,11 @@ e_comp_wl_data_device_send_offer(E_Client *ec)
|
||||||
if (!data_device_res) return NULL;
|
if (!data_device_res) return NULL;
|
||||||
source = e_comp_wl->drag_source;
|
source = e_comp_wl->drag_source;
|
||||||
if (source)
|
if (source)
|
||||||
offer_res = _e_comp_wl_data_device_data_offer_create(source, data_device_res);
|
{
|
||||||
|
offer_res =
|
||||||
|
_e_comp_wl_data_device_data_offer_create(source, data_device_res);
|
||||||
|
}
|
||||||
|
|
||||||
return offer_res;
|
return offer_res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -784,7 +806,9 @@ e_comp_wl_data_device_keyboard_focus_set(void)
|
||||||
else if (source && e_client_has_xwindow(e_client_focused_get()))
|
else if (source && e_client_has_xwindow(e_client_focused_get()))
|
||||||
{
|
{
|
||||||
/* wl -> x11 */
|
/* wl -> x11 */
|
||||||
ecore_x_selection_owner_set(e_comp->cm_selection, ECORE_X_ATOM_SELECTION_CLIPBOARD, ecore_x_current_time_get());
|
ecore_x_selection_owner_set(e_comp->cm_selection,
|
||||||
|
ECORE_X_ATOM_SELECTION_CLIPBOARD,
|
||||||
|
ecore_x_current_time_get());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} while (0);
|
} while (0);
|
||||||
|
@ -794,7 +818,11 @@ e_comp_wl_data_device_keyboard_focus_set(void)
|
||||||
if (!data_device_res) return;
|
if (!data_device_res) return;
|
||||||
|
|
||||||
if (source)
|
if (source)
|
||||||
offer_res = _e_comp_wl_data_device_data_offer_create(source, data_device_res);
|
{
|
||||||
|
offer_res =
|
||||||
|
_e_comp_wl_data_device_data_offer_create(source, data_device_res);
|
||||||
|
}
|
||||||
|
|
||||||
wl_data_device_send_selection(data_device_res, offer_res);
|
wl_data_device_send_selection(data_device_res, offer_res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -894,7 +922,8 @@ e_comp_wl_clipboard_source_create(const char *mime_type, uint32_t serial, int fd
|
||||||
{
|
{
|
||||||
if (!source->data_source.mime_types)
|
if (!source->data_source.mime_types)
|
||||||
source->data_source.mime_types = eina_array_new(1);
|
source->data_source.mime_types = eina_array_new(1);
|
||||||
eina_array_push(source->data_source.mime_types, eina_stringshare_add(mime_type));
|
eina_array_push(source->data_source.mime_types,
|
||||||
|
eina_stringshare_add(mime_type));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fd > 0)
|
if (fd > 0)
|
||||||
|
|
|
@ -126,10 +126,14 @@ _e_comp_wl_input_cb_keyboard_unbind(struct wl_resource *resource)
|
||||||
e_comp_wl->kbd.resources =
|
e_comp_wl->kbd.resources =
|
||||||
eina_list_remove(e_comp_wl->kbd.resources, resource);
|
eina_list_remove(e_comp_wl->kbd.resources, resource);
|
||||||
EINA_LIST_FOREACH_SAFE(e_comp_wl->kbd.focused, l, ll, res)
|
EINA_LIST_FOREACH_SAFE(e_comp_wl->kbd.focused, l, ll, res)
|
||||||
|
{
|
||||||
if (res == resource)
|
if (res == resource)
|
||||||
|
{
|
||||||
e_comp_wl->kbd.focused =
|
e_comp_wl->kbd.focused =
|
||||||
eina_list_remove_list(e_comp_wl->kbd.focused, l);
|
eina_list_remove_list(e_comp_wl->kbd.focused, l);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
e_comp_wl_input_keyboard_enter_send(E_Client *ec)
|
e_comp_wl_input_keyboard_enter_send(E_Client *ec)
|
||||||
|
@ -169,8 +173,7 @@ _e_comp_wl_input_cb_keyboard_get(struct wl_client *client, struct wl_resource *r
|
||||||
wl_resource_get_version(resource), id);
|
wl_resource_get_version(resource), id);
|
||||||
if (!res)
|
if (!res)
|
||||||
{
|
{
|
||||||
ERR("Could not create keyboard on seat %s: %m",
|
ERR("Could not create keyboard on seat %s: %m", e_comp_wl->seat.name);
|
||||||
e_comp_wl->seat.name);
|
|
||||||
wl_client_post_no_memory(client);
|
wl_client_post_no_memory(client);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -187,8 +190,7 @@ _e_comp_wl_input_cb_keyboard_get(struct wl_client *client, struct wl_resource *r
|
||||||
|
|
||||||
/* send current keymap */
|
/* send current keymap */
|
||||||
wl_keyboard_send_keymap(res, WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1,
|
wl_keyboard_send_keymap(res, WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1,
|
||||||
e_comp_wl->xkb.fd,
|
e_comp_wl->xkb.fd, e_comp_wl->xkb.size);
|
||||||
e_comp_wl->xkb.size);
|
|
||||||
|
|
||||||
/* if the client owns the focused surface, we need to send an enter */
|
/* if the client owns the focused surface, we need to send an enter */
|
||||||
focused = e_client_focused_get();
|
focused = e_client_focused_get();
|
||||||
|
@ -403,8 +405,7 @@ _e_comp_wl_input_keymap_update(struct xkb_keymap *keymap)
|
||||||
/* send updated keymap */
|
/* send updated keymap */
|
||||||
EINA_LIST_FOREACH(e_comp_wl->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,
|
wl_keyboard_send_keymap(res, WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1,
|
||||||
e_comp_wl->xkb.fd,
|
e_comp_wl->xkb.fd, e_comp_wl->xkb.size);
|
||||||
e_comp_wl->xkb.size);
|
|
||||||
|
|
||||||
/* update modifiers */
|
/* update modifiers */
|
||||||
e_comp_wl_input_keyboard_modifiers_update();
|
e_comp_wl_input_keyboard_modifiers_update();
|
||||||
|
@ -501,18 +502,15 @@ e_comp_wl_input_keyboard_modifiers_serialize(void)
|
||||||
xkb_mod_mask_t mod;
|
xkb_mod_mask_t mod;
|
||||||
xkb_layout_index_t grp;
|
xkb_layout_index_t grp;
|
||||||
|
|
||||||
mod = xkb_state_serialize_mods(e_comp_wl->xkb.state,
|
mod = xkb_state_serialize_mods(e_comp_wl->xkb.state, XKB_STATE_DEPRESSED);
|
||||||
XKB_STATE_DEPRESSED);
|
|
||||||
changed |= mod != e_comp_wl->kbd.mod_depressed;
|
changed |= mod != e_comp_wl->kbd.mod_depressed;
|
||||||
e_comp_wl->kbd.mod_depressed = mod;
|
e_comp_wl->kbd.mod_depressed = mod;
|
||||||
|
|
||||||
mod = xkb_state_serialize_mods(e_comp_wl->xkb.state,
|
mod = xkb_state_serialize_mods(e_comp_wl->xkb.state, XKB_STATE_MODS_LATCHED);
|
||||||
XKB_STATE_MODS_LATCHED);
|
|
||||||
changed |= mod != e_comp_wl->kbd.mod_latched;
|
changed |= mod != e_comp_wl->kbd.mod_latched;
|
||||||
e_comp_wl->kbd.mod_latched = mod;
|
e_comp_wl->kbd.mod_latched = mod;
|
||||||
|
|
||||||
mod = xkb_state_serialize_mods(e_comp_wl->xkb.state,
|
mod = xkb_state_serialize_mods(e_comp_wl->xkb.state, XKB_STATE_MODS_LOCKED);
|
||||||
XKB_STATE_MODS_LOCKED);
|
|
||||||
changed |= mod != e_comp_wl->kbd.mod_locked;
|
changed |= mod != e_comp_wl->kbd.mod_locked;
|
||||||
e_comp_wl->kbd.mod_locked = mod;
|
e_comp_wl->kbd.mod_locked = mod;
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,15 @@ e_grabinput_get(Ecore_Window mouse_win, int confine_mouse, Ecore_Window key_win)
|
||||||
ecore_x_pointer_ungrab();
|
ecore_x_pointer_ungrab();
|
||||||
#else
|
#else
|
||||||
if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
|
if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
|
||||||
ecore_wl_input_ungrab(ecore_wl_input_get());
|
{
|
||||||
|
Ecore_Wl2_Window *wl_win;
|
||||||
|
|
||||||
|
wl_win =
|
||||||
|
ecore_wl2_display_window_find(e_comp_wl->ewd, grab_mouse_win);
|
||||||
|
if (wl_win)
|
||||||
|
ecore_wl2_input_ungrab(ecore_wl2_window_input_get(wl_win),
|
||||||
|
wl_win, 0);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
grab_mouse_win = 0;
|
grab_mouse_win = 0;
|
||||||
}
|
}
|
||||||
|
@ -47,8 +55,17 @@ e_grabinput_get(Ecore_Window mouse_win, int confine_mouse, Ecore_Window key_win)
|
||||||
if (e_comp->comp_type == E_PIXMAP_TYPE_X)
|
if (e_comp->comp_type == E_PIXMAP_TYPE_X)
|
||||||
ecore_x_keyboard_ungrab();
|
ecore_x_keyboard_ungrab();
|
||||||
#else
|
#else
|
||||||
|
/* TODO */
|
||||||
if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
|
if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
|
||||||
ecore_wl_input_ungrab(ecore_wl_input_get());
|
{
|
||||||
|
Ecore_Wl2_Window *wl_win;
|
||||||
|
|
||||||
|
wl_win =
|
||||||
|
ecore_wl2_display_window_find(e_comp_wl->ewd, grab_key_win);
|
||||||
|
if (wl_win)
|
||||||
|
ecore_wl2_input_ungrab(ecore_wl2_window_input_get(wl_win),
|
||||||
|
wl_win, 0);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
grab_key_win = 0;
|
grab_key_win = 0;
|
||||||
|
@ -69,10 +86,12 @@ e_grabinput_get(Ecore_Window mouse_win, int confine_mouse, Ecore_Window key_win)
|
||||||
#else
|
#else
|
||||||
if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
|
if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
|
||||||
{
|
{
|
||||||
Ecore_Wl_Window *wl_win;
|
Ecore_Wl2_Window *wl_win;
|
||||||
|
|
||||||
if ((wl_win = ecore_wl_window_find(mouse_win)))
|
wl_win = ecore_wl2_display_window_find(e_comp_wl->ewd, mouse_win);
|
||||||
ecore_wl_input_grab(ecore_wl_input_get(), wl_win, 0);
|
if (wl_win)
|
||||||
|
ecore_wl2_input_grab(ecore_wl2_window_input_get(wl_win),
|
||||||
|
wl_win, 0);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
grab_mouse_win = mouse_win;
|
grab_mouse_win = mouse_win;
|
||||||
|
@ -98,10 +117,12 @@ e_grabinput_get(Ecore_Window mouse_win, int confine_mouse, Ecore_Window key_win)
|
||||||
#else
|
#else
|
||||||
if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
|
if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
|
||||||
{
|
{
|
||||||
Ecore_Wl_Window *wl_win;
|
Ecore_Wl2_Window *wl_win;
|
||||||
|
|
||||||
if ((wl_win = ecore_wl_window_find(key_win)))
|
wl_win = ecore_wl2_display_window_find(e_comp_wl->ewd, key_win);
|
||||||
ecore_wl_input_grab(ecore_wl_input_get(), wl_win, 0);
|
if (wl_win)
|
||||||
|
ecore_wl2_input_grab(ecore_wl2_window_input_get(wl_win),
|
||||||
|
wl_win, 0);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
grab_key_win = key_win;
|
grab_key_win = key_win;
|
||||||
|
@ -122,7 +143,14 @@ e_grabinput_release(Ecore_Window mouse_win, Ecore_Window key_win)
|
||||||
ecore_x_pointer_ungrab();
|
ecore_x_pointer_ungrab();
|
||||||
#else
|
#else
|
||||||
if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
|
if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
|
||||||
ecore_wl_input_ungrab(ecore_wl_input_get());
|
{
|
||||||
|
Ecore_Wl2_Window *wl_win;
|
||||||
|
|
||||||
|
wl_win = ecore_wl2_display_window_find(e_comp_wl->ewd, mouse_win);
|
||||||
|
if (wl_win)
|
||||||
|
ecore_wl2_input_ungrab(ecore_wl2_window_input_get(wl_win),
|
||||||
|
wl_win, 0);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
grab_mouse_win = 0;
|
grab_mouse_win = 0;
|
||||||
|
@ -134,7 +162,14 @@ e_grabinput_release(Ecore_Window mouse_win, Ecore_Window key_win)
|
||||||
ecore_x_keyboard_ungrab();
|
ecore_x_keyboard_ungrab();
|
||||||
#else
|
#else
|
||||||
if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
|
if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
|
||||||
ecore_wl_input_ungrab(ecore_wl_input_get());
|
{
|
||||||
|
Ecore_Wl2_Window *wl_win;
|
||||||
|
|
||||||
|
wl_win = ecore_wl2_display_window_find(e_comp_wl->ewd, key_win);
|
||||||
|
if (wl_win)
|
||||||
|
ecore_wl2_input_grab(ecore_wl2_window_input_get(wl_win),
|
||||||
|
wl_win, 0);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
grab_key_win = 0;
|
grab_key_win = 0;
|
||||||
|
@ -192,7 +227,7 @@ static void
|
||||||
_e_grabinput_focus_do(Ecore_Window win, E_Focus_Method method)
|
_e_grabinput_focus_do(Ecore_Window win, E_Focus_Method method)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_WAYLAND
|
#ifdef HAVE_WAYLAND
|
||||||
Ecore_Wl_Window *wl_win;
|
Ecore_Wl2_Window *wl_win;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* fprintf(stderr, "focus to %x method %i\n", win, method); */
|
/* fprintf(stderr, "focus to %x method %i\n", win, method); */
|
||||||
|
@ -212,7 +247,7 @@ _e_grabinput_focus_do(Ecore_Window win, E_Focus_Method method)
|
||||||
#ifdef HAVE_WAYLAND
|
#ifdef HAVE_WAYLAND
|
||||||
if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
|
if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
|
||||||
{
|
{
|
||||||
if ((wl_win = ecore_wl_window_find(win)))
|
if ((wl_win = ecore_wl2_display_window_find(e_comp_wl->ewd, win)))
|
||||||
{
|
{
|
||||||
/* FIXME: Need to add an ecore_wl_window_focus function */
|
/* FIXME: Need to add an ecore_wl_window_focus function */
|
||||||
}
|
}
|
||||||
|
@ -227,7 +262,7 @@ _e_grabinput_focus_do(Ecore_Window win, E_Focus_Method method)
|
||||||
#else
|
#else
|
||||||
if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
|
if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
|
||||||
{
|
{
|
||||||
if ((wl_win = ecore_wl_window_find(win)))
|
if ((wl_win = ecore_wl2_display_window_find(e_comp_wl->ewd, win)))
|
||||||
{
|
{
|
||||||
/* FIXME: Need to add an ecore_wl_window_focus function */
|
/* FIXME: Need to add an ecore_wl_window_focus function */
|
||||||
}
|
}
|
||||||
|
@ -242,7 +277,7 @@ _e_grabinput_focus_do(Ecore_Window win, E_Focus_Method method)
|
||||||
#else
|
#else
|
||||||
if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
|
if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
|
||||||
{
|
{
|
||||||
if ((wl_win = ecore_wl_window_find(win)))
|
if ((wl_win = ecore_wl2_display_window_find(e_comp_wl->ewd, win)))
|
||||||
{
|
{
|
||||||
/* FIXME: Need to add an ecore_wl_window_focus function */
|
/* FIXME: Need to add an ecore_wl_window_focus function */
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,8 +27,12 @@ e_scale_update(void)
|
||||||
e_scale = (double)ecore_x_dpi_get() / (double)e_config->scale.base_dpi;
|
e_scale = (double)ecore_x_dpi_get() / (double)e_config->scale.base_dpi;
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_WAYLAND
|
#ifdef HAVE_WAYLAND
|
||||||
|
/* FIXME: This needs to get the DPI from a given output */
|
||||||
if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
|
if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
|
||||||
e_scale = (double)ecore_wl_dpi_get() / (double)e_config->scale.base_dpi;
|
{
|
||||||
|
e_scale = (double)ecore_wl2_output_dpi_get(NULL) /
|
||||||
|
(double)e_config->scale.base_dpi;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
if (e_scale > e_config->scale.max) e_scale = e_config->scale.max;
|
if (e_scale > e_config->scale.max) e_scale = e_config->scale.max;
|
||||||
else if (e_scale < e_config->scale.min)
|
else if (e_scale < e_config->scale.min)
|
||||||
|
|
|
@ -953,7 +953,7 @@ _wl_shot_now(E_Zone *zone, E_Client *ec, const char *params)
|
||||||
sh = E_CLAMP(sh, 1, ec->zone->y + ec->zone->h - y);
|
sh = E_CLAMP(sh, 1, ec->zone->y + ec->zone->h - y);
|
||||||
}
|
}
|
||||||
|
|
||||||
shm = e_comp_wl->wl.shm ?: ecore_wl_shm_get();
|
shm = e_comp_wl->wl.shm ?: ecore_wl2_display_shm_get(e_comp_wl->wl.client_disp);
|
||||||
|
|
||||||
EINA_LIST_FOREACH(_outputs, l, output)
|
EINA_LIST_FOREACH(_outputs, l, output)
|
||||||
{
|
{
|
||||||
|
@ -1258,31 +1258,19 @@ static Ecore_Event_Handler *wl_global_handler;
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_wl_init()
|
_wl_init()
|
||||||
{
|
{
|
||||||
Eina_Inlist *globals;
|
Eina_Iterator *itr;
|
||||||
Ecore_Wl_Global *global;
|
Ecore_Wl2_Global *global;
|
||||||
struct wl_registry *reg;
|
struct wl_registry *reg;
|
||||||
|
void *data;
|
||||||
|
|
||||||
reg = e_comp_wl->wl.registry ?: ecore_wl_registry_get();
|
reg = e_comp_wl->wl.registry ?: ecore_wl2_display_registry_get(e_comp_wl->wl.client_disp);
|
||||||
if (e_comp_wl->wl.registry)
|
itr = ecore_wl2_display_globals_get(e_comp_wl->wl.client_disp);
|
||||||
globals = e_comp_wl->wl.globals;
|
EINA_ITERATOR_FOREACH(itr, data)
|
||||||
else
|
|
||||||
globals = ecore_wl_globals_get();
|
|
||||||
if (!globals)
|
|
||||||
{
|
{
|
||||||
if (!wl_global_handler)
|
global = (Ecore_Wl2_Global *)data;
|
||||||
{
|
|
||||||
if (e_comp_wl->wl.registry)
|
if ((!_wl_screenshooter) &&
|
||||||
wl_global_handler = ecore_event_handler_add(E_EVENT_WAYLAND_GLOBAL_ADD,
|
(!strcmp(global->interface, "screenshooter")))
|
||||||
(Ecore_Event_Handler_Cb)_wl_init, NULL);
|
|
||||||
else
|
|
||||||
wl_global_handler = ecore_event_handler_add(ECORE_WL_EVENT_INTERFACES_BOUND,
|
|
||||||
(Ecore_Event_Handler_Cb)_wl_init, NULL);
|
|
||||||
}
|
|
||||||
return ECORE_CALLBACK_RENEW;
|
|
||||||
}
|
|
||||||
EINA_INLIST_FOREACH(globals, global)
|
|
||||||
{
|
|
||||||
if ((!_wl_screenshooter) && (!strcmp(global->interface, "screenshooter")))
|
|
||||||
{
|
{
|
||||||
_wl_screenshooter =
|
_wl_screenshooter =
|
||||||
wl_registry_bind(reg, global->id,
|
wl_registry_bind(reg, global->id,
|
||||||
|
@ -1312,6 +1300,8 @@ _wl_init()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
eina_iterator_free(itr);
|
||||||
|
|
||||||
return ECORE_CALLBACK_RENEW;
|
return ECORE_CALLBACK_RENEW;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "e.h"
|
#include "e.h"
|
||||||
#include <Ecore_Fb.h>
|
#include <Ecore_Fb.h>
|
||||||
#include <Ecore_Wayland.h>
|
/* #include <Ecore_Wayland.h> */
|
||||||
|
|
||||||
E_API E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Wl_FB" };
|
E_API E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Wl_FB" };
|
||||||
|
|
||||||
|
@ -39,8 +39,8 @@ e_modapi_init(E_Module *m)
|
||||||
e_comp_canvas_init(w, h);
|
e_comp_canvas_init(w, h);
|
||||||
e_comp->pointer = e_pointer_canvas_new(e_comp->ee, EINA_TRUE);
|
e_comp->pointer = e_pointer_canvas_new(e_comp->ee, EINA_TRUE);
|
||||||
|
|
||||||
ecore_wl_init(NULL);
|
/* ecore_wl_init(NULL); */
|
||||||
ecore_wl_server_mode_set(1);
|
/* ecore_wl_server_mode_set(1); */
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ struct weekeyboard
|
||||||
{
|
{
|
||||||
E_Module *module;
|
E_Module *module;
|
||||||
Ecore_Evas *ee;
|
Ecore_Evas *ee;
|
||||||
Ecore_Wl_Window *win;
|
Ecore_Wl2_Window *win;
|
||||||
Evas_Object *edje_obj;
|
Evas_Object *edje_obj;
|
||||||
const char *ee_engine;
|
const char *ee_engine;
|
||||||
char **ignore_keys;
|
char **ignore_keys;
|
||||||
|
@ -72,11 +72,14 @@ _wkb_commit_preedit_str(struct weekeyboard *wkb)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wl_input_method_context_cursor_position(wkb->im_ctx, 0, 0);
|
wl_input_method_context_cursor_position(wkb->im_ctx, 0, 0);
|
||||||
wl_input_method_context_commit_string(wkb->im_ctx, wkb->serial, wkb->preedit_str);
|
wl_input_method_context_commit_string(wkb->im_ctx, wkb->serial,
|
||||||
|
wkb->preedit_str);
|
||||||
|
|
||||||
if (wkb->surrounding_text)
|
if (wkb->surrounding_text)
|
||||||
{
|
{
|
||||||
surrounding_text = _wkb_insert_text(wkb->surrounding_text, wkb->surrounding_cursor, wkb->preedit_str);
|
surrounding_text =
|
||||||
|
_wkb_insert_text(wkb->surrounding_text, wkb->surrounding_cursor,
|
||||||
|
wkb->preedit_str);
|
||||||
free(wkb->surrounding_text);
|
free(wkb->surrounding_text);
|
||||||
wkb->surrounding_text = surrounding_text;
|
wkb->surrounding_text = surrounding_text;
|
||||||
wkb->surrounding_cursor += strlen(wkb->preedit_str);
|
wkb->surrounding_cursor += strlen(wkb->preedit_str);
|
||||||
|
@ -97,13 +100,16 @@ _wkb_send_preedit_str(struct weekeyboard *wkb, int cursor)
|
||||||
unsigned int index = strlen(wkb->preedit_str);
|
unsigned int index = strlen(wkb->preedit_str);
|
||||||
|
|
||||||
if (wkb->preedit_style)
|
if (wkb->preedit_style)
|
||||||
wl_input_method_context_preedit_styling(wkb->im_ctx, 0, strlen(wkb->preedit_str), wkb->preedit_style);
|
wl_input_method_context_preedit_styling(wkb->im_ctx, 0,
|
||||||
|
strlen(wkb->preedit_str),
|
||||||
|
wkb->preedit_style);
|
||||||
|
|
||||||
if (cursor > 0)
|
if (cursor > 0)
|
||||||
index = cursor;
|
index = cursor;
|
||||||
|
|
||||||
wl_input_method_context_preedit_cursor(wkb->im_ctx, index);
|
wl_input_method_context_preedit_cursor(wkb->im_ctx, index);
|
||||||
wl_input_method_context_preedit_string(wkb->im_ctx, wkb->serial, wkb->preedit_str, wkb->preedit_str);
|
wl_input_method_context_preedit_string(wkb->im_ctx, wkb->serial,
|
||||||
|
wkb->preedit_str, wkb->preedit_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -185,7 +191,8 @@ _cb_wkb_on_key_down(void *data, Evas_Object *obj EINA_UNUSED, const char *emissi
|
||||||
{
|
{
|
||||||
_wkb_commit_preedit_str(wkb);
|
_wkb_commit_preedit_str(wkb);
|
||||||
wl_input_method_context_keysym(wkb->im_ctx, wkb->serial, 0,
|
wl_input_method_context_keysym(wkb->im_ctx, wkb->serial, 0,
|
||||||
XKB_KEY_Return, WL_KEYBOARD_KEY_STATE_PRESSED, 0);
|
XKB_KEY_Return,
|
||||||
|
WL_KEYBOARD_KEY_STATE_PRESSED, 0);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
else if (eina_streq(key, "space"))
|
else if (eina_streq(key, "space"))
|
||||||
|
@ -213,12 +220,14 @@ _wkb_ui_setup(struct weekeyboard *wkb)
|
||||||
if (!wkb->edje_obj)
|
if (!wkb->edje_obj)
|
||||||
{
|
{
|
||||||
Evas *evas;
|
Evas *evas;
|
||||||
|
|
||||||
ecore_evas_alpha_set(wkb->ee, EINA_TRUE);
|
ecore_evas_alpha_set(wkb->ee, EINA_TRUE);
|
||||||
ecore_evas_title_set(wkb->ee, "Weekeyboard");
|
ecore_evas_title_set(wkb->ee, "Weekeyboard");
|
||||||
|
|
||||||
evas = ecore_evas_get(wkb->ee);
|
evas = ecore_evas_get(wkb->ee);
|
||||||
wkb->edje_obj = edje_object_add(evas);
|
wkb->edje_obj = edje_object_add(evas);
|
||||||
edje_object_signal_callback_add(wkb->edje_obj, "key_down", "*", _cb_wkb_on_key_down, wkb);
|
edje_object_signal_callback_add(wkb->edje_obj, "key_down", "*",
|
||||||
|
_cb_wkb_on_key_down, wkb);
|
||||||
}
|
}
|
||||||
|
|
||||||
// hard coded
|
// hard coded
|
||||||
|
@ -232,7 +241,7 @@ _wkb_ui_setup(struct weekeyboard *wkb)
|
||||||
|
|
||||||
if (eina_streq(wkb->theme, "default"))
|
if (eina_streq(wkb->theme, "default"))
|
||||||
{
|
{
|
||||||
ecore_wl_screen_size_get(&w, &h);
|
ecore_wl2_display_screen_size_get(e_comp_wl->ewd, &w, &h);
|
||||||
DBG("Screen size: w=%d, h=%d", w, h);
|
DBG("Screen size: w=%d, h=%d", w, h);
|
||||||
if (w >= 1080)
|
if (w >= 1080)
|
||||||
w = 1080;
|
w = 1080;
|
||||||
|
@ -244,7 +253,8 @@ _wkb_ui_setup(struct weekeyboard *wkb)
|
||||||
DBG("Using default_%d theme", w);
|
DBG("Using default_%d theme", w);
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf(path, PATH_MAX, "%s/%s_%d.edj", e_module_dir_get(wkb->module), wkb->theme, w);
|
snprintf(path, PATH_MAX, "%s/%s_%d.edj",
|
||||||
|
e_module_dir_get(wkb->module), wkb->theme, w);
|
||||||
INF("Loading edje file: '%s'", path);
|
INF("Loading edje file: '%s'", path);
|
||||||
|
|
||||||
if (!edje_object_file_set(wkb->edje_obj, path, "main"))
|
if (!edje_object_file_set(wkb->edje_obj, path, "main"))
|
||||||
|
@ -277,8 +287,9 @@ _wkb_ui_setup(struct weekeyboard *wkb)
|
||||||
{
|
{
|
||||||
int rx, ry, rw, rh;
|
int rx, ry, rw, rh;
|
||||||
|
|
||||||
edje_object_part_geometry_get(wkb->edje_obj, "background", &rx, &ry, &rw, &rh);
|
edje_object_part_geometry_get(wkb->edje_obj, "background",
|
||||||
ecore_wl_window_input_region_set(wkb->win, rx, ry, rw, rh);
|
&rx, &ry, &rw, &rh);
|
||||||
|
ecore_wl2_window_input_region_set(wkb->win, rx, ry, rw, rh);
|
||||||
}
|
}
|
||||||
|
|
||||||
ignore_keys = edje_file_data_get(path, "ignore-keys");
|
ignore_keys = edje_file_data_get(path, "ignore-keys");
|
||||||
|
@ -304,7 +315,8 @@ _wkb_im_ctx_surrounding_text(void *data, struct wl_input_method_context *im_ctx,
|
||||||
|
|
||||||
EINA_SAFETY_ON_NULL_RETURN(text);
|
EINA_SAFETY_ON_NULL_RETURN(text);
|
||||||
|
|
||||||
DBG("im_context = %p text = '%s' cursor = %d anchor = %d", im_ctx, text, cursor, anchor);
|
DBG("im_context = %p text = '%s' cursor = %d anchor = %d",
|
||||||
|
im_ctx, text, cursor, anchor);
|
||||||
|
|
||||||
free(wkb->surrounding_text);
|
free(wkb->surrounding_text);
|
||||||
|
|
||||||
|
@ -390,7 +402,8 @@ _wkb_im_ctx_commit_state(void *data, struct wl_input_method_context *im_ctx, uin
|
||||||
wkb->serial = serial;
|
wkb->serial = serial;
|
||||||
|
|
||||||
wl_input_method_context_language(im_ctx, wkb->serial, "en");
|
wl_input_method_context_language(im_ctx, wkb->serial, "en");
|
||||||
wl_input_method_context_text_direction(im_ctx, wkb->serial, WL_TEXT_INPUT_TEXT_DIRECTION_LTR);
|
wl_input_method_context_text_direction(im_ctx, wkb->serial,
|
||||||
|
WL_TEXT_INPUT_TEXT_DIRECTION_LTR);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -451,7 +464,8 @@ _wkb_im_activate(void *data, struct wl_input_method *input_method EINA_UNUSED, s
|
||||||
|
|
||||||
/* hard coded */
|
/* hard coded */
|
||||||
wl_input_method_context_language(im_ctx, wkb->serial, "en");
|
wl_input_method_context_language(im_ctx, wkb->serial, "en");
|
||||||
wl_input_method_context_text_direction(im_ctx, wkb->serial, WL_TEXT_INPUT_TEXT_DIRECTION_LTR);
|
wl_input_method_context_text_direction(im_ctx, wkb->serial,
|
||||||
|
WL_TEXT_INPUT_TEXT_DIRECTION_LTR);
|
||||||
|
|
||||||
wkb->context_changed = EINA_TRUE;
|
wkb->context_changed = EINA_TRUE;
|
||||||
evas_object_show(wkb->edje_obj);
|
evas_object_show(wkb->edje_obj);
|
||||||
|
@ -478,32 +492,41 @@ static const struct wl_input_method_listener wkb_im_listener = {
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_wkb_setup(struct weekeyboard *wkb)
|
_wkb_setup(struct weekeyboard *wkb)
|
||||||
{
|
{
|
||||||
Eina_Inlist *globals;
|
Eina_Iterator *itr;
|
||||||
|
Ecore_Wl2_Global *global;
|
||||||
struct wl_registry *registry;
|
struct wl_registry *registry;
|
||||||
Ecore_Wl_Global *global;
|
|
||||||
struct wl_input_panel_surface *ips;
|
struct wl_input_panel_surface *ips;
|
||||||
|
void *data;
|
||||||
|
|
||||||
globals = ecore_wl_globals_get();
|
registry = e_comp_wl->wl.registry ?: ecore_wl2_display_registry_get(e_comp_wl->ewd);
|
||||||
registry = ecore_wl_registry_get();
|
itr = ecore_wl2_display_globals_get(e_comp_wl->ewd);
|
||||||
EINA_INLIST_FOREACH(globals, global)
|
EINA_ITERATOR_FOREACH(itr, data)
|
||||||
{
|
{
|
||||||
|
global = (Ecore_Wl2_Global *)data;
|
||||||
|
|
||||||
DBG("interface: <%s>", global->interface);
|
DBG("interface: <%s>", global->interface);
|
||||||
if (eina_streq(global->interface, "wl_input_panel"))
|
if (eina_streq(global->interface, "wl_input_panel"))
|
||||||
{
|
{
|
||||||
wkb->ip = wl_registry_bind(registry, global->id, &wl_input_panel_interface, 1);
|
wkb->ip =
|
||||||
|
wl_registry_bind(registry, global->id,
|
||||||
|
&wl_input_panel_interface, 1);
|
||||||
DBG("binding wl_input_panel");
|
DBG("binding wl_input_panel");
|
||||||
}
|
}
|
||||||
else if (eina_streq(global->interface, "wl_input_method"))
|
else if (eina_streq(global->interface, "wl_input_method"))
|
||||||
{
|
{
|
||||||
wkb->im = wl_registry_bind(registry, global->id, &wl_input_method_interface, 1);
|
wkb->im =
|
||||||
|
wl_registry_bind(registry, global->id,
|
||||||
|
&wl_input_method_interface, 1);
|
||||||
DBG("binding wl_input_method, id = %d", global->id);
|
DBG("binding wl_input_method, id = %d", global->id);
|
||||||
}
|
}
|
||||||
else if (eina_streq(global->interface, "wl_output"))
|
else if (eina_streq(global->interface, "wl_output"))
|
||||||
{
|
{
|
||||||
wkb->output = wl_registry_bind(registry, global->id, &wl_output_interface, 1);
|
wkb->output =
|
||||||
|
wl_registry_bind(registry, global->id, &wl_output_interface, 1);
|
||||||
DBG("binding wl_output");
|
DBG("binding wl_output");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
eina_iterator_free(itr);
|
||||||
|
|
||||||
if ((!wkb->ip) || (!wkb->im) || (!wkb->output))
|
if ((!wkb->ip) || (!wkb->im) || (!wkb->output))
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
|
@ -513,11 +536,14 @@ _wkb_setup(struct weekeyboard *wkb)
|
||||||
|
|
||||||
/* Set input panel surface */
|
/* Set input panel surface */
|
||||||
DBG("Setting up input panel");
|
DBG("Setting up input panel");
|
||||||
wkb->win = ecore_evas_wayland_window_get(wkb->ee);
|
|
||||||
ecore_wl_window_type_set(wkb->win, ECORE_WL_WINDOW_TYPE_NONE);
|
wkb->win = ecore_evas_wayland_window_get2(wkb->ee);
|
||||||
wkb->surface = ecore_wl_window_surface_create(wkb->win);
|
ecore_wl2_window_type_set(wkb->win, ECORE_WL2_WINDOW_TYPE_NONE);
|
||||||
|
|
||||||
|
wkb->surface = ecore_wl2_window_surface_get(wkb->win);
|
||||||
ips = wl_input_panel_get_input_panel_surface(wkb->ip, wkb->surface);
|
ips = wl_input_panel_get_input_panel_surface(wkb->ip, wkb->surface);
|
||||||
wl_input_panel_surface_set_toplevel(ips, wkb->output, WL_INPUT_PANEL_SURFACE_POSITION_CENTER_BOTTOM);
|
wl_input_panel_surface_set_toplevel(ips, wkb->output,
|
||||||
|
WL_INPUT_PANEL_SURFACE_POSITION_CENTER_BOTTOM);
|
||||||
|
|
||||||
/* Input method listener */
|
/* Input method listener */
|
||||||
DBG("Adding wl_input_method listener");
|
DBG("Adding wl_input_method listener");
|
||||||
|
|
Loading…
Reference in New Issue