diff options
| author | YAMAMOTO Mitsuharu | 2010-11-04 15:39:47 -0400 |
|---|---|---|
| committer | Chong Yidong | 2010-11-04 15:39:47 -0400 |
| commit | db5cada28d2c7cc54afdeaead30d639ebba507fc (patch) | |
| tree | f60bf77b35421ef896df573dcbbe57ce5496d1fe | |
| parent | 00d9e115db74c5f22b198b430bbdb11378a3b4b8 (diff) | |
| parent | 2511e8e04fb3adf5e90685f9973665e2710255ed (diff) | |
| download | emacs-db5cada28d2c7cc54afdeaead30d639ebba507fc.tar.gz emacs-db5cada28d2c7cc54afdeaead30d639ebba507fc.zip | |
Backport fix for Bug#2423 from trunk.
* 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): Undo last change. Call try_window with
TRY_WINDOW_IGNORE_FONTS_CHANGE (Bug#2423).
| -rw-r--r-- | src/ChangeLog | 13 | ||||
| -rw-r--r-- | src/dispextern.h | 4 | ||||
| -rw-r--r-- | src/xdisp.c | 14 | ||||
| -rw-r--r-- | src/xfns.c | 2 |
4 files changed, 26 insertions, 7 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index a16e35df108..1e084a4bc3a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,16 @@ | |||
| 1 | 2010-11-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 2 | |||
| 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). | ||
| 13 | |||
| 1 | 2010-11-04 Jan Djärv <jan.h.d@swipnet.se> | 14 | 2010-11-04 Jan Djärv <jan.h.d@swipnet.se> |
| 2 | 15 | ||
| 3 | * xfns.c (x_real_positions): Only use _NET_FRAME_EXTENTS if our | 16 | * xfns.c (x_real_positions): Only use _NET_FRAME_EXTENTS if our |
diff --git a/src/dispextern.h b/src/dispextern.h index ca91c5b6812..bc34aec2dd5 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -2841,6 +2841,10 @@ extern int x_intersect_rectangles P_ ((XRectangle *, XRectangle *, | |||
| 2841 | XRectangle *)); | 2841 | XRectangle *)); |
| 2842 | #endif | 2842 | #endif |
| 2843 | 2843 | ||
| 2844 | /* Flags passed to try_window. */ | ||
| 2845 | #define TRY_WINDOW_CHECK_MARGINS (1 << 0) | ||
| 2846 | #define TRY_WINDOW_IGNORE_FONTS_CHANGE (1 << 1) | ||
| 2847 | |||
| 2844 | /* Defined in fringe.c */ | 2848 | /* Defined in fringe.c */ |
| 2845 | 2849 | ||
| 2846 | int lookup_fringe_bitmap (Lisp_Object); | 2850 | int lookup_fringe_bitmap (Lisp_Object); |
diff --git a/src/xdisp.c b/src/xdisp.c index 59e38e440e4..a416c8ff435 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -13577,7 +13577,7 @@ redisplay_window (window, just_this_one_p) | |||
| 13577 | = try_window_reusing_current_matrix (w))) | 13577 | = try_window_reusing_current_matrix (w))) |
| 13578 | { | 13578 | { |
| 13579 | IF_DEBUG (debug_method_add (w, "1")); | 13579 | IF_DEBUG (debug_method_add (w, "1")); |
| 13580 | if (try_window (window, startp, 1) < 0) | 13580 | if (try_window (window, startp, TRY_WINDOW_CHECK_MARGINS) < 0) |
| 13581 | /* -1 means we need to scroll. | 13581 | /* -1 means we need to scroll. |
| 13582 | 0 means we need new matrices, but fonts_changed_p | 13582 | 0 means we need new matrices, but fonts_changed_p |
| 13583 | is set in that case, so we will detect it below. */ | 13583 | is set in that case, so we will detect it below. */ |
| @@ -13936,13 +13936,15 @@ redisplay_window (window, just_this_one_p) | |||
| 13936 | Value is 1 if successful. It is zero if fonts were loaded during | 13936 | Value is 1 if successful. It is zero if fonts were loaded during |
| 13937 | redisplay which makes re-adjusting glyph matrices necessary, and -1 | 13937 | redisplay which makes re-adjusting glyph matrices necessary, and -1 |
| 13938 | if point would appear in the scroll margins. | 13938 | if point would appear in the scroll margins. |
| 13939 | (We check that only if CHECK_MARGINS is nonzero. */ | 13939 | (We check the former only if TRY_WINDOW_IGNORE_FONTS_CHANGE is |
| 13940 | unset in FLAGS, and the latter only if TRY_WINDOW_CHECK_MARGINS is | ||
| 13941 | set in FLAGS.) */ | ||
| 13940 | 13942 | ||
| 13941 | int | 13943 | int |
| 13942 | try_window (window, pos, check_margins) | 13944 | try_window (window, pos, flags) |
| 13943 | Lisp_Object window; | 13945 | Lisp_Object window; |
| 13944 | struct text_pos pos; | 13946 | struct text_pos pos; |
| 13945 | int check_margins; | 13947 | int flags; |
| 13946 | { | 13948 | { |
| 13947 | struct window *w = XWINDOW (window); | 13949 | struct window *w = XWINDOW (window); |
| 13948 | struct it it; | 13950 | struct it it; |
| @@ -13964,12 +13966,12 @@ try_window (window, pos, check_margins) | |||
| 13964 | { | 13966 | { |
| 13965 | if (display_line (&it)) | 13967 | if (display_line (&it)) |
| 13966 | last_text_row = it.glyph_row - 1; | 13968 | last_text_row = it.glyph_row - 1; |
| 13967 | if (fonts_changed_p) | 13969 | if (fonts_changed_p && !(flags & TRY_WINDOW_IGNORE_FONTS_CHANGE)) |
| 13968 | return 0; | 13970 | return 0; |
| 13969 | } | 13971 | } |
| 13970 | 13972 | ||
| 13971 | /* Don't let the cursor end in the scroll margins. */ | 13973 | /* Don't let the cursor end in the scroll margins. */ |
| 13972 | if (check_margins | 13974 | if ((flags & TRY_WINDOW_CHECK_MARGINS) |
| 13973 | && !MINI_WINDOW_P (w)) | 13975 | && !MINI_WINDOW_P (w)) |
| 13974 | { | 13976 | { |
| 13975 | int this_scroll_margin; | 13977 | int this_scroll_margin; |
diff --git a/src/xfns.c b/src/xfns.c index 635264ea862..b65323f199f 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -5224,7 +5224,7 @@ Text larger than the specified size is clipped. */) | |||
| 5224 | clear_glyph_matrix (w->desired_matrix); | 5224 | clear_glyph_matrix (w->desired_matrix); |
| 5225 | clear_glyph_matrix (w->current_matrix); | 5225 | clear_glyph_matrix (w->current_matrix); |
| 5226 | SET_TEXT_POS (pos, BEGV, BEGV_BYTE); | 5226 | SET_TEXT_POS (pos, BEGV, BEGV_BYTE); |
| 5227 | try_window (FRAME_ROOT_WINDOW (f), pos, 0); | 5227 | try_window (FRAME_ROOT_WINDOW (f), pos, TRY_WINDOW_IGNORE_FONTS_CHANGE); |
| 5228 | 5228 | ||
| 5229 | /* Compute width and height of the tooltip. */ | 5229 | /* Compute width and height of the tooltip. */ |
| 5230 | width = height = 0; | 5230 | width = height = 0; |