vt_core.c (282750) | vt_core.c (282823) |
---|---|
1/*- 2 * Copyright (c) 2009, 2013 The FreeBSD Foundation 3 * All rights reserved. 4 * 5 * This software was developed by Ed Schouten under sponsorship from the 6 * FreeBSD Foundation. 7 * 8 * Portions of this software were developed by Oleksandr Rybalko --- 17 unchanged lines hidden (view full) --- 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 */ 32 33#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2009, 2013 The FreeBSD Foundation 3 * All rights reserved. 4 * 5 * This software was developed by Ed Schouten under sponsorship from the 6 * FreeBSD Foundation. 7 * 8 * Portions of this software were developed by Oleksandr Rybalko --- 17 unchanged lines hidden (view full) --- 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 */ 32 33#include <sys/cdefs.h> |
34__FBSDID("$FreeBSD: stable/10/sys/dev/vt/vt_core.c 282750 2015-05-11 08:16:33Z avg $"); | 34__FBSDID("$FreeBSD: stable/10/sys/dev/vt/vt_core.c 282823 2015-05-12 18:09:54Z emaste $"); |
35 36#include "opt_compat.h" 37 38#include <sys/param.h> 39#include <sys/consio.h> 40#include <sys/eventhandler.h> 41#include <sys/fbio.h> 42#include <sys/kbio.h> --- 970 unchanged lines hidden (view full) --- 1013 *bg = tmp; 1014 } 1015} 1016 1017#ifndef SC_NO_CUTPASTE 1018int 1019vt_is_cursor_in_area(const struct vt_device *vd, const term_rect_t *area) 1020{ | 35 36#include "opt_compat.h" 37 38#include <sys/param.h> 39#include <sys/consio.h> 40#include <sys/eventhandler.h> 41#include <sys/fbio.h> 42#include <sys/kbio.h> --- 970 unchanged lines hidden (view full) --- 1013 *bg = tmp; 1014 } 1015} 1016 1017#ifndef SC_NO_CUTPASTE 1018int 1019vt_is_cursor_in_area(const struct vt_device *vd, const term_rect_t *area) 1020{ |
1021 unsigned int mx, my, x1, y1, x2, y2; | 1021 unsigned int mx, my; |
1022 1023 /* 1024 * We use the cursor position saved during the current refresh, 1025 * in case the cursor moved since. 1026 */ 1027 mx = vd->vd_mx_drawn + vd->vd_curwindow->vw_draw_area.tr_begin.tp_col; 1028 my = vd->vd_my_drawn + vd->vd_curwindow->vw_draw_area.tr_begin.tp_row; 1029 | 1022 1023 /* 1024 * We use the cursor position saved during the current refresh, 1025 * in case the cursor moved since. 1026 */ 1027 mx = vd->vd_mx_drawn + vd->vd_curwindow->vw_draw_area.tr_begin.tp_col; 1028 my = vd->vd_my_drawn + vd->vd_curwindow->vw_draw_area.tr_begin.tp_row; 1029 |
1030 x1 = area->tr_begin.tp_col; 1031 y1 = area->tr_begin.tp_row; 1032 x2 = area->tr_end.tp_col; 1033 y2 = area->tr_end.tp_row; 1034 1035 if (((mx >= x1 && x2 - 1 >= mx) || 1036 (mx < x1 && mx + vd->vd_mcursor->width >= x1)) && 1037 ((my >= y1 && y2 - 1 >= my) || 1038 (my < y1 && my + vd->vd_mcursor->height >= y1))) 1039 return (1); 1040 1041 return (0); | 1030 if (mx >= area->tr_end.tp_col || 1031 mx + vd->vd_mcursor->width <= area->tr_begin.tp_col || 1032 my >= area->tr_end.tp_row || 1033 my + vd->vd_mcursor->height <= area->tr_begin.tp_row) 1034 return (0); 1035 return (1); |
1042} 1043 1044static void 1045vt_mark_mouse_position_as_dirty(struct vt_device *vd) 1046{ 1047 term_rect_t area; 1048 struct vt_window *vw; 1049 struct vt_font *vf; --- 1666 unchanged lines hidden --- | 1036} 1037 1038static void 1039vt_mark_mouse_position_as_dirty(struct vt_device *vd) 1040{ 1041 term_rect_t area; 1042 struct vt_window *vw; 1043 struct vt_font *vf; --- 1666 unchanged lines hidden --- |