aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c43
1 files changed, 19 insertions, 24 deletions
diff --git a/src/window.c b/src/window.c
index 5695152c1ff..8a166c06106 100644
--- a/src/window.c
+++ b/src/window.c
@@ -359,7 +359,7 @@ and BOTTOM is one more than the bottommost row used by WINDOW\n\
359 register struct window *w = decode_window (window); 359 register struct window *w = decode_window (window);
360 360
361 return Fcons (w->left, Fcons (w->top, 361 return Fcons (w->left, Fcons (w->top,
362 Fcons (make_number (XFASTINT (w->left) + XFASTINT (w->width)), 362 Fcons (make_number (WINDOW_RIGHT_EDGE (w)),
363 Fcons (make_number (XFASTINT (w->top) 363 Fcons (make_number (XFASTINT (w->top)
364 + XFASTINT (w->height)), 364 + XFASTINT (w->height)),
365 Qnil)))); 365 Qnil))));
@@ -380,25 +380,28 @@ coordinates_in_window (w, x, y)
380 register int *x, *y; 380 register int *x, *y;
381{ 381{
382 register int left = XINT (w->left); 382 register int left = XINT (w->left);
383 register int width = XINT (w->width); 383 register int right_edge = WINDOW_RIGHT_EDGE (w);
384 register int left_margin = WINDOW_LEFT_MARGIN (w);
385 register int right_margin = WINDOW_RIGHT_MARGIN (w);
384 register int window_height = XINT (w->height); 386 register int window_height = XINT (w->height);
385 register int top = XFASTINT (w->top); 387 register int top = XFASTINT (w->top);
386 388
387 if ( *x < left || *x >= left + width 389 if ( *x < left || *x >= right_edge
388 || *y < top || *y >= top + window_height) 390 || *y < top || *y >= top + window_height)
389 return 0; 391 return 0;
390 392
393 if (left_margin != left && *x < left_margin && *x >= left)
394 return 3;
395
396 if (right_margin != right_edge && *x >= right_margin && *x < right_edge)
397 return 3;
398
391 /* Is the character is the mode line? */ 399 /* Is the character is the mode line? */
392 if (*y == top + window_height - 1 400 if (*y == top + window_height - 1
393 && ! MINI_WINDOW_P (w)) 401 && ! MINI_WINDOW_P (w))
394 return 2; 402 return 2;
395 403
396 /* Is the character in the right border? */ 404 *x -= WINDOW_LEFT_MARGIN (w);
397 if (*x == left + width - 1
398 && left + width != FRAME_WIDTH (XFRAME (w->frame)))
399 return 3;
400
401 *x -= left;
402 *y -= top; 405 *y -= top;
403 return 1; 406 return 1;
404} 407}
@@ -1322,8 +1325,7 @@ window_loop (type, obj, mini, frames)
1322 1325
1323 case GET_LRU_WINDOW: 1326 case GET_LRU_WINDOW:
1324 /* t as arg means consider only full-width windows */ 1327 /* t as arg means consider only full-width windows */
1325 if (!NILP (obj) && XFASTINT (XWINDOW (w)->width) 1328 if (!NILP (obj) && !WINDOW_FULL_WIDTH_P (XWINDOW (w)))
1326 != FRAME_WIDTH (XFRAME (WINDOW_FRAME (XWINDOW (w)))))
1327 break; 1329 break;
1328 /* Ignore dedicated windows and minibuffers. */ 1330 /* Ignore dedicated windows and minibuffers. */
1329 if (MINI_WINDOW_P (XWINDOW (w)) 1331 if (MINI_WINDOW_P (XWINDOW (w))
@@ -2134,8 +2136,7 @@ buffer names are handled.")
2134 if (!NILP (window) 2136 if (!NILP (window)
2135 && ! FRAME_NO_SPLIT_P (XFRAME (XWINDOW (window)->frame)) 2137 && ! FRAME_NO_SPLIT_P (XFRAME (XWINDOW (window)->frame))
2136 && window_height (window) >= split_height_threshold 2138 && window_height (window) >= split_height_threshold
2137 && (XFASTINT (XWINDOW (window)->width) 2139 && WINDOW_FULL_WIDTH_P (XWINDOW (window)))
2138 == FRAME_WIDTH (XFRAME (WINDOW_FRAME (XWINDOW (window))))))
2139 window = Fsplit_window (window, Qnil, Qnil); 2140 window = Fsplit_window (window, Qnil, Qnil);
2140 else 2141 else
2141 { 2142 {
@@ -2593,24 +2594,18 @@ window_internal_width (w)
2593 struct window *w; 2594 struct window *w;
2594{ 2595{
2595 FRAME_PTR f = XFRAME (WINDOW_FRAME (w)); 2596 FRAME_PTR f = XFRAME (WINDOW_FRAME (w));
2596 int left = XINT (w->left);
2597 int width = XINT (w->width); 2597 int width = XINT (w->width);
2598 2598
2599 /* If this window is flush against the right edge of the frame, its
2600 internal width is its full width. */
2601 if (left + width >= FRAME_WIDTH (f))
2602 return width;
2603
2604 /* If we are not flush right, then our rightmost columns are
2605 occupied by some sort of separator. */
2606
2607 /* Scroll bars occupy a few columns. */ 2599 /* Scroll bars occupy a few columns. */
2608 if (FRAME_HAS_VERTICAL_SCROLL_BARS (f)) 2600 if (FRAME_HAS_VERTICAL_SCROLL_BARS (f))
2609 return width - FRAME_SCROLL_BAR_COLS (f); 2601 return width - FRAME_SCROLL_BAR_COLS (f);
2610 2602
2611 /* The column of `|' characters separating side-by-side windows 2603 /* The column of `|' characters separating side-by-side windows
2612 occupies one column only. */ 2604 occupies one column only. */
2613 return width - 1; 2605 if (!WINDOW_RIGHTMOST_P (w) && !WINDOW_FULL_WIDTH_P (w))
2606 return width - 1;
2607
2608 return width;
2614} 2609}
2615 2610
2616 2611