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;
/* 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);
}
EAPI E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Wl_Drm" };
-static Ecore_Event_Handler *activate_handler;
-static Ecore_Event_Handler *output_handler;
+static Eina_List *event_handlers = NULL;
static Eina_Bool session_state = EINA_FALSE;
static Eina_Bool
return ECORE_CALLBACK_PASS_ON;
}
+static Eina_Bool
+_e_mod_drm_cb_input_device_add(void *data, int type, void *event)
+{
+ Ecore_Drm_Event_Input_Device_Add *e;
+
+ if (!(e = event)) goto end;
+
+ if (e->caps & EVDEV_SEAT_POINTER)
+ {
+ e_comp_wl_input_pointer_enabled_set(EINA_TRUE);
+ }
+
+end:
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+static Eina_Bool
+_e_mod_drm_cb_input_device_del(void *data, int type, void *event)
+{
+ Ecore_Drm_Event_Input_Device_Del *e;
+
+ if (!(e = event)) goto end;
+
+ if (e->caps & EVDEV_SEAT_POINTER)
+ {
+ e_comp_wl_input_pointer_enabled_set(EINA_FALSE);
+ e_pointer_hide(e_comp->pointer);
+ }
+
+end:
+ return ECORE_CALLBACK_PASS_ON;
+}
+
EAPI void *
e_modapi_init(E_Module *m)
{
* happens to jive with what drm does */
e_comp_wl_input_keymap_set(comp->wl_comp_data, NULL, NULL, NULL);
- activate_handler =
- ecore_event_handler_add(ECORE_DRM_EVENT_ACTIVATE,
- _e_mod_drm_cb_activate, comp);
-
- output_handler =
- ecore_event_handler_add(ECORE_DRM_EVENT_OUTPUT,
- _e_mod_drm_cb_output, comp);
+ E_LIST_HANDLER_APPEND(event_handlers, ECORE_DRM_EVENT_ACTIVATE,
+ _e_mod_drm_cb_activate, comp);
+ E_LIST_HANDLER_APPEND(event_handlers, ECORE_DRM_EVENT_OUTPUT,
+ _e_mod_drm_cb_output, comp);
+ E_LIST_HANDLER_APPEND(event_handlers, ECORE_DRM_EVENT_INPUT_DEVICE_ADD,
+ _e_mod_drm_cb_input_device_add, comp);
+ E_LIST_HANDLER_APPEND(event_handlers, ECORE_DRM_EVENT_INPUT_DEVICE_DEL,
+ _e_mod_drm_cb_input_device_del, comp);
return m;
}
/* shutdown ecore_drm */
/* ecore_drm_shutdown(); */
- if (activate_handler) ecore_event_handler_del(activate_handler);
- activate_handler = NULL;
+ E_FREE_LIST(event_handlers, ecore_event_handler_del);
return 1;
}