aboutsummaryrefslogtreecommitdiff
path: root/input.c
diff options
context:
space:
mode:
Diffstat (limited to 'input.c')
-rw-r--r--input.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/input.c b/input.c
index 5f864a8d..35baf3d4 100644
--- a/input.c
+++ b/input.c
@@ -1405,11 +1405,18 @@ wl_pointer_enter(void *data, struct wl_pointer *wl_pointer,
struct wl_window *win = wl_surface_get_user_data(surface);
struct terminal *term = win->term;
+ int x = wl_fixed_to_int(surface_x) * term->scale;
+ int y = wl_fixed_to_int(surface_y) * term->scale;
+
seat->pointer.serial = serial;
seat->pointer.hidden = false;
+ seat->mouse.x = x;
+ seat->mouse.y = y;
- LOG_DBG("pointer-enter: pointer=%p, serial=%u, surface = %p, new-moused = %p",
- (void *)wl_pointer, serial, (void *)surface, (void *)term);
+ LOG_DBG("pointer-enter: pointer=%p, serial=%u, surface = %p, new-moused = %p, "
+ "x=%d, y=%d",
+ (void *)wl_pointer, serial, (void *)surface, (void *)term,
+ x, y);
xassert(tll_length(seat->mouse.buttons) == 0);
@@ -1418,9 +1425,6 @@ wl_pointer_enter(void *data, struct wl_pointer *wl_pointer,
seat->mouse_focus = term;
- int x = wl_fixed_to_int(surface_x) * term->scale;
- int y = wl_fixed_to_int(surface_y) * term->scale;
-
switch ((term->active_surface = term_surface_kind(term, surface))) {
case TERM_SURF_GRID: {
/*