comparison src/window.c @ 57309:d039bbffafbc

(coordinates_in_window): Relax check for cursor on vertial border between mode lines. (Fset_window_fringes): Do not allow negative widths. (Fset_window_scroll_bars): Likewise.
author Kim F. Storm <storm@cua.dk>
date Mon, 04 Oct 2004 13:46:19 +0000
parents 0730ef55b4d8
children 22f6e207e697 d83f49cefda3 ff0e824afa37
comparison
equal deleted inserted replaced
57308:d3a7a9384b97 57309:d039bbffafbc
605 /* The width of the area where the vertical line can be dragged. 605 /* The width of the area where the vertical line can be dragged.
606 (Between mode lines for instance. */ 606 (Between mode lines for instance. */
607 int grabbable_width = ux; 607 int grabbable_width = ux;
608 int lmargin_width, rmargin_width, text_left, text_right; 608 int lmargin_width, rmargin_width, text_left, text_right;
609 609
610 if (*x < x0 || *x >= x1)
611 return ON_NOTHING;
612
613 /* In what's below, we subtract 1 when computing right_x because we 610 /* In what's below, we subtract 1 when computing right_x because we
614 want the rightmost pixel, which is given by left_pixel+width-1. */ 611 want the rightmost pixel, which is given by left_pixel+width-1. */
615 if (w->pseudo_window_p) 612 if (w->pseudo_window_p)
616 { 613 {
617 left_x = 0; 614 left_x = 0;
657 { 654 {
658 if (abs (*x - x1) < grabbable_width) 655 if (abs (*x - x1) < grabbable_width)
659 return ON_VERTICAL_BORDER; 656 return ON_VERTICAL_BORDER;
660 } 657 }
661 658
659 if (*x < x0 || *x >= x1)
660 return ON_NOTHING;
661
662 /* Convert X and Y to window relative coordinates. 662 /* Convert X and Y to window relative coordinates.
663 Mode line starts at left edge of window. */ 663 Mode line starts at left edge of window. */
664 *x -= x0; 664 *x -= x0;
665 *y -= top_y; 665 *y -= top_y;
666 return part; 666 return part;
670 && *y < top_y + CURRENT_HEADER_LINE_HEIGHT (w)) 670 && *y < top_y + CURRENT_HEADER_LINE_HEIGHT (w))
671 { 671 {
672 part = ON_HEADER_LINE; 672 part = ON_HEADER_LINE;
673 goto header_vertical_border_check; 673 goto header_vertical_border_check;
674 } 674 }
675
676 if (*x < x0 || *x >= x1)
677 return ON_NOTHING;
675 678
676 /* Outside any interesting column? */ 679 /* Outside any interesting column? */
677 if (*x < left_x || *x > right_x) 680 if (*x < left_x || *x > right_x)
678 return ON_SCROLL_BAR; 681 return ON_SCROLL_BAR;
679 682
6032 Lisp_Object window, left, right, outside_margins; 6035 Lisp_Object window, left, right, outside_margins;
6033 { 6036 {
6034 struct window *w = decode_window (window); 6037 struct window *w = decode_window (window);
6035 6038
6036 if (!NILP (left)) 6039 if (!NILP (left))
6037 CHECK_NUMBER (left); 6040 CHECK_NATNUM (left);
6038 if (!NILP (right)) 6041 if (!NILP (right))
6039 CHECK_NUMBER (right); 6042 CHECK_NATNUM (right);
6040 6043
6041 if (!EQ (w->left_fringe_width, left) 6044 if (!EQ (w->left_fringe_width, left)
6042 || !EQ (w->right_fringe_width, right) 6045 || !EQ (w->right_fringe_width, right)
6043 || !EQ (w->fringes_outside_margins, outside_margins)) 6046 || !EQ (w->fringes_outside_margins, outside_margins))
6044 { 6047 {
6094 Lisp_Object window, width, vertical_type, horizontal_type; 6097 Lisp_Object window, width, vertical_type, horizontal_type;
6095 { 6098 {
6096 struct window *w = decode_window (window); 6099 struct window *w = decode_window (window);
6097 6100
6098 if (!NILP (width)) 6101 if (!NILP (width))
6099 CHECK_NUMBER (width); 6102 CHECK_NATNUM (width);
6100 6103
6101 if (XINT (width) == 0) 6104 if (XINT (width) == 0)
6102 vertical_type = Qnil; 6105 vertical_type = Qnil;
6103 6106
6104 if (!(EQ (vertical_type, Qnil) 6107 if (!(EQ (vertical_type, Qnil)