diff options
| author | YAMAMOTO Mitsuharu | 2010-04-10 19:52:30 +0900 |
|---|---|---|
| committer | YAMAMOTO Mitsuharu | 2010-04-10 19:52:30 +0900 |
| commit | 6eff5c3dcd268cbc740ad9b89112203aad2a9756 (patch) | |
| tree | 30da7e203a86191266f1cb6732dd7ea91f6d869c | |
| parent | 5634ff8508021cf03ce07709d992aff98d33902e (diff) | |
| download | emacs-6eff5c3dcd268cbc740ad9b89112203aad2a9756.tar.gz emacs-6eff5c3dcd268cbc740ad9b89112203aad2a9756.zip | |
Don't abort try_window with fonts change when showing tooltip (Bug#2423).
* dispextern.h (TRY_WINDOW_CHECK_MARGINS)
(TRY_WINDOW_IGNORE_FONTS_CHANGE): New defines.
* xdisp.c (try_window): Change arg from CHECK_MARGINS to FLAGS.
Don't abort with fonts change if TRY_WINDOW_IGNORE_FONTS_CHANGE is
set in FLAGS. Callers with non-zero CHECK_MARGINS changed to use
TRY_WINDOW_CHECK_MARGINS.
* xfns.c (Fx_show_tip): Call try_window with TRY_WINDOW_IGNORE_FONTS_CHANGE.
| -rw-r--r-- | src/ChangeLog | 11 | ||||
| -rw-r--r-- | src/dispextern.h | 4 | ||||
| -rw-r--r-- | src/xdisp.c | 14 | ||||
| -rw-r--r-- | src/xfns.c | 2 |
4 files changed, 23 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 43fdaaf3276..157ff6db673 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,6 +1,15 @@ | |||
| 1 | 2010-04-10 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | 1 | 2010-04-10 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> |
| 2 | 2 | ||
| 3 | * xfns.c (Fx_show_tip): Undo last change. | 3 | * dispextern.h (TRY_WINDOW_CHECK_MARGINS) |
| 4 | (TRY_WINDOW_IGNORE_FONTS_CHANGE): New defines. | ||
| 5 | |||
| 6 | * xdisp.c (try_window): Change arg from CHECK_MARGINS to FLAGS. | ||
| 7 | Don't abort with fonts change if TRY_WINDOW_IGNORE_FONTS_CHANGE is | ||
| 8 | set in FLAGS. Callers with non-zero CHECK_MARGINS changed to use | ||
| 9 | TRY_WINDOW_CHECK_MARGINS. | ||
| 10 | |||
| 11 | * xfns.c (Fx_show_tip): Undo last change. Call try_window with | ||
| 12 | TRY_WINDOW_IGNORE_FONTS_CHANGE (Bug#2423). | ||
| 4 | 13 | ||
| 5 | 2010-04-09 Jan Djärv <jan.h.d@swipnet.se> | 14 | 2010-04-09 Jan Djärv <jan.h.d@swipnet.se> |
| 6 | 15 | ||
diff --git a/src/dispextern.h b/src/dispextern.h index b8f68ec0e70..00da256c43e 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -2974,6 +2974,10 @@ extern int x_intersect_rectangles P_ ((XRectangle *, XRectangle *, | |||
| 2974 | XRectangle *)); | 2974 | XRectangle *)); |
| 2975 | #endif | 2975 | #endif |
| 2976 | 2976 | ||
| 2977 | /* Flags passed to try_window. */ | ||
| 2978 | #define TRY_WINDOW_CHECK_MARGINS (1 << 0) | ||
| 2979 | #define TRY_WINDOW_IGNORE_FONTS_CHANGE (1 << 1) | ||
| 2980 | |||
| 2977 | /* Defined in fringe.c */ | 2981 | /* Defined in fringe.c */ |
| 2978 | 2982 | ||
| 2979 | int lookup_fringe_bitmap (Lisp_Object); | 2983 | int lookup_fringe_bitmap (Lisp_Object); |
diff --git a/src/xdisp.c b/src/xdisp.c index baede013485..902651dcc44 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -14203,7 +14203,7 @@ redisplay_window (window, just_this_one_p) | |||
| 14203 | = try_window_reusing_current_matrix (w))) | 14203 | = try_window_reusing_current_matrix (w))) |
| 14204 | { | 14204 | { |
| 14205 | IF_DEBUG (debug_method_add (w, "1")); | 14205 | IF_DEBUG (debug_method_add (w, "1")); |
| 14206 | if (try_window (window, startp, 1) < 0) | 14206 | if (try_window (window, startp, TRY_WINDOW_CHECK_MARGINS) < 0) |
| 14207 | /* -1 means we need to scroll. | 14207 | /* -1 means we need to scroll. |
| 14208 | 0 means we need new matrices, but fonts_changed_p | 14208 | 0 means we need new matrices, but fonts_changed_p |
| 14209 | is set in that case, so we will detect it below. */ | 14209 | is set in that case, so we will detect it below. */ |
| @@ -14554,13 +14554,15 @@ redisplay_window (window, just_this_one_p) | |||
| 14554 | Value is 1 if successful. It is zero if fonts were loaded during | 14554 | Value is 1 if successful. It is zero if fonts were loaded during |
| 14555 | redisplay which makes re-adjusting glyph matrices necessary, and -1 | 14555 | redisplay which makes re-adjusting glyph matrices necessary, and -1 |
| 14556 | if point would appear in the scroll margins. | 14556 | if point would appear in the scroll margins. |
| 14557 | (We check that only if CHECK_MARGINS is nonzero. */ | 14557 | (We check the former only if TRY_WINDOW_IGNORE_FONTS_CHANGE is |
| 14558 | unset in FLAGS, and the latter only if TRY_WINDOW_CHECK_MARGINS is | ||
| 14559 | set in FLAGS.) */ | ||
| 14558 | 14560 | ||
| 14559 | int | 14561 | int |
| 14560 | try_window (window, pos, check_margins) | 14562 | try_window (window, pos, flags) |
| 14561 | Lisp_Object window; | 14563 | Lisp_Object window; |
| 14562 | struct text_pos pos; | 14564 | struct text_pos pos; |
| 14563 | int check_margins; | 14565 | int flags; |
| 14564 | { | 14566 | { |
| 14565 | struct window *w = XWINDOW (window); | 14567 | struct window *w = XWINDOW (window); |
| 14566 | struct it it; | 14568 | struct it it; |
| @@ -14582,12 +14584,12 @@ try_window (window, pos, check_margins) | |||
| 14582 | { | 14584 | { |
| 14583 | if (display_line (&it)) | 14585 | if (display_line (&it)) |
| 14584 | last_text_row = it.glyph_row - 1; | 14586 | last_text_row = it.glyph_row - 1; |
| 14585 | if (fonts_changed_p) | 14587 | if (fonts_changed_p && !(flags & TRY_WINDOW_IGNORE_FONTS_CHANGE)) |
| 14586 | return 0; | 14588 | return 0; |
| 14587 | } | 14589 | } |
| 14588 | 14590 | ||
| 14589 | /* Don't let the cursor end in the scroll margins. */ | 14591 | /* Don't let the cursor end in the scroll margins. */ |
| 14590 | if (check_margins | 14592 | if ((flags & TRY_WINDOW_CHECK_MARGINS) |
| 14591 | && !MINI_WINDOW_P (w)) | 14593 | && !MINI_WINDOW_P (w)) |
| 14592 | { | 14594 | { |
| 14593 | int this_scroll_margin; | 14595 | int this_scroll_margin; |
diff --git a/src/xfns.c b/src/xfns.c index 647526cc22b..52d6b7bd00f 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -5228,7 +5228,7 @@ Text larger than the specified size is clipped. */) | |||
| 5228 | clear_glyph_matrix (w->desired_matrix); | 5228 | clear_glyph_matrix (w->desired_matrix); |
| 5229 | clear_glyph_matrix (w->current_matrix); | 5229 | clear_glyph_matrix (w->current_matrix); |
| 5230 | SET_TEXT_POS (pos, BEGV, BEGV_BYTE); | 5230 | SET_TEXT_POS (pos, BEGV, BEGV_BYTE); |
| 5231 | try_window (FRAME_ROOT_WINDOW (f), pos, 0); | 5231 | try_window (FRAME_ROOT_WINDOW (f), pos, TRY_WINDOW_IGNORE_FONTS_CHANGE); |
| 5232 | 5232 | ||
| 5233 | /* Compute width and height of the tooltip. */ | 5233 | /* Compute width and height of the tooltip. */ |
| 5234 | width = height = 0; | 5234 | width = height = 0; |