aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann2000-12-01 20:45:45 +0000
committerGerd Moellmann2000-12-01 20:45:45 +0000
commit447e9da0fa09da826a033791d1151040d702064e (patch)
tree25729b5ed865eb41b809644fde37c6c2a39eacb2 /src
parent86d1db205f3e806316d87640dac728b1a683719c (diff)
downloademacs-447e9da0fa09da826a033791d1151040d702064e.tar.gz
emacs-447e9da0fa09da826a033791d1151040d702064e.zip
(coordinates_in_window): Handle computations for
positions on the vertical bar and fringes differently for window-system frames. Consider some pixels near the vertical bar as on the bar if the frame doesn't have vertical scroll bars. Associate positions between mode or header lines with the right window, the left one.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog9
-rw-r--r--src/window.c66
2 files changed, 54 insertions, 21 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index b8a419b2acb..9c98f9d31f6 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,12 @@
12000-12-01 Gerd Moellmann <gerd@gnu.org>
2
3 * window.c (coordinates_in_window): Handle computations for
4 positions on the vertical bar and fringes differently for
5 window-system frames. Consider some pixels near the vertical bar
6 as on the bar if the frame doesn't have vertical scroll bars.
7 Associate positions between mode or header lines with the
8 right window, the left one.
9
12000-12-01 Jason Rumney <jasonr@gnu.org> 102000-12-01 Jason Rumney <jasonr@gnu.org>
2 11
3 * w32term.c (w32_clear_window): Avoid clearing an invalid frame. 12 * w32term.c (w32_clear_window): Avoid clearing an invalid frame.
diff --git a/src/window.c b/src/window.c
index 676156c221b..2460e00bf5c 100644
--- a/src/window.c
+++ b/src/window.c
@@ -538,8 +538,9 @@ coordinates_in_window (w, x, y)
538 if (WINDOW_WANTS_MODELINE_P (w) 538 if (WINDOW_WANTS_MODELINE_P (w)
539 && *y >= bottom_y - CURRENT_MODE_LINE_HEIGHT (w)) 539 && *y >= bottom_y - CURRENT_MODE_LINE_HEIGHT (w))
540 { 540 {
541 if (XFASTINT (w->left) > 0 541 if (!WINDOW_RIGHTMOST_P (w)
542 && (abs (*x - XFASTINT (w->left) * CANON_X_UNIT (f)) 542 && (abs (*x - ((XFASTINT (w->left) + XFASTINT (w->width))
543 * CANON_X_UNIT (f)))
543 < CANON_X_UNIT (f) / 2)) 544 < CANON_X_UNIT (f) / 2))
544 return ON_VERTICAL_BORDER; 545 return ON_VERTICAL_BORDER;
545 return ON_MODE_LINE; 546 return ON_MODE_LINE;
@@ -548,33 +549,56 @@ coordinates_in_window (w, x, y)
548 if (WINDOW_WANTS_HEADER_LINE_P (w) 549 if (WINDOW_WANTS_HEADER_LINE_P (w)
549 && *y < top_y + CURRENT_HEADER_LINE_HEIGHT (w)) 550 && *y < top_y + CURRENT_HEADER_LINE_HEIGHT (w))
550 { 551 {
551 if (XFASTINT (w->left) > 0 552 if (!WINDOW_RIGHTMOST_P (w)
552 && (abs (*x - XFASTINT (w->left) * CANON_X_UNIT (f)) 553 && (abs (*x - ((XFASTINT (w->left) + XFASTINT (w->width))
554 * CANON_X_UNIT (f)))
553 < CANON_X_UNIT (f) / 2)) 555 < CANON_X_UNIT (f) / 2))
554 return ON_VERTICAL_BORDER; 556 return ON_VERTICAL_BORDER;
555 return ON_HEADER_LINE; 557 return ON_HEADER_LINE;
556 } 558 }
557 559
558 /* Need to say "*x > right_x" rather than >=, since on character 560 if (FRAME_WINDOW_P (f))
559 terminals, the vertical line's x coordinate is right_x. */
560 if (*x < left_x || *x > right_x)
561 { 561 {
562 /* Other lines than the mode line don't include flags areas and 562 if (!w->pseudo_window_p
563 scroll bars on the left. */ 563 && !FRAME_HAS_VERTICAL_SCROLL_BARS (f)
564 && !WINDOW_RIGHTMOST_P (w)
565 && (abs (*x - right_x - flags_area_width) < CANON_X_UNIT (f) / 2))
566 return ON_VERTICAL_BORDER;
567
568 if (*x < left_x || *x > right_x)
569 {
570 /* Other lines than the mode line don't include flags areas and
571 scroll bars on the left. */
564 572
565 /* Convert X and Y to window-relative pixel coordinates. */ 573 /* Convert X and Y to window-relative pixel coordinates. */
566 *x -= left_x; 574 *x -= left_x;
567 *y -= top_y; 575 *y -= top_y;
568 return *x < left_x ? ON_LEFT_FRINGE : ON_RIGHT_FRINGE; 576 return *x < left_x ? ON_LEFT_FRINGE : ON_RIGHT_FRINGE;
577 }
569 } 578 }
579 else
580 {
581 /* Need to say "*x > right_x" rather than >=, since on character
582 terminals, the vertical line's x coordinate is right_x. */
583 if (*x < left_x || *x > right_x)
584 {
585 /* Other lines than the mode line don't include flags areas and
586 scroll bars on the left. */
587
588 /* Convert X and Y to window-relative pixel coordinates. */
589 *x -= left_x;
590 *y -= top_y;
591 return *x < left_x ? ON_LEFT_FRINGE : ON_RIGHT_FRINGE;
592 }
570 593
571 /* Here, too, "*x > right_x" is because of character terminals. */ 594 /* Here, too, "*x > right_x" is because of character terminals. */
572 if (!w->pseudo_window_p 595 if (!w->pseudo_window_p
573 && !WINDOW_RIGHTMOST_P (w) 596 && !WINDOW_RIGHTMOST_P (w)
574 && *x > right_x - CANON_X_UNIT (f)) 597 && *x > right_x - CANON_X_UNIT (f))
575 /* On the border on the right side of the window? Assume that 598 /* On the border on the right side of the window? Assume that
576 this area begins at RIGHT_X minus a canonical char width. */ 599 this area begins at RIGHT_X minus a canonical char width. */
577 return ON_VERTICAL_BORDER; 600 return ON_VERTICAL_BORDER;
601 }
578 602
579 /* Convert X and Y to window-relative pixel coordinates. */ 603 /* Convert X and Y to window-relative pixel coordinates. */
580 *x -= left_x; 604 *x -= left_x;