aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
authorKaroly Lorentey2006-04-19 16:23:46 +0000
committerKaroly Lorentey2006-04-19 16:23:46 +0000
commit447b0165acd09060977e05c843f81c0bee4aa4df (patch)
tree70cf2d254760a2cf68a10b67f8a3570c05fff9a5 /src/window.c
parent4c57cca724993ab1334cc5c0b35c22b06daee0c3 (diff)
parent0fea1d10293b4c6d35c1e55b68cd26e91445213c (diff)
downloademacs-447b0165acd09060977e05c843f81c0bee4aa4df.tar.gz
emacs-447b0165acd09060977e05c843f81c0bee4aa4df.zip
Merged from emacs@sv.gnu.org
Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-216 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-217 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-218 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-219 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-220 Improve tq.el. * emacs@sv.gnu.org/emacs--devo--0--patch-221 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-222 Update from CVS: src/puresize.h (PURESIZE_RATIO): Reduce to 10/6. * emacs@sv.gnu.org/emacs--devo--0--patch-223 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-224 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-225 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-226 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-227 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-228 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-229 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-230 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-231 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-232 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-233 Update from CVS: lisp/progmodes/python.el (python-mode): Fix typo. * emacs@sv.gnu.org/gnus--rel--5.10--patch-84 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-85 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-86 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-550
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c63
1 files changed, 46 insertions, 17 deletions
diff --git a/src/window.c b/src/window.c
index cbfc7e02401..61b85e5ad22 100644
--- a/src/window.c
+++ b/src/window.c
@@ -663,12 +663,24 @@ coordinates_in_window (w, x, y)
663 || WINDOW_RIGHTMOST_P (w)) 663 || WINDOW_RIGHTMOST_P (w))
664 { 664 {
665 if (!WINDOW_LEFTMOST_P (w) && abs (*x - x0) < grabbable_width) 665 if (!WINDOW_LEFTMOST_P (w) && abs (*x - x0) < grabbable_width)
666 return ON_VERTICAL_BORDER; 666 {
667 /* Convert X and Y to window relative coordinates.
668 Vertical border is at the left edge of window. */
669 *x = max (0, *x - x0);
670 *y -= top_y;
671 return ON_VERTICAL_BORDER;
672 }
667 } 673 }
668 else 674 else
669 { 675 {
670 if (abs (*x - x1) < grabbable_width) 676 if (abs (*x - x1) < grabbable_width)
671 return ON_VERTICAL_BORDER; 677 {
678 /* Convert X and Y to window relative coordinates.
679 Vertical border is at the right edge of window. */
680 *x = min (x1, *x) - x0;
681 *y -= top_y;
682 return ON_VERTICAL_BORDER;
683 }
672 } 684 }
673 685
674 if (*x < x0 || *x >= x1) 686 if (*x < x0 || *x >= x1)
@@ -710,7 +722,13 @@ coordinates_in_window (w, x, y)
710 && !WINDOW_HAS_VERTICAL_SCROLL_BAR (w) 722 && !WINDOW_HAS_VERTICAL_SCROLL_BAR (w)
711 && !WINDOW_RIGHTMOST_P (w) 723 && !WINDOW_RIGHTMOST_P (w)
712 && (abs (*x - right_x) < grabbable_width)) 724 && (abs (*x - right_x) < grabbable_width))
713 return ON_VERTICAL_BORDER; 725 {
726 /* Convert X and Y to window relative coordinates.
727 Vertical border is at the right edge of window. */
728 *x = min (right_x, *x) - left_x;
729 *y -= top_y;
730 return ON_VERTICAL_BORDER;
731 }
714 } 732 }
715 else 733 else
716 { 734 {
@@ -722,6 +740,8 @@ coordinates_in_window (w, x, y)
722 { 740 {
723 /* On the border on the right side of the window? Assume that 741 /* On the border on the right side of the window? Assume that
724 this area begins at RIGHT_X minus a canonical char width. */ 742 this area begins at RIGHT_X minus a canonical char width. */
743 *x = min (right_x, *x) - left_x;
744 *y -= top_y;
725 return ON_VERTICAL_BORDER; 745 return ON_VERTICAL_BORDER;
726 } 746 }
727 } 747 }
@@ -2015,7 +2035,7 @@ window_loop (type, obj, mini, frames)
2015 `obj & 1' means consider only full-width windows. 2035 `obj & 1' means consider only full-width windows.
2016 `obj & 2' means consider also dedicated windows. */ 2036 `obj & 2' means consider also dedicated windows. */
2017 if (((XINT (obj) & 1) && !WINDOW_FULL_WIDTH_P (w)) 2037 if (((XINT (obj) & 1) && !WINDOW_FULL_WIDTH_P (w))
2018 || (!(XINT (obj) & 2) && EQ (w->dedicated, Qt)) 2038 || (!(XINT (obj) & 2) && !NILP (w->dedicated))
2019 /* Minibuffer windows are always ignored. */ 2039 /* Minibuffer windows are always ignored. */
2020 || MINI_WINDOW_P (w)) 2040 || MINI_WINDOW_P (w))
2021 break; 2041 break;
@@ -2070,7 +2090,7 @@ window_loop (type, obj, mini, frames)
2070 case GET_LARGEST_WINDOW: 2090 case GET_LARGEST_WINDOW:
2071 { /* nil `obj' means to ignore dedicated windows. */ 2091 { /* nil `obj' means to ignore dedicated windows. */
2072 /* Ignore dedicated windows and minibuffers. */ 2092 /* Ignore dedicated windows and minibuffers. */
2073 if (MINI_WINDOW_P (w) || (NILP (obj) && EQ (w->dedicated, Qt))) 2093 if (MINI_WINDOW_P (w) || (NILP (obj) && !NILP (w->dedicated)))
2074 break; 2094 break;
2075 2095
2076 if (NILP (best_window)) 2096 if (NILP (best_window))
@@ -4257,18 +4277,30 @@ adjust_window_trailing_edge (window, delta, horiz_flag)
4257 4277
4258 while (1) 4278 while (1)
4259 { 4279 {
4280 Lisp_Object first_parallel = Qnil;
4281
4260 p = XWINDOW (window); 4282 p = XWINDOW (window);
4261 parent = p->parent; 4283 parent = p->parent;
4262 4284
4263 /* Make sure there is a following window. */ 4285 if (NILP (XWINDOW (window)->next))
4264 if (NILP (parent)
4265 && (horiz_flag ? 1
4266 : NILP (XWINDOW (window)->next)))
4267 { 4286 {
4268 Fset_window_configuration (old_config); 4287 Fset_window_configuration (old_config);
4269 error ("No other window following this one"); 4288 error ("No other window following this one");
4270 } 4289 }
4271 4290
4291 /* See if this level has windows in parallel in the specified
4292 direction. If so, set FIRST_PARALLEL to the first one. */
4293 if (horiz_flag)
4294 {
4295 if (! NILP (parent) && !NILP (XWINDOW (parent)->vchild))
4296 first_parallel = XWINDOW (parent)->vchild;
4297 }
4298 else
4299 {
4300 if (! NILP (parent) && !NILP (XWINDOW (parent)->hchild))
4301 first_parallel = XWINDOW (parent)->hchild;
4302 }
4303
4272 /* Don't make this window too small. */ 4304 /* Don't make this window too small. */
4273 if (XINT (CURSIZE (window)) + delta 4305 if (XINT (CURSIZE (window)) + delta
4274 < (horiz_flag ? window_min_width : window_min_height)) 4306 < (horiz_flag ? window_min_width : window_min_height))
@@ -4286,12 +4318,11 @@ adjust_window_trailing_edge (window, delta, horiz_flag)
4286 XINT (CURSIZE (window)) + delta); 4318 XINT (CURSIZE (window)) + delta);
4287 4319
4288 /* If this window has following siblings in the desired dimension, 4320 /* If this window has following siblings in the desired dimension,
4289 make them smaller. 4321 make them smaller, and exit the loop.
4322
4290 (If we reach the top of the tree and can never do this, 4323 (If we reach the top of the tree and can never do this,
4291 we will fail and report an error, above.) */ 4324 we will fail and report an error, above.) */
4292 if (horiz_flag 4325 if (NILP (first_parallel))
4293 ? !NILP (XWINDOW (parent)->hchild)
4294 : !NILP (XWINDOW (parent)->vchild))
4295 { 4326 {
4296 if (!NILP (XWINDOW (window)->next)) 4327 if (!NILP (XWINDOW (window)->next))
4297 { 4328 {
@@ -4313,9 +4344,7 @@ adjust_window_trailing_edge (window, delta, horiz_flag)
4313 else 4344 else
4314 /* Here we have a chain of parallel siblings, in the other dimension. 4345 /* Here we have a chain of parallel siblings, in the other dimension.
4315 Change the size of the other siblings. */ 4346 Change the size of the other siblings. */
4316 for (child = (horiz_flag 4347 for (child = first_parallel;
4317 ? XWINDOW (parent)->vchild
4318 : XWINDOW (parent)->hchild);
4319 ! NILP (child); 4348 ! NILP (child);
4320 child = XWINDOW (child)->next) 4349 child = XWINDOW (child)->next)
4321 if (! EQ (child, window)) 4350 if (! EQ (child, window))
@@ -4856,7 +4885,7 @@ window_scroll_pixel_based (window, n, whole, noerror)
4856 { 4885 {
4857 if (it.current_y < it.last_visible_y 4886 if (it.current_y < it.last_visible_y
4858 && (it.current_y + it.max_ascent + it.max_descent 4887 && (it.current_y + it.max_ascent + it.max_descent
4859 >= it.last_visible_y)) 4888 > it.last_visible_y))
4860 { 4889 {
4861 /* The last line was only partially visible, make it fully 4890 /* The last line was only partially visible, make it fully
4862 visible. */ 4891 visible. */