From 72f9213c7d56804ddc70f2b82c193d073350d0fc Mon Sep 17 00:00:00 2001 From: MinJeong Kim Date: Mon, 1 Jun 2015 18:28:55 +0900 Subject: [PATCH] Improve cursor settings - Set shell functions for cursor client for blocking intercepting of shell. - Recover checking code for cursor size - Don't enable wl_pointer and don't show pointer as default. It will be enabled by ECORE_DRM_EVENT_INPUT_DEVICE_ADD event indicating capability for pointer. Change-Id: I1179416f6e116d84484fdaff31c5d5bc5f0d4bba Signed-off-by: MinJeong Kim --- src/bin/e_comp_wl_input.c | 32 ++++++++++++++++++++++++++++++++ src/modules/wl_drm/e_mod_main.c | 2 +- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/src/bin/e_comp_wl_input.c b/src/bin/e_comp_wl_input.c index 96dc6e8..0f9a364 100644 --- a/src/bin/e_comp_wl_input.c +++ b/src/bin/e_comp_wl_input.c @@ -22,6 +22,28 @@ _e_comp_wl_input_update_seat_caps(E_Comp_Data *cdata) } static void +_e_comp_wl_input_pointer_map(struct wl_resource *resource) +{ + E_Pixmap *ep; + E_Client *ec; + + if (!(ep = wl_resource_get_user_data(resource))) return; + if (!(ec = e_pixmap_client_get(ep))) return; + if (e_object_is_del(E_OBJECT(ec))) return; + + e_pointer_object_set(e_comp->pointer, ec->frame, ec->x, ec->y); + ec->comp_data->mapped = EINA_TRUE; +} + +static void +_e_comp_wl_input_pointer_confiugre(struct wl_resource *resource, + Evas_Coord x, Evas_Coord y, + Evas_Coord w, Evas_Coord h) +{ + /* do nothing */ +} + +static void _e_comp_wl_input_cb_resource_destroy(struct wl_client *client EINA_UNUSED, struct wl_resource *resource) { wl_resource_destroy(resource); @@ -35,6 +57,7 @@ _e_comp_wl_input_pointer_cb_cursor_set(struct wl_client *client, struct wl_resou E_Client *ec; uint64_t sid; Eina_Bool got_mouse = EINA_FALSE; + int cursor_w = 0, cursor_h = 0; /* get compositor data */ if (!(cdata = wl_resource_get_user_data(resource))) return; @@ -70,10 +93,19 @@ _e_comp_wl_input_pointer_cb_cursor_set(struct wl_client *client, struct wl_resou ec->client.w = ec->client.h = 1; l = e_client_focus_stack_get(); e_client_focus_stack_set(eina_list_remove(l, ec)); + + /* Set fuctions to prevent unwanted handling by shell */ + ec->comp_data->shell.surface = surface_resource; + ec->comp_data->shell.configure = _e_comp_wl_input_pointer_confiugre; + ec->comp_data->shell.map = _e_comp_wl_input_pointer_map; } /* ignore cursor changes during resize/move I guess */ if (e_client_action_get()) return; + evas_object_geometry_get(ec->frame, NULL, NULL, &cursor_w, &cursor_h); + if ((cursor_w == 0) || (cursor_h == 0)) + return; + e_pointer_object_set(e_comp->pointer, ec->frame, x, y); } diff --git a/src/modules/wl_drm/e_mod_main.c b/src/modules/wl_drm/e_mod_main.c index 6e0949c..376d470 100644 --- a/src/modules/wl_drm/e_mod_main.c +++ b/src/modules/wl_drm/e_mod_main.c @@ -213,7 +213,6 @@ e_modapi_init(E_Module *m) /* NB: This needs to be called AFTER the comp canvas has been setup */ if (!e_comp_wl_init()) return NULL; - 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); @@ -221,6 +220,7 @@ e_modapi_init(E_Module *m) /* e_pointer_window_new(ecore_evas_window_get(comp->ee), 1); */ comp->pointer = e_pointer_canvas_new(comp->ee, EINA_TRUE); comp->pointer->color = EINA_TRUE; + e_pointer_hide(comp->pointer); /* FIXME: We need a way to trap for user changing the keymap inside of E * without the event coming from X11 */ -- 2.7.4