mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-23 01:40:12 -05: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 y = wl_fixed_to_int(surface_y) * term->scale;
|
||||
|
||||
wayl->mouse.col = x / term->cell_width;
|
||||
wayl->mouse.row = y / term->cell_height;
|
||||
switch ((term->active_surface = term_surface_kind(term, surface))) {
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue