emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r102637: Fix bug #7398 with truncated


From: Eli Zaretskii
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r102637: Fix bug #7398 with truncated glyphs in w32 tooltips.
Date: Sat, 11 Dec 2010 17:41:04 +0200
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 102637
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Sat 2010-12-11 17:41:04 +0200
message:
  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.
modified:
  src/ChangeLog
  src/w32fns.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2010-12-11 02:41:47 +0000
+++ b/src/ChangeLog     2010-12-11 15:41:04 +0000
@@ -1,3 +1,11 @@
+2010-12-11  Eli Zaretskii  <address@hidden>
+
+       * 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.
+       (Bug#7398)
+
 2010-12-08  Glenn Morris  <address@hidden>
 
        * fileio.c (Fverify_visited_file_modtime): Default to current buffer.

=== modified file 'src/w32fns.c'
--- a/src/w32fns.c      2010-11-14 19:58:24 +0000
+++ b/src/w32fns.c      2010-12-11 15:41:04 +0000
@@ -5782,7 +5782,7 @@
   clear_glyph_matrix (w->desired_matrix);
   clear_glyph_matrix (w->current_matrix);
   SET_TEXT_POS (pos, BEGV, BEGV_BYTE);
-  try_window (FRAME_ROOT_WINDOW (f), pos, 0);
+  try_window (FRAME_ROOT_WINDOW (f), pos, TRY_WINDOW_IGNORE_FONTS_CHANGE);
 
   /* Compute width and height of the tooltip.  */
   width = height = seen_reversed_p = 0;
@@ -5804,16 +5804,12 @@
        {
          if (!row->reversed_p)
            {
-#ifdef TODO   /* Investigate why some fonts need more width than is
-                calculated for some tooltips.  */
-
              /* There's a glyph at the end of rows that is used to
                 place the cursor there.  Don't include the width of
                 this glyph.  */
              last = &row->glyphs[TEXT_AREA][row->used[TEXT_AREA] - 1];
              if (INTEGERP (last->object))
                row_width -= last->pixel_width;
-#endif
            }
          else
            {
@@ -5830,7 +5826,6 @@
            }
        }
 
-      /* TODO: find why tips do not draw along baseline as instructed.  */
       height += row->height;
       width = max (width, row_width);
     }
@@ -5847,9 +5842,10 @@
       w->total_cols = make_number (width);
       FRAME_TOTAL_COLS (f) = width;
       adjust_glyphs (f);
+      w->pseudo_window_p = 1;
       clear_glyph_matrix (w->desired_matrix);
       clear_glyph_matrix (w->current_matrix);
-      try_window (FRAME_ROOT_WINDOW (f), pos, 0);
+      try_window (FRAME_ROOT_WINDOW (f), pos, TRY_WINDOW_IGNORE_FONTS_CHANGE);
       width = height = 0;
       /* Recompute width and height of the tooltip.  */
       for (i = 0; i < w->desired_matrix->nrows; ++i)
@@ -5862,21 +5858,22 @@
            break;
          row->full_width_p = 1;
          row_width = row->pixel_width;
-#ifdef TODO /* See above.  */
          if (row->used[TEXT_AREA] && !row->reversed_p)
            {
              last = &row->glyphs[TEXT_AREA][row->used[TEXT_AREA] - 1];
              if (INTEGERP (last->object))
                row_width -= last->pixel_width;
            }
-#endif
 
          height += row->height;
          width = max (width, row_width);
        }
     }
 
-  /* Add the frame's internal border to the width and height the X
+  /* Round up the height to an integral multiple of FRAME_LINE_HEIGHT.  */
+  if (height % FRAME_LINE_HEIGHT (f) != 0)
+    height += FRAME_LINE_HEIGHT (f) - height % FRAME_LINE_HEIGHT (f);
+  /* Add the frame's internal border to the width and height the w32
      window should have.  */
   height += 2 * FRAME_INTERNAL_BORDER_WIDTH (f);
   width += 2 * FRAME_INTERNAL_BORDER_WIDTH (f);
@@ -5895,11 +5892,13 @@
                      FRAME_EXTERNAL_MENU_BAR (f));
 
     /* Position and size tooltip, and put it in the topmost group.
-       The add-on of 3 to the 5th argument is a kludge: without it,
-       some fonts cause the last character of the tip to be truncated,
-       for some obscure reason.  */
+       The add-on of FRAME_COLUMN_WIDTH to the 5th argument is a
+       peculiarity of w32 display: without it, some fonts cause the
+       last character of the tip to be truncated or wrapped around to
+       the next line.  */
     SetWindowPos (FRAME_W32_WINDOW (f), HWND_TOPMOST,
-                 root_x, root_y, rect.right - rect.left + 3,
+                 root_x, root_y,
+                 rect.right - rect.left + FRAME_COLUMN_WIDTH (f),
                  rect.bottom - rect.top, SWP_NOACTIVATE);
 
     /* Ensure tooltip is on top of other topmost windows (eg menus).  */


reply via email to

[Prev in Thread] Current Thread [Next in Thread]