E_FREE(e_comp_wl->evas_gl);
}
+static Eina_Bool
+_e_comp_wl_cb_mouse_move_preventer(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Mouse_Move *ev)
+{
+ static int saved_x = -1;
+ static int saved_y = -1;
+
+ E_Client *focus = e_client_focused_get();
+
+ if ((!e_comp_wl->ptr_constraints.activated) ||
+ (!focus) ||
+ (e_comp_wl->ptr_constraints.ec != focus))
+ {
+ if (saved_x != -1 || saved_y != -1)
+ {
+ e_input_device_pointer_warp(NULL, saved_x, saved_y);
+ saved_x = -1;
+ saved_y = -1;
+ }
+
+ return ECORE_CALLBACK_RENEW;
+ }
+
+ if (saved_x == -1 || saved_y == -1)
+ {
+ saved_x = ev->x;
+ saved_y = ev->y;
+ }
+
+ return ECORE_CALLBACK_DONE;
+}
+
/* public functions */
/**
if (!e_foreign_global_init(e_comp_wl->wl.disp))
ELOGF("COMP", "Failed to initialize the e_foreign global", NULL);
+ /* prepend a mouse move event handler to prevent the mouse move event from being delivered to
+ the other mouse move event handlers when a pointer constraint is activated */
+ E_LIST_HANDLER_PREPEND(handlers, ECORE_EVENT_MOUSE_MOVE, _e_comp_wl_cb_mouse_move_preventer, NULL);
+
/* add event handlers to catch E events */
E_LIST_HANDLER_APPEND(handlers, E_EVENT_SCREEN_CHANGE, _e_comp_wl_cb_randr_change, NULL);
E_LIST_HANDLER_APPEND(handlers, E_EVENT_COMP_OBJECT_ADD, _e_comp_wl_cb_comp_object_add, NULL);