Eina_Bool is_region_pending;
Eina_Bool has_region_set;
- wl_fixed_t hint_x;
- wl_fixed_t hint_y;
+ int hint_x;
+ int hint_y;
wl_fixed_t hint_x_pending;
wl_fixed_t hint_y_pending;
Eina_Bool is_hint_pending;
else
ERR("unknown pointer constraint type (%d) !", type);
+ INF("Pointer Constraint deactivated.");
+
if (constraint->ec &&
- constraint->has_hint_set &&
- _e_comp_wl_input_is_position_inside_constraint_region(constraint,
- constraint->hint_x,
- constraint->hint_y))
+ constraint->has_hint_set)
{
- E_Client *ec = constraint->ec;
- int cx = ec->client.x + wl_fixed_to_int(constraint->hint_x);
- int cy = ec->client.y + wl_fixed_to_int(constraint->hint_y);
- INF("Pointer Constraint deactivated. Pointer Warp to (%d, %d)", cx, cy);
- e_input_device_pointer_warp(NULL, cx, cy);
+
+ INF("Pointer Constraint. Pointer Warp to (%d, %d)", constraint->hint_x, constraint->hint_y);
+ e_input_device_pointer_warp(NULL, constraint->hint_x, constraint->hint_y);
}
}
zwp_confined_pointer_v1_send_confined(resource);
else
ERR("unknown pointer constraint type (%d) !", type);
+
+ INF("Pointer Constraint activated.");
}
static void
E_Comp_Wl_Pointer_Constraint *constraint = container_of(listener,
E_Comp_Wl_Pointer_Constraint,
surface_commit_listener);
+ int new_x, new_y;;
if (ec != constraint->ec)
return;
if (constraint->is_hint_pending)
{
constraint->is_hint_pending = EINA_FALSE;
- constraint->hint_x = constraint->hint_x_pending;
- constraint->hint_y = constraint->hint_y_pending;
+
+ new_x = ec->client.x + wl_fixed_to_int(constraint->hint_x_pending);
+ new_y = ec->client.y + wl_fixed_to_int(constraint->hint_y_pending);
+
+ if (evas_object_map_enable_get(ec->frame))
+ {
+ e_comp_wl_map_inv_coord_get(ec, new_x, new_y, &constraint->hint_x, &constraint->hint_y);
+ WRN("Pointer Constraint. Committed. hint (%d, %d) -> map_inv_coord (%d, %d)",
+ new_x, new_y, constraint->hint_x, constraint->hint_y);
+ }
+ else
+ {
+ constraint->hint_x = new_x;
+ constraint->hint_y = new_y;
+ WRN("Pointer Constraint. Committed. hint (%d, %d)",
+ constraint->hint_x, constraint->hint_y);
+ }
}
if (constraint->is_region_pending)
constraint->has_region_set = EINA_TRUE;
}
- constraint->hint_x = e_comp_wl->ptr.x - wl_fixed_from_int(ec->client.x);
- constraint->hint_y = e_comp_wl->ptr.y - wl_fixed_from_int(ec->client.y);
- constraint->is_hint_pending = EINA_FALSE;
- constraint->has_hint_set = EINA_TRUE;
- ERR("Pointer Constraint created. cursor position hint (%d, %d)",
- wl_fixed_to_int(constraint->hint_x),
- wl_fixed_to_int(constraint->hint_y));
+ ERR("Pointer Constraint created.");
constraint->pointer_destroy_listener.notify =
_e_comp_wl_input_cb_pointer_constraints_pointer_destroyed;
}
else
{
+ double seat_dx, seat_dy, temp;
+ if (edev->disable_acceleration)
+ {
+ seat_dx = dx[1];
+ seat_dy = dy[1];
+ }
+ else
+ {
+ seat_dx = dx[0];
+ seat_dy = dy[0];
+ }
+
+ if (edev->seat->ptr.swap)
+ {
+ temp = seat_dx;
+ seat_dx = seat_dy;
+ seat_dy = temp;
+ }
+ if (edev->seat->ptr.invert_x)
+ seat_dx *= -1;
+ if (edev->seat->ptr.invert_y)
+ seat_dy *= -1;
+
+ edev->seat->ptr.dx += seat_dx;
+ edev->seat->ptr.dy += seat_dy;
+
+ edev->mouse.dx = edev->seat->ptr.dx;
+ edev->mouse.dy = edev->seat->ptr.dy;
+
+ if (floor(edev->seat->ptr.dx) == edev->seat->ptr.ix &&
+ floor(edev->seat->ptr.dy) == edev->seat->ptr.iy)
+ {
+ return;
+ }
+
+ edev->seat->ptr.ix = edev->seat->ptr.dx;
+ edev->seat->ptr.iy = edev->seat->ptr.dy;
+
+ if ((edev->seat->dev->blocked & E_INPUT_SEAT_POINTER) ||
+ (edev->seat->dev->server_blocked & E_INPUT_SEAT_POINTER))
+ {
+ return;
+ }
+
_device_pointer_motion(edev, event);
}
}
E_Input_Evdev *edev;
double delta_x[2]; /* delta_x[0] for accelerated, delta_x[1] for unaccelerated */
double delta_y[2]; /* delta_y[0] for accelerated, delta_y[1] for unaccelerated */
- double dx, dy, temp;
if (!(edev = libinput_device_get_user_data(device)))
{
delta_y[0] = libinput_event_pointer_get_dy(event);
delta_y[1] = libinput_event_pointer_get_dy_unaccelerated(event);
- if (edev->disable_acceleration)
- {
- dx = delta_x[1];
- dy = delta_y[1];
- }
- else
- {
- dx = delta_x[0];
- dy = delta_y[0];
- }
-
- if (edev->seat->ptr.swap)
- {
- temp = dx;
- dx = dy;
- dy = temp;
- }
- if (edev->seat->ptr.invert_x)
- dx *= -1;
- if (edev->seat->ptr.invert_y)
- dy *= -1;
-
- edev->seat->ptr.dx += dx;
- edev->seat->ptr.dy += dy;
-
- edev->mouse.dx = edev->seat->ptr.dx;
- edev->mouse.dy = edev->seat->ptr.dy;
-
- if (floor(edev->seat->ptr.dx) == edev->seat->ptr.ix &&
- floor(edev->seat->ptr.dy) == edev->seat->ptr.iy)
- {
- return;
- }
-
- edev->seat->ptr.ix = edev->seat->ptr.dx;
- edev->seat->ptr.iy = edev->seat->ptr.dy;
-
- if ((edev->seat->dev->blocked & E_INPUT_SEAT_POINTER) ||
- (edev->seat->dev->server_blocked & E_INPUT_SEAT_POINTER))
- {
- return;
- }
-
_device_pointer_motion_send(edev, event, &delta_x[0], &delta_y[0]);
}