mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-15 08:21:03 -04:00
input: pointer-enter: differentiate between the surfaces
This commit is contained in:
parent
0b265cc9a5
commit
d303084a81
1 changed files with 33 additions and 3 deletions
36
input.c
36
input.c
|
|
@ -626,10 +626,40 @@ wl_pointer_enter(void *data, struct wl_pointer *wl_pointer,
|
||||||
int x = wl_fixed_to_int(surface_x) * term->scale;
|
int x = wl_fixed_to_int(surface_x) * term->scale;
|
||||||
int y = wl_fixed_to_int(surface_y) * term->scale;
|
int y = wl_fixed_to_int(surface_y) * term->scale;
|
||||||
|
|
||||||
wayl->mouse.col = x / term->cell_width;
|
switch ((term->active_surface = term_surface_kind(term, surface))) {
|
||||||
wayl->mouse.row = y / term->cell_height;
|
case TERM_SURF_NONE:
|
||||||
|
assert(false);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case TERM_SURF_GRID:
|
||||||
|
wayl->mouse.col = x / term->cell_width;
|
||||||
|
wayl->mouse.row = y / term->cell_height;
|
||||||
|
term_xcursor_update(term);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case TERM_SURF_SEARCH:
|
||||||
|
term_xcursor_update(term);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case TERM_SURF_TITLE:
|
||||||
|
term->xcursor = "left_ptr";
|
||||||
|
render_xcursor_set(term);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case TERM_SURF_BORDER_LEFT:
|
||||||
|
case TERM_SURF_BORDER_RIGHT:
|
||||||
|
term->xcursor = "size_hor";
|
||||||
|
render_xcursor_set(term);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case TERM_SURF_BORDER_TOP:
|
||||||
|
case TERM_SURF_BORDER_BOTTOM:
|
||||||
|
term->xcursor = "size_ver";
|
||||||
|
render_xcursor_set(term);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
term_xcursor_update(term);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue