diff options
| author | Eli Zaretskii | 2010-12-11 17:41:04 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2010-12-11 17:41:04 +0200 |
| commit | 39321b94bfa4e50401e30caedfd09a06629f5bd2 (patch) | |
| tree | 61fdb729ce92638e32ee9827b595a97efb9b90c7 | |
| parent | 2b404597762b85483fc89f716848efac34847aa9 (diff) | |
| download | emacs-39321b94bfa4e50401e30caedfd09a06629f5bd2.tar.gz emacs-39321b94bfa4e50401e30caedfd09a06629f5bd2.zip | |
Fix bug #7398 with truncated glyphs in w32 tooltips.
w32fns.c (Fx_show_tip): Call try_window with last argument
TRY_WINDOW_IGNORE_FONTS_CHANGE. Delete the TODO ifdef: problem
solved. Round up the tip height to an integral multiple of the
frame's line height. Add FRAME_COLUMN_WIDTH to the tip width.
| -rw-r--r-- | src/ChangeLog | 8 | ||||
| -rw-r--r-- | src/w32fns.c | 27 |
2 files changed, 21 insertions, 14 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index abe90235bf3..18c482c2e92 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2010-12-11 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * w32fns.c (Fx_show_tip): Call try_window with last argument | ||
| 4 | TRY_WINDOW_IGNORE_FONTS_CHANGE. Delete the TODO ifdef: problem | ||
| 5 | solved. Round up the tip height to an integral multiple of the | ||
| 6 | frame's line height. Add FRAME_COLUMN_WIDTH to the tip width. | ||
| 7 | (Bug#7398) | ||
| 8 | |||
| 1 | 2010-12-08 Glenn Morris <rgm@gnu.org> | 9 | 2010-12-08 Glenn Morris <rgm@gnu.org> |
| 2 | 10 | ||
| 3 | * fileio.c (Fverify_visited_file_modtime): Default to current buffer. | 11 | * fileio.c (Fverify_visited_file_modtime): Default to current buffer. |
diff --git a/src/w32fns.c b/src/w32fns.c index 04358b77bf5..31feadc2d70 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -5782,7 +5782,7 @@ Text larger than the specified size is clipped. */) | |||
| 5782 | clear_glyph_matrix (w->desired_matrix); | 5782 | clear_glyph_matrix (w->desired_matrix); |
| 5783 | clear_glyph_matrix (w->current_matrix); | 5783 | clear_glyph_matrix (w->current_matrix); |
| 5784 | SET_TEXT_POS (pos, BEGV, BEGV_BYTE); | 5784 | SET_TEXT_POS (pos, BEGV, BEGV_BYTE); |
| 5785 | try_window (FRAME_ROOT_WINDOW (f), pos, 0); | 5785 | try_window (FRAME_ROOT_WINDOW (f), pos, TRY_WINDOW_IGNORE_FONTS_CHANGE); |
| 5786 | 5786 | ||
| 5787 | /* Compute width and height of the tooltip. */ | 5787 | /* Compute width and height of the tooltip. */ |
| 5788 | width = height = seen_reversed_p = 0; | 5788 | width = height = seen_reversed_p = 0; |
| @@ -5804,16 +5804,12 @@ Text larger than the specified size is clipped. */) | |||
| 5804 | { | 5804 | { |
| 5805 | if (!row->reversed_p) | 5805 | if (!row->reversed_p) |
| 5806 | { | 5806 | { |
| 5807 | #ifdef TODO /* Investigate why some fonts need more width than is | ||
| 5808 | calculated for some tooltips. */ | ||
| 5809 | |||
| 5810 | /* There's a glyph at the end of rows that is used to | 5807 | /* There's a glyph at the end of rows that is used to |
| 5811 | place the cursor there. Don't include the width of | 5808 | place the cursor there. Don't include the width of |
| 5812 | this glyph. */ | 5809 | this glyph. */ |
| 5813 | last = &row->glyphs[TEXT_AREA][row->used[TEXT_AREA] - 1]; | 5810 | last = &row->glyphs[TEXT_AREA][row->used[TEXT_AREA] - 1]; |
| 5814 | if (INTEGERP (last->object)) | 5811 | if (INTEGERP (last->object)) |
| 5815 | row_width -= last->pixel_width; | 5812 | row_width -= last->pixel_width; |
| 5816 | #endif | ||
| 5817 | } | 5813 | } |
| 5818 | else | 5814 | else |
| 5819 | { | 5815 | { |
| @@ -5830,7 +5826,6 @@ Text larger than the specified size is clipped. */) | |||
| 5830 | } | 5826 | } |
| 5831 | } | 5827 | } |
| 5832 | 5828 | ||
| 5833 | /* TODO: find why tips do not draw along baseline as instructed. */ | ||
| 5834 | height += row->height; | 5829 | height += row->height; |
| 5835 | width = max (width, row_width); | 5830 | width = max (width, row_width); |
| 5836 | } | 5831 | } |
| @@ -5847,9 +5842,10 @@ Text larger than the specified size is clipped. */) | |||
| 5847 | w->total_cols = make_number (width); | 5842 | w->total_cols = make_number (width); |
| 5848 | FRAME_TOTAL_COLS (f) = width; | 5843 | FRAME_TOTAL_COLS (f) = width; |
| 5849 | adjust_glyphs (f); | 5844 | adjust_glyphs (f); |
| 5845 | w->pseudo_window_p = 1; | ||
| 5850 | clear_glyph_matrix (w->desired_matrix); | 5846 | clear_glyph_matrix (w->desired_matrix); |
| 5851 | clear_glyph_matrix (w->current_matrix); | 5847 | clear_glyph_matrix (w->current_matrix); |
| 5852 | try_window (FRAME_ROOT_WINDOW (f), pos, 0); | 5848 | try_window (FRAME_ROOT_WINDOW (f), pos, TRY_WINDOW_IGNORE_FONTS_CHANGE); |
| 5853 | width = height = 0; | 5849 | width = height = 0; |
| 5854 | /* Recompute width and height of the tooltip. */ | 5850 | /* Recompute width and height of the tooltip. */ |
| 5855 | for (i = 0; i < w->desired_matrix->nrows; ++i) | 5851 | for (i = 0; i < w->desired_matrix->nrows; ++i) |
| @@ -5862,21 +5858,22 @@ Text larger than the specified size is clipped. */) | |||
| 5862 | break; | 5858 | break; |
| 5863 | row->full_width_p = 1; | 5859 | row->full_width_p = 1; |
| 5864 | row_width = row->pixel_width; | 5860 | row_width = row->pixel_width; |
| 5865 | #ifdef TODO /* See above. */ | ||
| 5866 | if (row->used[TEXT_AREA] && !row->reversed_p) | 5861 | if (row->used[TEXT_AREA] && !row->reversed_p) |
| 5867 | { | 5862 | { |
| 5868 | last = &row->glyphs[TEXT_AREA][row->used[TEXT_AREA] - 1]; | 5863 | last = &row->glyphs[TEXT_AREA][row->used[TEXT_AREA] - 1]; |
| 5869 | if (INTEGERP (last->object)) | 5864 | if (INTEGERP (last->object)) |
| 5870 | row_width -= last->pixel_width; | 5865 | row_width -= last->pixel_width; |
| 5871 | } | 5866 | } |
| 5872 | #endif | ||
| 5873 | 5867 | ||
| 5874 | height += row->height; | 5868 | height += row->height; |
| 5875 | width = max (width, row_width); | 5869 | width = max (width, row_width); |
| 5876 | } | 5870 | } |
| 5877 | } | 5871 | } |
| 5878 | 5872 | ||
| 5879 | /* Add the frame's internal border to the width and height the X | 5873 | /* Round up the height to an integral multiple of FRAME_LINE_HEIGHT. */ |
| 5874 | if (height % FRAME_LINE_HEIGHT (f) != 0) | ||
| 5875 | height += FRAME_LINE_HEIGHT (f) - height % FRAME_LINE_HEIGHT (f); | ||
| 5876 | /* Add the frame's internal border to the width and height the w32 | ||
| 5880 | window should have. */ | 5877 | window should have. */ |
| 5881 | height += 2 * FRAME_INTERNAL_BORDER_WIDTH (f); | 5878 | height += 2 * FRAME_INTERNAL_BORDER_WIDTH (f); |
| 5882 | width += 2 * FRAME_INTERNAL_BORDER_WIDTH (f); | 5879 | width += 2 * FRAME_INTERNAL_BORDER_WIDTH (f); |
| @@ -5895,11 +5892,13 @@ Text larger than the specified size is clipped. */) | |||
| 5895 | FRAME_EXTERNAL_MENU_BAR (f)); | 5892 | FRAME_EXTERNAL_MENU_BAR (f)); |
| 5896 | 5893 | ||
| 5897 | /* Position and size tooltip, and put it in the topmost group. | 5894 | /* Position and size tooltip, and put it in the topmost group. |
| 5898 | The add-on of 3 to the 5th argument is a kludge: without it, | 5895 | The add-on of FRAME_COLUMN_WIDTH to the 5th argument is a |
| 5899 | some fonts cause the last character of the tip to be truncated, | 5896 | peculiarity of w32 display: without it, some fonts cause the |
| 5900 | for some obscure reason. */ | 5897 | last character of the tip to be truncated or wrapped around to |
| 5898 | the next line. */ | ||
| 5901 | SetWindowPos (FRAME_W32_WINDOW (f), HWND_TOPMOST, | 5899 | SetWindowPos (FRAME_W32_WINDOW (f), HWND_TOPMOST, |
| 5902 | root_x, root_y, rect.right - rect.left + 3, | 5900 | root_x, root_y, |
| 5901 | rect.right - rect.left + FRAME_COLUMN_WIDTH (f), | ||
| 5903 | rect.bottom - rect.top, SWP_NOACTIVATE); | 5902 | rect.bottom - rect.top, SWP_NOACTIVATE); |
| 5904 | 5903 | ||
| 5905 | /* Ensure tooltip is on top of other topmost windows (eg menus). */ | 5904 | /* Ensure tooltip is on top of other topmost windows (eg menus). */ |