mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-03-07 04:34:24 -05:00
fix: pointer events being one event behind
This commit is contained in:
parent
3c5ab60e6a
commit
794e96d194
1 changed files with 13 additions and 13 deletions
26
src/mango.c
26
src/mango.c
|
|
@ -4197,19 +4197,6 @@ void motionnotify(uint32_t time, struct wlr_input_device *device, double dx,
|
|||
struct wlr_pointer_constraint_v1 *constraint;
|
||||
bool should_lock = false;
|
||||
|
||||
/* Find the client under the pointer and send the event along. */
|
||||
xytonode(cursor->x, cursor->y, &surface, &c, NULL, &sx, &sy);
|
||||
|
||||
if (cursor_mode == CurPressed && !seat->drag &&
|
||||
surface != seat->pointer_state.focused_surface &&
|
||||
toplevel_from_wlr_surface(seat->pointer_state.focused_surface, &w,
|
||||
&l) >= 0) {
|
||||
c = w;
|
||||
surface = seat->pointer_state.focused_surface;
|
||||
sx = cursor->x - (l ? l->scene->node.x : w->geom.x);
|
||||
sy = cursor->y - (l ? l->scene->node.y : w->geom.y);
|
||||
}
|
||||
|
||||
/* time is 0 in internal calls meant to restore pointer focus. */
|
||||
if (time) {
|
||||
wlr_relative_pointer_manager_v1_send_relative_motion(
|
||||
|
|
@ -4247,6 +4234,19 @@ void motionnotify(uint32_t time, struct wlr_input_device *device, double dx,
|
|||
selmon = xytomon(cursor->x, cursor->y);
|
||||
}
|
||||
|
||||
/* Find the client under the pointer and send the event along. */
|
||||
xytonode(cursor->x, cursor->y, &surface, &c, NULL, &sx, &sy);
|
||||
|
||||
if (cursor_mode == CurPressed && !seat->drag &&
|
||||
surface != seat->pointer_state.focused_surface &&
|
||||
toplevel_from_wlr_surface(seat->pointer_state.focused_surface, &w,
|
||||
&l) >= 0) {
|
||||
c = w;
|
||||
surface = seat->pointer_state.focused_surface;
|
||||
sx = cursor->x - (l ? l->scene->node.x : w->geom.x);
|
||||
sy = cursor->y - (l ? l->scene->node.y : w->geom.y);
|
||||
}
|
||||
|
||||
/* Update drag icon's position */
|
||||
wlr_scene_node_set_position(&drag_icon->node, (int32_t)round(cursor->x),
|
||||
(int32_t)round(cursor->y));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue