aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog41
-rw-r--r--src/window.c81
-rw-r--r--src/xterm.c9
3 files changed, 60 insertions, 71 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 52fe8baa92e..2c72e97b7f7 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,13 @@
12011-10-15 Martin Rudalics <rudalics@gmx.at>
2
3 * window.c (coordinates_in_window): Rewrite and delabelize
4 vertical border check. (Bug#5357) (Bug#9618)
5
62011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
7
8 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
9 errors in XSetWindowBorder (bug#9310).
10
12011-10-13 Dmitry Antipov <dmantipov@yandex.ru> 112011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
2 12
3 * editfns.c (Fset_time_zone_rule): Replace free with xfree to 13 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
@@ -71,8 +81,8 @@
71 81
722011-10-07 Stefan Monnier <monnier@iro.umontreal.ca> 822011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
73 83
74 * buffer.c (syms_of_buffer) <enable-multibyte-characters>: Don't 84 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
75 advertise functionality which we discourage or doesn't work. 85 Don't advertise functionality which we discourage or doesn't work.
76 86
772011-10-07 Paul Eggert <eggert@cs.ucla.edu> 872011-10-07 Paul Eggert <eggert@cs.ucla.edu>
78 88
@@ -338,8 +348,7 @@
3382011-09-17 Eli Zaretskii <eliz@gnu.org> 3482011-09-17 Eli Zaretskii <eliz@gnu.org>
339 349
340 * xdisp.c (reseat_at_next_visible_line_start): Keep information 350 * xdisp.c (reseat_at_next_visible_line_start): Keep information
341 about the current paragraph and restore it after the call to 351 about the current paragraph and restore it after the call to reseat.
342 reseat.
343 352
344 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro. 353 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
345 (bidi_find_paragraph_start): Search back for paragraph beginning 354 (bidi_find_paragraph_start): Search back for paragraph beginning
@@ -559,7 +568,7 @@
559 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values. 568 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
560 (esprintf, exprintf, evxprintf): New functions. 569 (esprintf, exprintf, evxprintf): New functions.
561 * keyboard.c (command_loop_level): Now EMACS_INT, not int. 570 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
562 (cmd_error): kbd macro iterations count is now EMACS_INT, not int. 571 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
563 (modify_event_symbol): Do not assume that the length of 572 (modify_event_symbol): Do not assume that the length of
564 name_alist_or_stem is safe to alloca and fits in int. 573 name_alist_or_stem is safe to alloca and fits in int.
565 (Fexecute_extended_command): Likewise for function name and binding. 574 (Fexecute_extended_command): Likewise for function name and binding.
@@ -1303,8 +1312,7 @@
1303 1312
13042011-08-18 Andreas Schwab <schwab@linux-m68k.org> 13132011-08-18 Andreas Schwab <schwab@linux-m68k.org>
1305 1314
1306 * process.c (Fnetwork_interface_list): Correctly determine buffer 1315 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
1307 size.
1308 1316
13092011-08-17 Chong Yidong <cyd@stupidchicken.com> 13172011-08-17 Chong Yidong <cyd@stupidchicken.com>
1310 1318
@@ -1349,15 +1357,10 @@
1349 1357
13502011-08-15 Eli Zaretskii <eliz@gnu.org> 13582011-08-15 Eli Zaretskii <eliz@gnu.org>
1351 1359
1352 * biditype.h: File removed. 1360 * bidimirror.h:
1353 1361 * biditype.h: Remove file.
1354 * bidimirror.h: File removed. 1362 * makefile.w32-in ($(BLD)/bidi.$(O)):
1355 1363 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
1356 * deps.mk (bidi.o): Remove biditype.h and
1357 bidimirror.h.
1358
1359 * makefile.w32-in ($(BLD)/bidi.$(O)): Remove biditype.h and
1360 bidimirror.h.
1361 1364
1362 * dispextern.h: Fix a typo in the comment to bidi_type_t. 1365 * dispextern.h: Fix a typo in the comment to bidi_type_t.
1363 1366
@@ -1532,8 +1535,7 @@
1532 1535
15332011-08-04 Andreas Schwab <schwab@linux-m68k.org> 15362011-08-04 Andreas Schwab <schwab@linux-m68k.org>
1534 1537
1535 * regex.c (re_iswctype): Remove some redundant boolean 1538 * regex.c (re_iswctype): Remove some redundant boolean conversions.
1536 conversions.
1537 1539
15382011-08-04 Jan Djärv <jan.h.d@swipnet.se> 15402011-08-04 Jan Djärv <jan.h.d@swipnet.se>
1539 1541
@@ -2070,8 +2072,7 @@
20702011-07-15 Eli Zaretskii <eliz@gnu.org> 20722011-07-15 Eli Zaretskii <eliz@gnu.org>
2071 2073
2072 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with 2074 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
2073 bidi redisplay when a line includes both an image and is 2075 bidi redisplay when a line includes both an image and is truncated.
2074 truncated.
2075 2076
20762011-07-14 Paul Eggert <eggert@cs.ucla.edu> 20772011-07-14 Paul Eggert <eggert@cs.ucla.edu>
2077 2078
diff --git a/src/window.c b/src/window.c
index 94b9f8a451f..7f4714ba17e 100644
--- a/src/window.c
+++ b/src/window.c
@@ -921,22 +921,45 @@ static enum window_part
921coordinates_in_window (register struct window *w, int x, int y) 921coordinates_in_window (register struct window *w, int x, int y)
922{ 922{
923 struct frame *f = XFRAME (WINDOW_FRAME (w)); 923 struct frame *f = XFRAME (WINDOW_FRAME (w));
924 int left_x, right_x;
925 enum window_part part; 924 enum window_part part;
926 int ux = FRAME_COLUMN_WIDTH (f); 925 int ux = FRAME_COLUMN_WIDTH (f);
927 int x0 = WINDOW_LEFT_EDGE_X (w); 926 int left_x = WINDOW_LEFT_EDGE_X (w);
928 int x1 = WINDOW_RIGHT_EDGE_X (w); 927 int right_x = WINDOW_RIGHT_EDGE_X (w);
928 int top_y = WINDOW_TOP_EDGE_Y (w);
929 int bottom_y = WINDOW_BOTTOM_EDGE_Y (w);
929 /* The width of the area where the vertical line can be dragged. 930 /* The width of the area where the vertical line can be dragged.
930 (Between mode lines for instance. */ 931 (Between mode lines for instance. */
931 int grabbable_width = ux; 932 int grabbable_width = ux;
932 int lmargin_width, rmargin_width, text_left, text_right; 933 int lmargin_width, rmargin_width, text_left, text_right;
933 int top_y = WINDOW_TOP_EDGE_Y (w);
934 int bottom_y = WINDOW_BOTTOM_EDGE_Y (w);
935 934
936 /* Outside any interesting row? */ 935 /* Outside any interesting row or column? */
937 if (y < top_y || y >= bottom_y) 936 if (y < top_y || y >= bottom_y || x < left_x || x >= right_x)
938 return ON_NOTHING; 937 return ON_NOTHING;
939 938
939 /* On the mode line or header line? */
940 if ((WINDOW_WANTS_MODELINE_P (w)
941 && y >= bottom_y - CURRENT_MODE_LINE_HEIGHT (w)
942 && (part = ON_MODE_LINE))
943 || (WINDOW_WANTS_HEADER_LINE_P (w)
944 && y < top_y + CURRENT_HEADER_LINE_HEIGHT (w)
945 && (part = ON_HEADER_LINE)))
946 {
947 /* If it's under/over the scroll bar portion of the mode/header
948 line, say it's on the vertical line. That's to be able to
949 resize windows horizontally in case we're using toolkit scroll
950 bars. Note: If scrollbars are on the left, the window that
951 must be eventually resized is that on the left of WINDOW. */
952 if ((WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w)
953 && !WINDOW_LEFTMOST_P (w)
954 && eabs (x - left_x) < grabbable_width)
955 || (!WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w)
956 && !WINDOW_RIGHTMOST_P (w)
957 && eabs (x - right_x) < grabbable_width))
958 return ON_VERTICAL_BORDER;
959 else
960 return part;
961 }
962
940 /* In what's below, we subtract 1 when computing right_x because we 963 /* In what's below, we subtract 1 when computing right_x because we
941 want the rightmost pixel, which is given by left_pixel+width-1. */ 964 want the rightmost pixel, which is given by left_pixel+width-1. */
942 if (w->pseudo_window_p) 965 if (w->pseudo_window_p)
@@ -950,50 +973,6 @@ coordinates_in_window (register struct window *w, int x, int y)
950 right_x = WINDOW_BOX_RIGHT_EDGE_X (w) - 1; 973 right_x = WINDOW_BOX_RIGHT_EDGE_X (w) - 1;
951 } 974 }
952 975
953 /* On the mode line or header line? If it's near the start of
954 the mode or header line of window that's has a horizontal
955 sibling, say it's on the vertical line. That's to be able
956 to resize windows horizontally in case we're using toolkit
957 scroll bars. */
958
959 if (WINDOW_WANTS_MODELINE_P (w)
960 && y >= bottom_y - CURRENT_MODE_LINE_HEIGHT (w))
961 {
962 part = ON_MODE_LINE;
963
964 header_vertical_border_check:
965 /* We're somewhere on the mode line. We consider the place
966 between mode lines of horizontally adjacent mode lines
967 as the vertical border. If scroll bars on the left,
968 return the right window. */
969 if ((WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w)
970 || WINDOW_RIGHTMOST_P (w))
971 && !WINDOW_LEFTMOST_P (w)
972 && eabs (x - x0) < grabbable_width)
973 return ON_VERTICAL_BORDER;
974
975 /* Make sure we're not at the rightmost position of a
976 mode-/header-line and there's yet another window on the
977 right. (Bug#1372) */
978 else if ((WINDOW_RIGHTMOST_P (w) || x < x1)
979 && eabs (x - x1) < grabbable_width)
980 return ON_VERTICAL_BORDER;
981
982 if (x < x0 || x >= x1)
983 return ON_NOTHING;
984
985 return part;
986 }
987
988 if (WINDOW_WANTS_HEADER_LINE_P (w)
989 && y < top_y + CURRENT_HEADER_LINE_HEIGHT (w))
990 {
991 part = ON_HEADER_LINE;
992 goto header_vertical_border_check;
993 }
994
995 if (x < x0 || x >= x1) return ON_NOTHING;
996
997 /* Outside any interesting column? */ 976 /* Outside any interesting column? */
998 if (x < left_x || x > right_x) 977 if (x < left_x || x > right_x)
999 return ON_SCROLL_BAR; 978 return ON_SCROLL_BAR;
diff --git a/src/xterm.c b/src/xterm.c
index 1357afa0c15..128a274ff10 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -3364,8 +3364,14 @@ frame_highlight (struct frame *f)
3364 and border pixel are window attributes which are "private to the 3364 and border pixel are window attributes which are "private to the
3365 client", so we can always change it to whatever we want. */ 3365 client", so we can always change it to whatever we want. */
3366 BLOCK_INPUT; 3366 BLOCK_INPUT;
3367 /* I recently started to get errors in this XSetWindowBorder, depending on
3368 the window-manager in use, tho something more is at play since I've been
3369 using that same window-manager binary for ever. Let's not crash just
3370 because of this (bug#9310). */
3371 x_catch_errors (FRAME_X_DISPLAY (f));
3367 XSetWindowBorder (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 3372 XSetWindowBorder (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
3368 f->output_data.x->border_pixel); 3373 f->output_data.x->border_pixel);
3374 x_uncatch_errors ();
3369 UNBLOCK_INPUT; 3375 UNBLOCK_INPUT;
3370 x_update_cursor (f, 1); 3376 x_update_cursor (f, 1);
3371 x_set_frame_alpha (f); 3377 x_set_frame_alpha (f);
@@ -3379,8 +3385,11 @@ frame_unhighlight (struct frame *f)
3379 and border pixel are window attributes which are "private to the 3385 and border pixel are window attributes which are "private to the
3380 client", so we can always change it to whatever we want. */ 3386 client", so we can always change it to whatever we want. */
3381 BLOCK_INPUT; 3387 BLOCK_INPUT;
3388 /* Same as above for XSetWindowBorder (bug#9310). */
3389 x_catch_errors (FRAME_X_DISPLAY (f));
3382 XSetWindowBorderPixmap (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 3390 XSetWindowBorderPixmap (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
3383 f->output_data.x->border_tile); 3391 f->output_data.x->border_tile);
3392 x_uncatch_errors ();
3384 UNBLOCK_INPUT; 3393 UNBLOCK_INPUT;
3385 x_update_cursor (f, 1); 3394 x_update_cursor (f, 1);
3386 x_set_frame_alpha (f); 3395 x_set_frame_alpha (f);