Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/vt/vt_core.c
Show First 20 Lines • Show All 1,023 Lines • ▼ Show 20 Lines | if (invert) { | ||||
*bg = tmp; | *bg = tmp; | ||||
} | } | ||||
} | } | ||||
#ifndef SC_NO_CUTPASTE | #ifndef SC_NO_CUTPASTE | ||||
int | int | ||||
vt_is_cursor_in_area(const struct vt_device *vd, const term_rect_t *area) | vt_is_cursor_in_area(const struct vt_device *vd, const term_rect_t *area) | ||||
{ | { | ||||
unsigned int mx, my, x1, y1, x2, y2; | unsigned int mx, my; | ||||
/* | /* | ||||
* We use the cursor position saved during the current refresh, | * We use the cursor position saved during the current refresh, | ||||
* in case the cursor moved since. | * in case the cursor moved since. | ||||
*/ | */ | ||||
mx = vd->vd_mx_drawn + vd->vd_curwindow->vw_draw_area.tr_begin.tp_col; | mx = vd->vd_mx_drawn + vd->vd_curwindow->vw_draw_area.tr_begin.tp_col; | ||||
my = vd->vd_my_drawn + vd->vd_curwindow->vw_draw_area.tr_begin.tp_row; | my = vd->vd_my_drawn + vd->vd_curwindow->vw_draw_area.tr_begin.tp_row; | ||||
x1 = area->tr_begin.tp_col; | if (mx >= area->tr_end.tp_col || | ||||
y1 = area->tr_begin.tp_row; | mx + vd->vd_mcursor->width <= area->tr_begin.tp_col || | ||||
x2 = area->tr_end.tp_col; | my >= area->tr_end.tp_row || | ||||
y2 = area->tr_end.tp_row; | my + vd->vd_mcursor->height <= area->tr_begin.tp_row) | ||||
if (((mx >= x1 && x2 - 1 >= mx) || | |||||
(mx < x1 && mx + vd->vd_mcursor->width >= x1)) && | |||||
((my >= y1 && y2 - 1 >= my) || | |||||
(my < y1 && my + vd->vd_mcursor->height >= y1))) | |||||
return (1); | |||||
return (0); | return (0); | ||||
return (1); | |||||
} | } | ||||
static void | static void | ||||
vt_mark_mouse_position_as_dirty(struct vt_device *vd) | vt_mark_mouse_position_as_dirty(struct vt_device *vd) | ||||
{ | { | ||||
term_rect_t area; | term_rect_t area; | ||||
struct vt_window *vw; | struct vt_window *vw; | ||||
struct vt_font *vf; | struct vt_font *vf; | ||||
▲ Show 20 Lines • Show All 1,727 Lines • Show Last 20 Lines |