emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/src/w32term.c


From: Juanma Barranquero
Subject: [Emacs-diffs] Changes to emacs/src/w32term.c
Date: Fri, 08 Nov 2002 03:42:04 -0500

Index: emacs/src/w32term.c
diff -c emacs/src/w32term.c:1.169 emacs/src/w32term.c:1.170
*** emacs/src/w32term.c:1.169   Sat Oct 26 19:52:52 2002
--- emacs/src/w32term.c Fri Nov  8 03:42:03 2002
***************
*** 155,161 ****
  
  /* If a string, w32_read_socket generates an event to display that string.
     (The display is done in read_char.)  */
!    
  static Lisp_Object help_echo;
  static Lisp_Object help_echo_window;
  static Lisp_Object help_echo_object;
--- 155,161 ----
  
  /* If a string, w32_read_socket generates an event to display that string.
     (The display is done in read_char.)  */
! 
  static Lisp_Object help_echo;
  static Lisp_Object help_echo_window;
  static Lisp_Object help_echo_object;
***************
*** 415,421 ****
  void x_display_cursor P_ ((struct window *w, int, int, int, int, int));
  void x_display_and_set_cursor P_ ((struct window *, int, int, int, int, int));
  static void w32_draw_fringe_bitmap P_ ((struct window *, HDC hdc,
!                                       struct glyph_row *, 
                                        enum fringe_bitmap_type, int left_p));
  static void w32_clip_to_row P_ ((struct window *, struct glyph_row *,
                                   HDC, int));
--- 415,421 ----
  void x_display_cursor P_ ((struct window *w, int, int, int, int, int));
  void x_display_and_set_cursor P_ ((struct window *, int, int, int, int, int));
  static void w32_draw_fringe_bitmap P_ ((struct window *, HDC hdc,
!                                       struct glyph_row *,
                                        enum fringe_bitmap_type, int left_p));
  static void w32_clip_to_row P_ ((struct window *, struct glyph_row *,
                                   HDC, int));
***************
*** 438,444 ****
  /* This is a function useful for recording debugging information about
     the sequence of occurrences in this file.  */
  
! struct record 
  {
    char *locus;
    int type;
--- 438,444 ----
  /* This is a function useful for recording debugging information about
     the sequence of occurrences in this file.  */
  
! struct record
  {
    char *locus;
    int type;
***************
*** 527,533 ****
  }
  
  /* Draw a filled rectangle at the specified position. */
! void 
  w32_fill_rect (f, hdc, pix, lprect)
       FRAME_PTR f;
       HDC hdc;
--- 527,533 ----
  }
  
  /* Draw a filled rectangle at the specified position. */
! void
  w32_fill_rect (f, hdc, pix, lprect)
       FRAME_PTR f;
       HDC hdc;
***************
*** 541,547 ****
    DeleteObject (hb);
  }
  
! void 
  w32_clear_window (f)
       FRAME_PTR f;
  {
--- 541,547 ----
    DeleteObject (hb);
  }
  
! void
  w32_clear_window (f)
       FRAME_PTR f;
  {
***************
*** 564,570 ****
  /***********************************************************************
                    Starting and ending an update
   ***********************************************************************/
!                                                                       
  /* Start an update of frame F.  This function is installed as a hook
     for update_begin, i.e. it is called when update_begin is called.
     This function is called prior to calls to x_update_window_begin for
--- 564,570 ----
  /***********************************************************************
                    Starting and ending an update
   ***********************************************************************/
! 
  /* Start an update of frame F.  This function is installed as a hook
     for update_begin, i.e. it is called when update_begin is called.
     This function is called prior to calls to x_update_window_begin for
***************
*** 625,631 ****
         flag set.  So, rows containing mouse-face glyphs are never
         scrolled, and we don't have to switch the mouse highlight off
         here to prevent it from being scrolled.  */
!       
        /* Can we tell that this update does not affect the window
         where the mouse highlight is?  If so, no need to turn off.
         Likewise, don't do anything if the frame is garbaged;
--- 625,631 ----
         flag set.  So, rows containing mouse-face glyphs are never
         scrolled, and we don't have to switch the mouse highlight off
         here to prevent it from being scrolled.  */
! 
        /* Can we tell that this update does not affect the window
         where the mouse highlight is?  If so, no need to turn off.
         Likewise, don't do anything if the frame is garbaged;
***************
*** 658,664 ****
       struct window *w;
  {
    struct frame *f = XFRAME (WINDOW_FRAME (w));
!   
    /* Redraw borders between horizontally adjacent windows.  Don't
       do it for frames with vertical scroll bars because either the
       right scroll bar of a window, or the left scroll bar of its
--- 658,664 ----
       struct window *w;
  {
    struct frame *f = XFRAME (WINDOW_FRAME (w));
! 
    /* Redraw borders between horizontally adjacent windows.  Don't
       do it for frames with vertical scroll bars because either the
       right scroll bar of a window, or the left scroll bar of its
***************
*** 681,687 ****
      }
  }
  
!    
  /* End update of window W (which is equal to updated_window).
  
     Draw vertical borders between horizontally adjacent windows, and
--- 681,687 ----
      }
  }
  
! 
  /* End update of window W (which is equal to updated_window).
  
     Draw vertical borders between horizontally adjacent windows, and
***************
*** 711,717 ****
        x_display_and_set_cursor (w, 1, output_cursor.hpos,
                                  output_cursor.vpos,
                                  output_cursor.x, output_cursor.y);
!       
        x_draw_vertical_border (w);
        UNBLOCK_INPUT;
      }
--- 711,717 ----
        x_display_and_set_cursor (w, 1, output_cursor.hpos,
                                  output_cursor.vpos,
                                  output_cursor.x, output_cursor.y);
! 
        x_draw_vertical_border (w);
        UNBLOCK_INPUT;
      }
***************
*** 792,798 ****
    int width, height;
  
    xassert (w);
!   
    if (!desired_row->mode_line_p && !w->pseudo_window_p)
      {
        BLOCK_INPUT;
--- 792,798 ----
    int width, height;
  
    xassert (w);
! 
    if (!desired_row->mode_line_p && !w->pseudo_window_p)
      {
        BLOCK_INPUT;
***************
*** 847,853 ****
       int left_p;
  {
    struct frame *f = XFRAME (WINDOW_FRAME (w));
-   Window window = FRAME_W32_WINDOW (f);
    HDC compat_hdc;
    int x, y, wd, h, dy;
    int b1, b2;
--- 847,852 ----
***************
*** 873,885 ****
        h = left_height;
        pixmap = left_bmp;
        break;
!       
      case OVERLAY_ARROW_BITMAP:
        wd = ov_width;
        h = ov_height;
        pixmap = ov_bmp;
        break;
!       
      case RIGHT_TRUNCATION_BITMAP:
        wd = right_width;
        h = right_height;
--- 872,884 ----
        h = left_height;
        pixmap = left_bmp;
        break;
! 
      case OVERLAY_ARROW_BITMAP:
        wd = ov_width;
        h = ov_height;
        pixmap = ov_bmp;
        break;
! 
      case RIGHT_TRUNCATION_BITMAP:
        wd = right_width;
        h = right_height;
***************
*** 891,897 ****
        h = continued_height;
        pixmap = continued_bmp;
        break;
!       
      case CONTINUATION_LINE_BITMAP:
        wd = continuation_width;
        h = continuation_height;
--- 890,896 ----
        h = continued_height;
        pixmap = continued_bmp;
        break;
! 
      case CONTINUATION_LINE_BITMAP:
        wd = continuation_width;
        h = continuation_height;
***************
*** 959,965 ****
    if (b1 >= 0)
      {
        int header_line_height = WINDOW_DISPLAY_HEADER_LINE_HEIGHT (w);
!       
        w32_fill_area (f, hdc, face->background,
                       b1,
                       WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height,
--- 958,964 ----
    if (b1 >= 0)
      {
        int header_line_height = WINDOW_DISPLAY_HEADER_LINE_HEIGHT (w);
! 
        w32_fill_area (f, hdc, face->background,
                       b1,
                       WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height,
***************
*** 1087,1093 ****
  
     HPOS and VPOS are column/row positions in a window glyph matrix.  X
     and Y are window text area relative pixel positions.
!    
     If this is done during an update, updated_window will contain the
     window that is being updated and the position is the future output
     cursor position for that window.  If updated_window is null, use
--- 1086,1092 ----
  
     HPOS and VPOS are column/row positions in a window glyph matrix.  X
     and Y are window text area relative pixel positions.
! 
     If this is done during an update, updated_window will contain the
     window that is being updated and the position is the future output
     cursor position for that window.  If updated_window is null, use
***************
*** 1385,1391 ****
  }
  
  
! static BOOL 
  w32_use_unicode_for_codepage (codepage)
       int codepage;
  {
--- 1384,1390 ----
  }
  
  
! static BOOL
  w32_use_unicode_for_codepage (codepage)
       int codepage;
  {
***************
*** 1449,1459 ****
        /* Fixed encoding scheme.  See fontset.h for the meaning of the
         encoding numbers.  */
        int enc = font_info->encoding[charset];
!       
        if ((enc == 1 || enc == 2)
          && CHARSET_DIMENSION (charset) == 2)
        *char2b = BUILD_WCHAR_T (BYTE1 (*char2b) | 0x80, BYTE2 (*char2b));
!       
        if (enc == 1 || enc == 3
            || (enc == 4 && CHARSET_DIMENSION (charset) == 1))
        *char2b = BUILD_WCHAR_T (BYTE1 (*char2b), BYTE2 (*char2b) | 0x80);
--- 1448,1458 ----
        /* Fixed encoding scheme.  See fontset.h for the meaning of the
         encoding numbers.  */
        int enc = font_info->encoding[charset];
! 
        if ((enc == 1 || enc == 2)
          && CHARSET_DIMENSION (charset) == 2)
        *char2b = BUILD_WCHAR_T (BYTE1 (*char2b) | 0x80, BYTE2 (*char2b));
! 
        if (enc == 1 || enc == 3
            || (enc == 4 && CHARSET_DIMENSION (charset) == 1))
        *char2b = BUILD_WCHAR_T (BYTE1 (*char2b), BYTE2 (*char2b) | 0x80);
***************
*** 1531,1537 ****
    else
      {
        int c1, c2, charset;
!       
        /* Split characters into bytes.  If c2 is -1 afterwards, C is
         really a one-byte character so that byte1 is zero.  */
        SPLIT_CHAR (c, charset, c1, c2);
--- 1530,1536 ----
    else
      {
        int c1, c2, charset;
! 
        /* Split characters into bytes.  If c2 is -1 afterwards, C is
         really a one-byte character so that byte1 is zero.  */
        SPLIT_CHAR (c, charset, c1, c2);
***************
*** 1539,1545 ****
        *char2b = BUILD_WCHAR_T (c1, c2);
        else
        *char2b = BUILD_WCHAR_T (0, c1);
!   
        /* Maybe encode the character in *CHAR2B.  */
        if (face->font != NULL)
        {
--- 1538,1544 ----
        *char2b = BUILD_WCHAR_T (c1, c2);
        else
        *char2b = BUILD_WCHAR_T (0, c1);
! 
        /* Maybe encode the character in *CHAR2B.  */
        if (face->font != NULL)
        {
***************
*** 1553,1559 ****
    /* Make sure X resources of the face are allocated.  */
    xassert (face != NULL);
    PREPARE_FACE_FOR_DISPLAY (f, face);
!   
    return face;
  }
  
--- 1552,1558 ----
    /* Make sure X resources of the face are allocated.  */
    xassert (face != NULL);
    PREPARE_FACE_FOR_DISPLAY (f, face);
! 
    return face;
  }
  
***************
*** 1595,1601 ****
    else
      {
        int c1, c2, charset;
!       
        /* Split characters into bytes.  If c2 is -1 afterwards, C is
         really a one-byte character so that byte1 is zero.  */
        SPLIT_CHAR (glyph->u.ch, charset, c1, c2);
--- 1594,1600 ----
    else
      {
        int c1, c2, charset;
! 
        /* Split characters into bytes.  If c2 is -1 afterwards, C is
         really a one-byte character so that byte1 is zero.  */
        SPLIT_CHAR (glyph->u.ch, charset, c1, c2);
***************
*** 1624,1630 ****
  }
  
  
! /* Store one glyph for IT->char_to_display in IT->glyph_row.  
     Called from x_produce_glyphs when IT->glyph_row is non-null.  */
  
  static INLINE void
--- 1623,1629 ----
  }
  
  
! /* Store one glyph for IT->char_to_display in IT->glyph_row.
     Called from x_produce_glyphs when IT->glyph_row is non-null.  */
  
  static INLINE void
***************
*** 1633,1642 ****
  {
    struct glyph *glyph;
    enum glyph_row_area area = it->area;
!   
    xassert (it->glyph_row);
    xassert (it->char_to_display != '\n' && it->char_to_display != '\t');
!   
    glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area];
    if (glyph < it->glyph_row->glyphs[area + 1])
      {
--- 1632,1641 ----
  {
    struct glyph *glyph;
    enum glyph_row_area area = it->area;
! 
    xassert (it->glyph_row);
    xassert (it->char_to_display != '\n' && it->char_to_display != '\t');
! 
    glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area];
    if (glyph < it->glyph_row->glyphs[area + 1])
      {
***************
*** 1659,1665 ****
      }
  }
  
! /* Store one glyph for the composition IT->cmp_id in IT->glyph_row.  
     Called from x_produce_glyphs when IT->glyph_row is non-null.  */
  
  static INLINE void
--- 1658,1664 ----
      }
  }
  
! /* Store one glyph for the composition IT->cmp_id in IT->glyph_row.
     Called from x_produce_glyphs when IT->glyph_row is non-null.  */
  
  static INLINE void
***************
*** 1668,1676 ****
  {
    struct glyph *glyph;
    enum glyph_row_area area = it->area;
!   
    xassert (it->glyph_row);
!   
    glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area];
    if (glyph < it->glyph_row->glyphs[area + 1])
      {
--- 1667,1675 ----
  {
    struct glyph *glyph;
    enum glyph_row_area area = it->area;
! 
    xassert (it->glyph_row);
! 
    glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area];
    if (glyph < it->glyph_row->glyphs[area + 1])
      {
***************
*** 1741,1747 ****
    it->pixel_width = img->width + 2 * img->hmargin;
  
    it->nglyphs = 1;
!   
    if (face->box != FACE_NO_BOX)
      {
        if (face->box_line_width > 0)
--- 1740,1746 ----
    it->pixel_width = img->width + 2 * img->hmargin;
  
    it->nglyphs = 1;
! 
    if (face->box != FACE_NO_BOX)
      {
        if (face->box_line_width > 0)
***************
*** 1749,1755 ****
          it->ascent += face->box_line_width;
          it->descent += face->box_line_width;
        }
!       
        if (it->start_of_box_run_p)
        it->pixel_width += abs (face->box_line_width);
        if (it->end_of_box_run_p)
--- 1748,1754 ----
          it->ascent += face->box_line_width;
          it->descent += face->box_line_width;
        }
! 
        if (it->start_of_box_run_p)
        it->pixel_width += abs (face->box_line_width);
        if (it->end_of_box_run_p)
***************
*** 1757,1768 ****
      }
  
    take_vertical_position_into_account (it);
!   
    if (it->glyph_row)
      {
        struct glyph *glyph;
        enum glyph_row_area area = it->area;
!       
        glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area];
        if (glyph < it->glyph_row->glyphs[area + 1])
        {
--- 1756,1767 ----
      }
  
    take_vertical_position_into_account (it);
! 
    if (it->glyph_row)
      {
        struct glyph *glyph;
        enum glyph_row_area area = it->area;
! 
        glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area];
        if (glyph < it->glyph_row->glyphs[area + 1])
        {
***************
*** 1787,1796 ****
  
  
  /* Append a stretch glyph to IT->glyph_row.  OBJECT is the source
!    of the glyph, WIDTH and HEIGHT are the width and height of the 
!    stretch.  ASCENT is the percentage/100 of HEIGHT to use for the 
     ascent of the glyph (0 <= ASCENT <= 1).  */
!   
  static void
  x_append_stretch_glyph (it, object, width, height, ascent)
       struct it *it;
--- 1786,1795 ----
  
  
  /* Append a stretch glyph to IT->glyph_row.  OBJECT is the source
!    of the glyph, WIDTH and HEIGHT are the width and height of the
!    stretch.  ASCENT is the percentage/100 of HEIGHT to use for the
     ascent of the glyph (0 <= ASCENT <= 1).  */
! 
  static void
  x_append_stretch_glyph (it, object, width, height, ascent)
       struct it *it;
***************
*** 1802,1808 ****
    enum glyph_row_area area = it->area;
  
    xassert (ascent >= 0 && ascent <= 1);
!   
    glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area];
    if (glyph < it->glyph_row->glyphs[area + 1])
      {
--- 1801,1807 ----
    enum glyph_row_area area = it->area;
  
    xassert (ascent >= 0 && ascent <= 1);
! 
    glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area];
    if (glyph < it->glyph_row->glyphs[area + 1])
      {
***************
*** 1832,1838 ****
     being recognized:
  
     1. `:width WIDTH' specifies that the space should be WIDTH *
!    canonical char width wide.  WIDTH may be an integer or floating 
     point number.
  
     2. `:relative-width FACTOR' specifies that the width of the stretch
--- 1831,1837 ----
     being recognized:
  
     1. `:width WIDTH' specifies that the space should be WIDTH *
!    canonical char width wide.  WIDTH may be an integer or floating
     point number.
  
     2. `:relative-width FACTOR' specifies that the width of the stretch
***************
*** 1842,1848 ****
     3. `:align-to HPOS' specifies that the space should be wide enough
     to reach HPOS, a value in canonical character units.
  
!    Exactly one of the above pairs must be present.  
  
     4. `:height HEIGHT' specifies that the height of the stretch produced
     should be HEIGHT, measured in canonical character units.
--- 1841,1847 ----
     3. `:align-to HPOS' specifies that the space should be wide enough
     to reach HPOS, a value in canonical character units.
  
!    Exactly one of the above pairs must be present.
  
     4. `:height HEIGHT' specifies that the height of the stretch produced
     should be HEIGHT, measured in canonical character units.
***************
*** 1880,1886 ****
    XFontStruct *font = face->font ? face->font : FRAME_FONT (it->f);
  
    PREPARE_FACE_FOR_DISPLAY (it->f, face);
!   
    /* List should start with `space'.  */
    xassert (CONSP (it->object) && EQ (XCAR (it->object), Qspace));
    plist = XCDR (it->object);
--- 1879,1885 ----
    XFontStruct *font = face->font ? face->font : FRAME_FONT (it->f);
  
    PREPARE_FACE_FOR_DISPLAY (it->f, face);
! 
    /* List should start with `space'.  */
    xassert (CONSP (it->object) && EQ (XCAR (it->object), Qspace));
    plist = XCDR (it->object);
***************
*** 1898,1904 ****
         property.  */
        struct it it2;
        unsigned char *p = BYTE_POS_ADDR (IT_BYTEPOS (*it));
!       
        it2 = *it;
        if (it->multibyte_p)
        {
--- 1897,1903 ----
         property.  */
        struct it it2;
        unsigned char *p = BYTE_POS_ADDR (IT_BYTEPOS (*it));
! 
        it2 = *it;
        if (it->multibyte_p)
        {
***************
*** 1920,1926 ****
    else
      /* Nothing specified -> width defaults to canonical char width.  */
      width = CANON_X_UNIT (it->f);
!   
    /* Compute height.  */
    if (prop = Fplist_get (plist, QCheight),
        NUMVAL (prop) > 0)
--- 1919,1925 ----
    else
      /* Nothing specified -> width defaults to canonical char width.  */
      width = CANON_X_UNIT (it->f);
! 
    /* Compute height.  */
    if (prop = Fplist_get (plist, QCheight),
        NUMVAL (prop) > 0)
***************
*** 1931,1937 ****
    else
      height = FONT_HEIGHT (font);
  
!   /* Compute percentage of height used for ascent.  If 
       `:ascent ASCENT' is present and valid, use that.  Otherwise,
       derive the ascent from the font in use.  */
    if (prop = Fplist_get (plist, QCascent),
--- 1930,1936 ----
    else
      height = FONT_HEIGHT (font);
  
!   /* Compute percentage of height used for ascent.  If
       `:ascent ASCENT' is present and valid, use that.  Otherwise,
       derive the ascent from the font in use.  */
    if (prop = Fplist_get (plist, QCascent),
***************
*** 1965,1977 ****
          it->ascent += face->box_line_width;
          it->descent += face->box_line_width;
        }
!       
        if (it->start_of_box_run_p)
        it->pixel_width += abs (face->box_line_width);
        if (it->end_of_box_run_p)
        it->pixel_width += abs (face->box_line_width);
      }
!   
    take_vertical_position_into_account (it);
  }
  
--- 1964,1976 ----
          it->ascent += face->box_line_width;
          it->descent += face->box_line_width;
        }
! 
        if (it->start_of_box_run_p)
        it->pixel_width += abs (face->box_line_width);
        if (it->end_of_box_run_p)
        it->pixel_width += abs (face->box_line_width);
      }
! 
    take_vertical_position_into_account (it);
  }
  
***************
*** 2063,2069 ****
              face = FACE_FROM_ID (it->f, it->face_id);
            }
          }
!       
        /* Get font to use.  Encode IT->char_to_display.  */
        x_get_char_face_and_encoding (it->f, it->char_to_display,
                                      it->face_id, &char2b,
--- 2062,2068 ----
              face = FACE_FROM_ID (it->f, it->face_id);
            }
          }
! 
        /* Get font to use.  Encode IT->char_to_display.  */
        x_get_char_face_and_encoding (it->f, it->char_to_display,
                                      it->face_id, &char2b,
***************
*** 2112,2118 ****
                it->phys_descent = FONT_DESCENT (font) - boff;
                it->pixel_width = FONT_WIDTH (font);
              }
!           
          /* If this is a space inside a region of text with
             `space-width' property, change its width.  */
          stretched_p = it->char_to_display == ' ' && !NILP (it->space_width);
--- 2111,2117 ----
                it->phys_descent = FONT_DESCENT (font) - boff;
                it->pixel_width = FONT_WIDTH (font);
              }
! 
          /* If this is a space inside a region of text with
             `space-width' property, change its width.  */
          stretched_p = it->char_to_display == ' ' && !NILP (it->space_width);
***************
*** 2125,2131 ****
          if (face->box != FACE_NO_BOX)
            {
              int thick = face->box_line_width;
!             
              if (thick > 0)
                {
                  it->ascent += thick;
--- 2124,2130 ----
          if (face->box != FACE_NO_BOX)
            {
              int thick = face->box_line_width;
! 
              if (thick > 0)
                {
                  it->ascent += thick;
***************
*** 2133,2139 ****
                }
              else
                thick = -thick;
!             
              if (it->start_of_box_run_p)
                it->pixel_width += thick;
              if (it->end_of_box_run_p)
--- 2132,2138 ----
                }
              else
                thick = -thick;
! 
              if (it->start_of_box_run_p)
                it->pixel_width += thick;
              if (it->end_of_box_run_p)
***************
*** 2146,2152 ****
            it->ascent += 2;
  
          take_vertical_position_into_account (it);
!   
          /* If we have to actually produce glyphs, do it.  */
          if (it->glyph_row)
            {
--- 2145,2151 ----
            it->ascent += 2;
  
          take_vertical_position_into_account (it);
! 
          /* If we have to actually produce glyphs, do it.  */
          if (it->glyph_row)
            {
***************
*** 2156,2162 ****
                     into a stretch glyph.  */
                  double ascent = (double) FONT_BASE (font)
                                  / FONT_HEIGHT (font);
!                 x_append_stretch_glyph (it, it->object, it->pixel_width, 
                                          it->ascent + it->descent, ascent);
                }
              else
--- 2155,2161 ----
                     into a stretch glyph.  */
                  double ascent = (double) FONT_BASE (font)
                                  / FONT_HEIGHT (font);
!                 x_append_stretch_glyph (it, it->object, it->pixel_width,
                                          it->ascent + it->descent, ascent);
                }
              else
***************
*** 2176,2182 ****
          it->nglyphs = 0;
          it->ascent = it->phys_ascent = FONT_BASE (font) + boff;
          it->descent = it->phys_descent = FONT_DESCENT (font) - boff;
!       
          if (face->box != FACE_NO_BOX
              && face->box_line_width > 0)
            {
--- 2175,2181 ----
          it->nglyphs = 0;
          it->ascent = it->phys_ascent = FONT_BASE (font) + boff;
          it->descent = it->phys_descent = FONT_DESCENT (font) - boff;
! 
          if (face->box != FACE_NO_BOX
              && face->box_line_width > 0)
            {
***************
*** 2189,2195 ****
          int tab_width = it->tab_width * CANON_X_UNIT (it->f);
          int x = it->current_x + it->continuation_lines_width;
          int next_tab_x = ((1 + x + tab_width - 1) / tab_width) * tab_width;
!       
          /* If the distance from the current position to the next tab
             stop is less than a canonical character width, use the
             tab stop after that.  */
--- 2188,2194 ----
          int tab_width = it->tab_width * CANON_X_UNIT (it->f);
          int x = it->current_x + it->continuation_lines_width;
          int next_tab_x = ((1 + x + tab_width - 1) / tab_width) * tab_width;
! 
          /* If the distance from the current position to the next tab
             stop is less than a canonical character width, use the
             tab stop after that.  */
***************
*** 2200,2214 ****
          it->nglyphs = 1;
          it->ascent = it->phys_ascent = FONT_BASE (font) + boff;
          it->descent = it->phys_descent = FONT_DESCENT (font) - boff;
!         
          if (it->glyph_row)
            {
              double ascent = (double) it->ascent / (it->ascent + it->descent);
!             x_append_stretch_glyph (it, it->object, it->pixel_width, 
                                      it->ascent + it->descent, ascent);
            }
        }
!       else 
        {
          /* A multi-byte character.
               If we found a font, this font should give us the right
--- 2199,2213 ----
          it->nglyphs = 1;
          it->ascent = it->phys_ascent = FONT_BASE (font) + boff;
          it->descent = it->phys_descent = FONT_DESCENT (font) - boff;
! 
          if (it->glyph_row)
            {
              double ascent = (double) it->ascent / (it->ascent + it->descent);
!             x_append_stretch_glyph (it, it->object, it->pixel_width,
                                      it->ascent + it->descent, ascent);
            }
        }
!       else
        {
          /* A multi-byte character.
               If we found a font, this font should give us the right
***************
*** 2261,2280 ****
                }
              else
                thick = - thick;
!         
              if (it->start_of_box_run_p)
                it->pixel_width += thick;
              if (it->end_of_box_run_p)
                it->pixel_width += thick;
            }
!   
          /* If face has an overline, add the height of the overline
             (1 pixel) and a 1 pixel margin to the character height.  */
          if (face->overline_p)
            it->ascent += 2;
  
          take_vertical_position_into_account (it);
!   
          if (it->glyph_row)
            x_append_glyph (it);
        }
--- 2260,2279 ----
                }
              else
                thick = - thick;
! 
              if (it->start_of_box_run_p)
                it->pixel_width += thick;
              if (it->end_of_box_run_p)
                it->pixel_width += thick;
            }
! 
          /* If face has an overline, add the height of the overline
             (1 pixel) and a 1 pixel margin to the character height.  */
          if (face->overline_p)
            it->ascent += 2;
  
          take_vertical_position_into_account (it);
! 
          if (it->glyph_row)
            x_append_glyph (it);
        }
***************
*** 2376,2387 ****
              ascent = FONT_BASE (font);
              descent = FONT_DESCENT (font);
            }
!         
          rightmost = width;
          lowest = - descent + boff;
          highest = ascent + boff;
          leftmost = 0;
!         
          if (font_info
              && font_info->default_ascent
              && CHAR_TABLE_P (Vuse_default_ascent)
--- 2375,2386 ----
              ascent = FONT_BASE (font);
              descent = FONT_DESCENT (font);
            }
! 
          rightmost = width;
          lowest = - descent + boff;
          highest = ascent + boff;
          leftmost = 0;
! 
          if (font_info
              && font_info->default_ascent
              && CHAR_TABLE_P (Vuse_default_ascent)
***************
*** 2549,2568 ****
            }
          else
            thick = - thick;
!         
          if (it->start_of_box_run_p)
            it->pixel_width += thick;
          if (it->end_of_box_run_p)
            it->pixel_width += thick;
        }
!   
        /* If face has an overline, add the height of the overline
         (1 pixel) and a 1 pixel margin to the character height.  */
        if (face->overline_p)
        it->ascent += 2;
  
        take_vertical_position_into_account (it);
!   
        if (it->glyph_row)
        x_append_composite_glyph (it);
      }
--- 2548,2567 ----
            }
          else
            thick = - thick;
! 
          if (it->start_of_box_run_p)
            it->pixel_width += thick;
          if (it->end_of_box_run_p)
            it->pixel_width += thick;
        }
! 
        /* If face has an overline, add the height of the overline
         (1 pixel) and a 1 pixel margin to the character height.  */
        if (face->overline_p)
        it->ascent += 2;
  
        take_vertical_position_into_account (it);
! 
        if (it->glyph_row)
        x_append_composite_glyph (it);
      }
***************
*** 2609,2615 ****
              height += 2 * face->box_line_width;
            }
        }
!   
    return height;
  }
  
--- 2608,2614 ----
              height += 2 * face->box_line_width;
            }
        }
! 
    return height;
  }
  
***************
*** 2801,2807 ****
  static void w32_init_glyph_string P_ ((struct glyph_string *, HDC hdc,
                                         wchar_t *, struct window *,
                                         struct glyph_row *,
!                                        enum glyph_row_area, int, 
                                         enum draw_glyphs_face));
  static int x_draw_glyphs P_ ((struct window *, int , struct glyph_row *,
                              enum glyph_row_area, int, int,
--- 2800,2806 ----
  static void w32_init_glyph_string P_ ((struct glyph_string *, HDC hdc,
                                         wchar_t *, struct window *,
                                         struct glyph_row *,
!                                        enum glyph_row_area, int,
                                         enum draw_glyphs_face));
  static int x_draw_glyphs P_ ((struct window *, int , struct glyph_row *,
                              enum glyph_row_area, int, int,
***************
*** 2847,2853 ****
  static void x_check_font P_ ((struct frame *, XFontStruct *));
  #endif
  
!      
  /* Append the list of glyph strings with head H and tail T to the list
     with head *HEAD and tail *TAIL.  Set *HEAD and *TAIL to the result.  */
  
--- 2846,2852 ----
  static void x_check_font P_ ((struct frame *, XFontStruct *));
  #endif
  
! 
  /* Append the list of glyph strings with head H and tail T to the list
     with head *HEAD and tail *TAIL.  Set *HEAD and *TAIL to the result.  */
  
***************
*** 2956,2966 ****
  
  
  /* Set up S->gc of glyph string S for drawing text in mouse face.  */
!    
  static void
  x_set_mouse_face_gc (s)
       struct glyph_string *s;
! {     
    int face_id;
    struct face *face;
  
--- 2955,2965 ----
  
  
  /* Set up S->gc of glyph string S for drawing text in mouse face.  */
! 
  static void
  x_set_mouse_face_gc (s)
       struct glyph_string *s;
! {
    int face_id;
    struct face *face;
  
***************
*** 2969,2975 ****
    face = FACE_FROM_ID (s->f, face_id);
    if (face == NULL)
      face = FACE_FROM_ID (s->f, MOUSE_FACE_ID);
!   
    if (s->first_glyph->type == CHAR_GLYPH)
      face_id = FACE_FOR_CHAR (s->f, face, s->first_glyph->u.ch);
    else
--- 2968,2974 ----
    face = FACE_FROM_ID (s->f, face_id);
    if (face == NULL)
      face = FACE_FROM_ID (s->f, MOUSE_FACE_ID);
! 
    if (s->first_glyph->type == CHAR_GLYPH)
      face_id = FACE_FOR_CHAR (s->f, face, s->first_glyph->u.ch);
    else
***************
*** 2986,3005 ****
         but font FONT.  */
        XGCValues xgcv;
        unsigned long mask;
!       
        xgcv.background = s->face->background;
        xgcv.foreground = s->face->foreground;
        IF_DEBUG (x_check_font (s->f, s->font));
        xgcv.font = s->font;
        mask = GCForeground | GCBackground | GCFont;
!       
        if (FRAME_W32_DISPLAY_INFO (s->f)->scratch_cursor_gc)
        XChangeGC (NULL, FRAME_W32_DISPLAY_INFO (s->f)->scratch_cursor_gc,
                   mask, &xgcv);
        else
        FRAME_W32_DISPLAY_INFO (s->f)->scratch_cursor_gc
          = XCreateGC (NULL, s->window, mask, &xgcv);
!       
        s->gc = FRAME_W32_DISPLAY_INFO (s->f)->scratch_cursor_gc;
      }
  
--- 2985,3004 ----
         but font FONT.  */
        XGCValues xgcv;
        unsigned long mask;
! 
        xgcv.background = s->face->background;
        xgcv.foreground = s->face->foreground;
        IF_DEBUG (x_check_font (s->f, s->font));
        xgcv.font = s->font;
        mask = GCForeground | GCBackground | GCFont;
! 
        if (FRAME_W32_DISPLAY_INFO (s->f)->scratch_cursor_gc)
        XChangeGC (NULL, FRAME_W32_DISPLAY_INFO (s->f)->scratch_cursor_gc,
                   mask, &xgcv);
        else
        FRAME_W32_DISPLAY_INFO (s->f)->scratch_cursor_gc
          = XCreateGC (NULL, s->window, mask, &xgcv);
! 
        s->gc = FRAME_W32_DISPLAY_INFO (s->f)->scratch_cursor_gc;
      }
  
***************
*** 3014,3020 ****
  static INLINE void
  x_set_mode_line_face_gc (s)
       struct glyph_string *s;
! {     
    s->gc = s->face->gc;
  }
  
--- 3013,3019 ----
  static INLINE void
  x_set_mode_line_face_gc (s)
       struct glyph_string *s;
! {
    s->gc = s->face->gc;
  }
  
***************
*** 3028,3034 ****
       struct glyph_string *s;
  {
    PREPARE_FACE_FOR_DISPLAY (s->f, s->face);
!   
    if (s->hl == DRAW_NORMAL_TEXT)
      {
        s->gc = s->face->gc;
--- 3027,3033 ----
       struct glyph_string *s;
  {
    PREPARE_FACE_FOR_DISPLAY (s->f, s->face);
! 
    if (s->hl == DRAW_NORMAL_TEXT)
      {
        s->gc = s->face->gc;
***************
*** 3079,3085 ****
      {
        /* Draw full-width.  X coordinates are relative to S->w->left.  */
        int canon_x = CANON_X_UNIT (s->f);
!       
        r->left = WINDOW_LEFT_MARGIN (s->w) * canon_x;
        r_width = XFASTINT (s->w->width) * canon_x;
  
--- 3078,3084 ----
      {
        /* Draw full-width.  X coordinates are relative to S->w->left.  */
        int canon_x = CANON_X_UNIT (s->f);
! 
        r->left = WINDOW_LEFT_MARGIN (s->w) * canon_x;
        r_width = XFASTINT (s->w->width) * canon_x;
  
***************
*** 3089,3095 ****
          if (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (s->f))
            r->left -= width;
        }
!       
        r->left += FRAME_INTERNAL_BORDER_WIDTH (s->f);
  
        /* Unless displaying a mode or menu bar line, which are always
--- 3088,3094 ----
          if (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (s->f))
            r->left -= width;
        }
! 
        r->left += FRAME_INTERNAL_BORDER_WIDTH (s->f);
  
        /* Unless displaying a mode or menu bar line, which are always
***************
*** 3168,3174 ****
  /* Compute overhangs and x-positions for glyph string S and its
     predecessors, or successors.  X is the starting x-position for S.
     BACKWARD_P non-zero means process predecessors.  */
!    
  static void
  x_compute_overhangs_and_x (s, x, backward_p)
       struct glyph_string *s;
--- 3167,3173 ----
  /* Compute overhangs and x-positions for glyph string S and its
     predecessors, or successors.  X is the starting x-position for S.
     BACKWARD_P non-zero means process predecessors.  */
! 
  static void
  x_compute_overhangs_and_x (s, x, backward_p)
       struct glyph_string *s;
***************
*** 3210,3216 ****
       int *left, *right;
  {
    *left = *right = 0;
!   
    if (glyph->type == CHAR_GLYPH)
      {
        XFontStruct *font;
--- 3209,3215 ----
       int *left, *right;
  {
    *left = *right = 0;
! 
    if (glyph->type == CHAR_GLYPH)
      {
        XFontStruct *font;
***************
*** 3256,3262 ****
       struct glyph_string *s;
  {
    int k;
!     
    if (s->left_overhang)
      {
        int x = 0, i;
--- 3255,3261 ----
       struct glyph_string *s;
  {
    int k;
! 
    if (s->left_overhang)
      {
        int x = 0, i;
***************
*** 3318,3324 ****
        struct glyph *glyphs = s->row->glyphs[s->area];
        int first = (s->first_glyph - glyphs) + (s->cmp ? 1 : s->nchars);
        int end = s->row->used[s->area];
!       
        for (i = first; i < end && s->right_overhang > x; ++i)
        x += glyphs[i].pixel_width;
  
--- 3317,3323 ----
        struct glyph *glyphs = s->row->glyphs[s->area];
        int first = (s->first_glyph - glyphs) + (s->cmp ? 1 : s->nchars);
        int end = s->row->used[s->area];
! 
        for (i = first; i < end && s->right_overhang > x; ++i)
        x += glyphs[i].pixel_width;
  
***************
*** 3597,3603 ****
        double dimness = 1 - (double)bright / HIGHLIGHT_COLOR_DARK_BOOST_LIMIT;
        /* The additive adjustment.  */
        int min_delta = delta * dimness * factor / 2;
!       
        if (factor < 1)
          new = PALETTERGB (max (0, min (0xff, min_delta - GetRValue (*color))),
                            max (0, min (0xff, min_delta - GetGValue (*color))),
--- 3596,3602 ----
        double dimness = 1 - (double)bright / HIGHLIGHT_COLOR_DARK_BOOST_LIMIT;
        /* The additive adjustment.  */
        int min_delta = delta * dimness * factor / 2;
! 
        if (factor < 1)
          new = PALETTERGB (max (0, min (0xff, min_delta - GetRValue (*color))),
                            max (0, min (0xff, min_delta - GetGValue (*color))),
***************
*** 3607,3613 ****
                            max (0, min (0xff, min_delta + GetGValue (*color))),
                            max (0, min (0xff, min_delta + GetBValue 
(*color))));
      }
!   
    if (new == *color)
      new = PALETTERGB (max (0, min (0xff, delta + GetRValue (*color))),
                        max (0, min (0xff, delta + GetGValue (*color))),
--- 3606,3612 ----
                            max (0, min (0xff, min_delta + GetGValue (*color))),
                            max (0, min (0xff, min_delta + GetBValue 
(*color))));
      }
! 
    if (new == *color)
      new = PALETTERGB (max (0, min (0xff, delta + GetRValue (*color))),
                        max (0, min (0xff, delta + GetGValue (*color))),
***************
*** 3631,3637 ****
     DELTA lighter or darker than the relief's background which is found
     in S->f->output_data.x->relief_background.  If such a color cannot
     be allocated, use DEFAULT_PIXEL, instead.  */
!    
  static void
  w32_setup_relief_color (f, relief, factor, delta, default_pixel)
       struct frame *f;
--- 3630,3636 ----
     DELTA lighter or darker than the relief's background which is found
     in S->f->output_data.x->relief_background.  If such a color cannot
     be allocated, use DEFAULT_PIXEL, instead.  */
! 
  static void
  w32_setup_relief_color (f, relief, factor, delta, default_pixel)
       struct frame *f;
***************
*** 3657,3663 ****
        relief->allocated_p = 1;
        xgcv.foreground = relief->pixel = pixel;
      }
!   
    if (relief->gc == 0)
      {
  #if 0 /* TODO: stipple */
--- 3656,3662 ----
        relief->allocated_p = 1;
        xgcv.foreground = relief->pixel = pixel;
      }
! 
    if (relief->gc == 0)
      {
  #if 0 /* TODO: stipple */
***************
*** 3744,3753 ****
      gc.foreground = f->output_data.w32->black_relief.gc->foreground;
    else
      gc.foreground = f->output_data.w32->white_relief.gc->foreground;
!   
    /* Bottom.  */
    for (i = 0; i < width; ++i)
!     w32_fill_area (f, hdc, gc.foreground, 
                   left_x + i * left_p, bottom_y - i,
                   right_x - left_x - i * (left_p + right_p) + 1, 1);
  
--- 3743,3752 ----
      gc.foreground = f->output_data.w32->black_relief.gc->foreground;
    else
      gc.foreground = f->output_data.w32->white_relief.gc->foreground;
! 
    /* Bottom.  */
    for (i = 0; i < width; ++i)
!     w32_fill_area (f, hdc, gc.foreground,
                   left_x + i * left_p, bottom_y - i,
                   right_x - left_x - i * (left_p + right_p) + 1, 1);
  
***************
*** 3759,3765 ****
                     bottom_y - top_y - 2 * i - 1);
  
    w32_set_clip_rectangle (hdc, NULL);
!   
    release_frame_dc (f, hdc);
  }
  
--- 3758,3764 ----
                     bottom_y - top_y - 2 * i - 1);
  
    w32_set_clip_rectangle (hdc, NULL);
! 
    release_frame_dc (f, hdc);
  }
  
***************
*** 3779,3785 ****
       RECT *clip_rect;
  {
    w32_set_clip_rectangle (s->hdc, clip_rect);
!   
    /* Top.  */
    w32_fill_area (s->f, s->hdc, s->face->box_color,
                  left_x, top_y, right_x - left_x + 1, width);
--- 3778,3784 ----
       RECT *clip_rect;
  {
    w32_set_clip_rectangle (s->hdc, clip_rect);
! 
    /* Top.  */
    w32_fill_area (s->f, s->hdc, s->face->box_color,
                  left_x, top_y, right_x - left_x + 1, width);
***************
*** 3790,3800 ****
        w32_fill_area (s->f, s->hdc, s->face->box_color,
                       left_x, top_y, width, bottom_y - top_y + 1);
      }
!   
    /* Bottom.  */
    w32_fill_area (s->f, s->hdc, s->face->box_color,
                   left_x, bottom_y - width + 1, right_x - left_x + 1, width);
!   
    /* Right.  */
    if (right_p)
      {
--- 3789,3799 ----
        w32_fill_area (s->f, s->hdc, s->face->box_color,
                       left_x, top_y, width, bottom_y - top_y + 1);
      }
! 
    /* Bottom.  */
    w32_fill_area (s->f, s->hdc, s->face->box_color,
                   left_x, bottom_y - width + 1, right_x - left_x + 1, width);
! 
    /* Right.  */
    if (right_p)
      {
***************
*** 3825,3831 ****
        if (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (s->f))
        last_x += FRAME_SCROLL_BAR_WIDTH (s->f) * CANON_X_UNIT (s->f);
      }
!   
    /* The glyph that may have a right box line.  */
    last_glyph = (s->cmp || s->img
                ? s->first_glyph
--- 3824,3830 ----
        if (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (s->f))
        last_x += FRAME_SCROLL_BAR_WIDTH (s->f) * CANON_X_UNIT (s->f);
      }
! 
    /* The glyph that may have a right box line.  */
    last_glyph = (s->cmp || s->img
                ? s->first_glyph
***************
*** 3848,3854 ****
             || (s->hl == DRAW_MOUSE_FACE
                 && (s->next == NULL
                     || s->next->hl != s->hl)));
!   
    w32_get_glyph_string_clip_rect (s, &clip_rect);
  
    if (s->face->box == FACE_SIMPLE_BOX)
--- 3847,3853 ----
             || (s->hl == DRAW_MOUSE_FACE
                 && (s->next == NULL
                     || s->next->hl != s->hl)));
! 
    w32_get_glyph_string_clip_rect (s, &clip_rect);
  
    if (s->face->box == FACE_SIMPLE_BOX)
***************
*** 3907,3913 ****
          xgcv.clip_y_origin = y;
          xgcv.function = GXcopy;
          XChangeGC (s->display, s->gc, mask, &xgcv);
!         
          w32_get_glyph_string_clip_rect (s, &clip_rect);
          image_rect.x = x;
          image_rect.y = y;
--- 3906,3912 ----
          xgcv.clip_y_origin = y;
          xgcv.function = GXcopy;
          XChangeGC (s->display, s->gc, mask, &xgcv);
! 
          w32_get_glyph_string_clip_rect (s, &clip_rect);
          image_rect.x = x;
          image_rect.y = y;
***************
*** 3977,3983 ****
    RECT r;
    int x;
    int y = s->ybase - image_ascent (s->img, s->face);
!  
    /* If first glyph of S has a left box line, start drawing it to the
       right of that line.  */
    if (s->face->box != FACE_NO_BOX
--- 3976,3982 ----
    RECT r;
    int x;
    int y = s->ybase - image_ascent (s->img, s->face);
! 
    /* If first glyph of S has a left box line, start drawing it to the
       right of that line.  */
    if (s->face->box != FACE_NO_BOX
***************
*** 3985,3996 ****
      x = s->x + abs (s->face->box_line_width);
    else
      x = s->x;
!   
    /* If there is a margin around the image, adjust x- and y-position
       by that margin.  */
    x += s->img->hmargin;
    y += s->img->vmargin;
!   
    if (s->hl == DRAW_IMAGE_SUNKEN
        || s->hl == DRAW_IMAGE_RAISED)
      {
--- 3984,3995 ----
      x = s->x + abs (s->face->box_line_width);
    else
      x = s->x;
! 
    /* If there is a margin around the image, adjust x- and y-position
       by that margin.  */
    x += s->img->hmargin;
    y += s->img->vmargin;
! 
    if (s->hl == DRAW_IMAGE_SUNKEN
        || s->hl == DRAW_IMAGE_RAISED)
      {
***************
*** 4002,4013 ****
        thick = abs (s->img->relief);
        raised_p = s->img->relief > 0;
      }
!   
    x0 = x - thick;
    y0 = y - thick;
    x1 = x + s->img->width + thick - 1;
    y1 = y + s->img->height + thick - 1;
!   
    x_setup_relief_colors (s);
    w32_get_glyph_string_clip_rect (s, &r);
    w32_draw_relief_rect (s->f, x0, y0, x1, y1, thick, raised_p, 1, 1, &r);
--- 4001,4012 ----
        thick = abs (s->img->relief);
        raised_p = s->img->relief > 0;
      }
! 
    x0 = x - thick;
    y0 = y - thick;
    x1 = x + s->img->width + thick - 1;
    y1 = y + s->img->height + thick - 1;
! 
    x_setup_relief_colors (s);
    w32_get_glyph_string_clip_rect (s, &r);
    w32_draw_relief_rect (s->f, x0, y0, x1, y1, thick, raised_p, 1, 1, &r);
***************
*** 4133,4139 ****
  }
  
  
! /* Draw image glyph string S.  
  
              s->y
     s->x      +-------------------------
--- 4132,4138 ----
  }
  
  
! /* Draw image glyph string S.
  
              s->y
     s->x      +-------------------------
***************
*** 4176,4182 ****
        x = s->x + box_line_hwidth;
        else
        x = s->x;
!       
        y = s->y + box_line_vwidth;
  #if 0 /* TODO: image mask */
        if (s->img->mask)
--- 4175,4181 ----
        x = s->x + box_line_hwidth;
        else
        x = s->x;
! 
        y = s->y + box_line_vwidth;
  #if 0 /* TODO: image mask */
        if (s->img->mask)
***************
*** 4191,4197 ****
          pixmap = XCreatePixmap (s->display, s->window,
                                  s->background_width,
                                  s->height, depth);
!         
          /* Don't clip in the following because we're working on the
             pixmap.  */
          XSetClipMask (s->display, s->gc, None);
--- 4190,4196 ----
          pixmap = XCreatePixmap (s->display, s->window,
                                  s->background_width,
                                  s->height, depth);
! 
          /* Don't clip in the following because we're working on the
             pixmap.  */
          XSetClipMask (s->display, s->gc, None);
***************
*** 4219,4225 ****
        else
  #endif
        x_draw_glyph_string_bg_rect (s, x, y, s->background_width, height);
!       
        s->background_filled_p = 1;
      }
  
--- 4218,4224 ----
        else
  #endif
        x_draw_glyph_string_bg_rect (s, x, y, s->background_width, height);
! 
        s->background_filled_p = 1;
      }
  
***************
*** 4300,4306 ****
            }
          else
            gc = s->face->gc;
!   
          w32_get_glyph_string_clip_rect (s, &r);
          w32_set_clip_rectangle (hdc, &r);
  
--- 4299,4305 ----
            }
          else
            gc = s->face->gc;
! 
          w32_get_glyph_string_clip_rect (s, &r);
          w32_set_clip_rectangle (hdc, &r);
  
***************
*** 4322,4328 ****
    else if (!s->background_filled_p)
      x_draw_glyph_string_bg_rect (s, s->x, s->y, s->background_width,
                                 s->height);
!   
    s->background_filled_p = 1;
  }
  
--- 4321,4327 ----
    else if (!s->background_filled_p)
      x_draw_glyph_string_bg_rect (s, s->x, s->y, s->background_width,
                                 s->height);
! 
    s->background_filled_p = 1;
  }
  
***************
*** 4470,4476 ****
  
  
  /* Fill glyph string S with composition components specified by S->cmp.
!    
     FACES is an array of faces for all components of this composition.
     S->gidx is the index of the first component for S.
     OVERLAPS_P non-zero means S should draw the foreground only, and
--- 4469,4475 ----
  
  
  /* Fill glyph string S with composition components specified by S->cmp.
! 
     FACES is an array of faces for all components of this composition.
     S->gidx is the index of the first component for S.
     OVERLAPS_P non-zero means S should draw the foreground only, and
***************
*** 4518,4524 ****
  
    /* Adjust base line for subscript/superscript text.  */
    s->ybase += s->first_glyph->voffset;
!   
    xassert (s->face && s->face->gc);
  
    /* This glyph string must always be drawn with 16-bit functions.  */
--- 4517,4523 ----
  
    /* Adjust base line for subscript/superscript text.  */
    s->ybase += s->first_glyph->voffset;
! 
    xassert (s->face && s->face->gc);
  
    /* This glyph string must always be drawn with 16-bit functions.  */
***************
*** 4529,4535 ****
  
  
  /* Fill glyph string S from a sequence of character glyphs.
!    
     FACE_ID is the face id of the string.  START is the index of the
     first glyph to consider, END is the index of the last + 1.
     OVERLAPS_P non-zero means S should draw the foreground only, and
--- 4528,4534 ----
  
  
  /* Fill glyph string S from a sequence of character glyphs.
! 
     FACE_ID is the face id of the string.  START is the index of the
     first glyph to consider, END is the index of the last + 1.
     OVERLAPS_P non-zero means S should draw the foreground only, and
***************
*** 4579,4585 ****
  
    s->font = s->face->font;
    s->font_info = FONT_INFO_FROM_ID (s->f, s->face->font_info_id);
!   
    /* If the specified font could not be loaded, use the frame's font,
       but record the fact that we couldn't load it in
       S->font_not_found_p so that we can draw rectangles for the
--- 4578,4584 ----
  
    s->font = s->face->font;
    s->font_info = FONT_INFO_FROM_ID (s->f, s->face->font_info_id);
! 
    /* If the specified font could not be loaded, use the frame's font,
       but record the fact that we couldn't load it in
       S->font_not_found_p so that we can draw rectangles for the
***************
*** 4592,4598 ****
  
    /* Adjust base line for subscript/superscript text.  */
    s->ybase += voffset;
!   
    xassert (s->face && s->face->gc);
    return glyph - s->row->glyphs[s->area];
  }
--- 4591,4597 ----
  
    /* Adjust base line for subscript/superscript text.  */
    s->ybase += voffset;
! 
    xassert (s->face && s->face->gc);
    return glyph - s->row->glyphs[s->area];
  }
***************
*** 4610,4616 ****
    s->face = FACE_FROM_ID (s->f, s->first_glyph->face_id);
    s->font = s->face->font;
    s->width = s->first_glyph->pixel_width;
!   
    /* Adjust base line for subscript/superscript text.  */
    s->ybase += s->first_glyph->voffset;
  }
--- 4609,4615 ----
    s->face = FACE_FROM_ID (s->f, s->first_glyph->face_id);
    s->font = s->face->font;
    s->width = s->first_glyph->pixel_width;
! 
    /* Adjust base line for subscript/superscript text.  */
    s->ybase += s->first_glyph->voffset;
  }
***************
*** 4633,4641 ****
  {
    struct glyph *glyph, *last;
    int voffset, face_id;
!   
    xassert (s->first_glyph->type == STRETCH_GLYPH);
!   
    glyph = s->row->glyphs[s->area] + start;
    last = s->row->glyphs[s->area] + end;
    face_id = glyph->face_id;
--- 4632,4640 ----
  {
    struct glyph *glyph, *last;
    int voffset, face_id;
! 
    xassert (s->first_glyph->type == STRETCH_GLYPH);
! 
    glyph = s->row->glyphs[s->area] + start;
    last = s->row->glyphs[s->area] + end;
    face_id = glyph->face_id;
***************
*** 4652,4658 ****
        && glyph->face_id == face_id);
         ++glyph)
      s->width += glyph->pixel_width;
!   
    /* Adjust base line for subscript/superscript text.  */
    s->ybase += voffset;
  
--- 4651,4657 ----
        && glyph->face_id == face_id);
         ++glyph)
      s->width += glyph->pixel_width;
! 
    /* Adjust base line for subscript/superscript text.  */
    s->ybase += voffset;
  
***************
*** 4668,4674 ****
     and area within the row from which S is constructed.  START is the
     index of the first glyph structure covered by S.  HL is a
     face-override for drawing S.  */
!    
  static void
  w32_init_glyph_string (s, hdc, char2b, w, row, area, start, hl)
       struct glyph_string *s;
--- 4667,4673 ----
     and area within the row from which S is constructed.  START is the
     index of the first glyph structure covered by S.  HL is a
     face-override for drawing S.  */
! 
  static void
  w32_init_glyph_string (s, hdc, char2b, w, row, area, start, hl)
       struct glyph_string *s;
***************
*** 4696,4702 ****
    /* Display the internal border below the tool-bar window.  */
    if (s->w == XWINDOW (s->f->tool_bar_window))
      s->y -= s->f->output_data.w32->internal_border_width;
!   
    s->ybase = s->y + row->ascent;
  }
  
--- 4695,4701 ----
    /* Display the internal border below the tool-bar window.  */
    if (s->w == XWINDOW (s->f->tool_bar_window))
      s->y -= s->f->output_data.w32->internal_border_width;
! 
    s->ybase = s->y + row->ascent;
  }
  
***************
*** 4714,4720 ****
    /* If the face of this glyph string has to be drawn to the end of
       the drawing area, set S->extends_to_end_of_line_p.  */
    struct face *default_face = FACE_FROM_ID (s->f, DEFAULT_FACE_ID);
!   
    if (start == s->row->used[s->area]
        && s->area == TEXT_AREA
        && ((s->hl == DRAW_NORMAL_TEXT
--- 4713,4719 ----
    /* If the face of this glyph string has to be drawn to the end of
       the drawing area, set S->extends_to_end_of_line_p.  */
    struct face *default_face = FACE_FROM_ID (s->f, DEFAULT_FACE_ID);
! 
    if (start == s->row->used[s->area]
        && s->area == TEXT_AREA
        && ((s->hl == DRAW_NORMAL_TEXT
***************
*** 4726,4732 ****
          || ((s->hl == DRAW_IMAGE_RAISED || s->hl == DRAW_IMAGE_SUNKEN)
              && s->row->fill_line_p)))
      s->extends_to_end_of_line_p = 1;
!   
    /* If S extends its face to the end of the line, set its
       background_width to the distance to the right edge of the drawing
       area.  */
--- 4725,4731 ----
          || ((s->hl == DRAW_IMAGE_RAISED || s->hl == DRAW_IMAGE_SUNKEN)
              && s->row->fill_line_p)))
      s->extends_to_end_of_line_p = 1;
! 
    /* If S extends its face to the end of the line, set its
       background_width to the distance to the right edge of the drawing
       area.  */
***************
*** 4805,4811 ****
                                            OVERLAPS_P);                        
   \
         }                                                                 \
       while (0)
!      
  
  /* Add a glyph string for a composite sequence to the list of strings
     between HEAD and TAIL.  START is the index of the first glyph in
--- 4804,4810 ----
                                            OVERLAPS_P);                        
   \
         }                                                                 \
       while (0)
! 
  
  /* Add a glyph string for a composite sequence to the list of strings
     between HEAD and TAIL.  START is the index of the first glyph in
***************
*** 4930,4936 ****
     and clip to the physical height of ROW.
  
     Value is the x-position reached, relative to AREA of W.  */
!      
  static int
  x_draw_glyphs (w, x, row, area, start, end, hl, overlaps_p)
       struct window *w;
--- 4929,4935 ----
     and clip to the physical height of ROW.
  
     Value is the x-position reached, relative to AREA of W.  */
! 
  static int
  x_draw_glyphs (w, x, row, area, start, end, hl, overlaps_p)
       struct window *w;
***************
*** 5012,5018 ****
        /* Prepend glyph strings for glyphs in front of the first glyph
         string that are overwritten because of the first glyph
         string's left overhang.  The background of all strings
!        prepended must be drawn because the first glyph string 
         draws over it.  */
        i = x_left_overwritten (head);
        if (i >= 0)
--- 5011,5017 ----
        /* Prepend glyph strings for glyphs in front of the first glyph
         string that are overwritten because of the first glyph
         string's left overhang.  The background of all strings
!        prepended must be drawn because the first glyph string
         draws over it.  */
        i = x_left_overwritten (head);
        if (i >= 0)
***************
*** 5090,5099 ****
      {
        int x0 = head ? head->x : x;
        int x1 = tail ? tail->x + tail->background_width : x;
!       
        x0 = FRAME_TO_WINDOW_PIXEL_X (w, x0);
        x1 = FRAME_TO_WINDOW_PIXEL_X (w, x1);
!       
        if (!row->full_width_p && XFASTINT (w->left_margin_width) != 0)
        {
          int left_area_width = window_box_width (w, LEFT_MARGIN_AREA);
--- 5089,5098 ----
      {
        int x0 = head ? head->x : x;
        int x1 = tail ? tail->x + tail->background_width : x;
! 
        x0 = FRAME_TO_WINDOW_PIXEL_X (w, x0);
        x1 = FRAME_TO_WINDOW_PIXEL_X (w, x1);
! 
        if (!row->full_width_p && XFASTINT (w->left_margin_width) != 0)
        {
          int left_area_width = window_box_width (w, LEFT_MARGIN_AREA);
***************
*** 5131,5139 ****
       enum glyph_row_area area;
  {
    int i, x;
!   
    BLOCK_INPUT;
!   
    if (area == LEFT_MARGIN_AREA)
      x = 0;
    else if (area == TEXT_AREA)
--- 5130,5138 ----
       enum glyph_row_area area;
  {
    int i, x;
! 
    BLOCK_INPUT;
! 
    if (area == LEFT_MARGIN_AREA)
      x = 0;
    else if (area == TEXT_AREA)
***************
*** 5165,5171 ****
          ++i;
        }
      }
!   
    UNBLOCK_INPUT;
  }
  
--- 5164,5170 ----
          ++i;
        }
      }
! 
    UNBLOCK_INPUT;
  }
  
***************
*** 5185,5191 ****
  
    xassert (updated_window && updated_row);
    BLOCK_INPUT;
!   
    /* Write glyphs.  */
  
    hpos = start - updated_row->glyphs[updated_area];
--- 5184,5190 ----
  
    xassert (updated_window && updated_row);
    BLOCK_INPUT;
! 
    /* Write glyphs.  */
  
    hpos = start - updated_row->glyphs[updated_area];
***************
*** 5195,5201 ****
                     DRAW_NORMAL_TEXT, 0);
  
    UNBLOCK_INPUT;
!   
    /* Advance the output cursor.  */
    output_cursor.hpos += len;
    output_cursor.x = x;
--- 5194,5200 ----
                     DRAW_NORMAL_TEXT, 0);
  
    UNBLOCK_INPUT;
! 
    /* Advance the output cursor.  */
    output_cursor.hpos += len;
    output_cursor.x = x;
***************
*** 5294,5303 ****
    struct window *w = updated_window;
    int max_x, min_y, max_y;
    int from_x, from_y, to_y;
!   
    xassert (updated_window && updated_row);
    f = XFRAME (w->frame);
!   
    if (updated_row->full_width_p)
      {
        max_x = XFASTINT (w->width) * CANON_X_UNIT (f);
--- 5293,5302 ----
    struct window *w = updated_window;
    int max_x, min_y, max_y;
    int from_x, from_y, to_y;
! 
    xassert (updated_window && updated_row);
    f = XFRAME (w->frame);
! 
    if (updated_row->full_width_p)
      {
        max_x = XFASTINT (w->width) * CANON_X_UNIT (f);
***************
*** 5319,5325 ****
      to_x = min (to_x, max_x);
  
    to_y = min (max_y, output_cursor.y + updated_row->height);
!   
    /* Notice if the cursor will be cleared by this operation.  */
    if (!updated_row->full_width_p)
      notice_overwritten_cursor (w, updated_area,
--- 5318,5324 ----
      to_x = min (to_x, max_x);
  
    to_y = min (max_y, output_cursor.y + updated_row->height);
! 
    /* Notice if the cursor will be cleared by this operation.  */
    if (!updated_row->full_width_p)
      notice_overwritten_cursor (w, updated_area,
***************
*** 5340,5350 ****
        from_x = WINDOW_AREA_TO_FRAME_PIXEL_X (w, updated_area, from_x);
        to_x = WINDOW_AREA_TO_FRAME_PIXEL_X (w, updated_area, to_x);
      }
!   
    min_y = WINDOW_DISPLAY_HEADER_LINE_HEIGHT (w);
    from_y = WINDOW_TO_FRAME_PIXEL_Y (w, max (min_y, output_cursor.y));
    to_y = WINDOW_TO_FRAME_PIXEL_Y (w, to_y);
!   
    /* Prevent inadvertently clearing to end of the X window.  */
    if (to_x > from_x && to_y > from_y)
      {
--- 5339,5349 ----
        from_x = WINDOW_AREA_TO_FRAME_PIXEL_X (w, updated_area, from_x);
        to_x = WINDOW_AREA_TO_FRAME_PIXEL_X (w, updated_area, to_x);
      }
! 
    min_y = WINDOW_DISPLAY_HEADER_LINE_HEIGHT (w);
    from_y = WINDOW_TO_FRAME_PIXEL_Y (w, max (min_y, output_cursor.y));
    to_y = WINDOW_TO_FRAME_PIXEL_Y (w, to_y);
! 
    /* Prevent inadvertently clearing to end of the X window.  */
    if (to_x > from_x && to_y > from_y)
      {
***************
*** 5411,5417 ****
        int i;
        HWND hwnd = FRAME_W32_WINDOW (SELECTED_FRAME ());
  
!       for (i = 0; i < 5; i++) 
        {
          FlashWindow (hwnd, TRUE);
          Sleep (10);
--- 5410,5416 ----
        int i;
        HWND hwnd = FRAME_W32_WINDOW (SELECTED_FRAME ());
  
!       for (i = 0; i < 5; i++)
        {
          FlashWindow (hwnd, TRUE);
          Sleep (10);
***************
*** 5509,5515 ****
      }
  
    BLOCK_INPUT;
!   
    /* Cursor off.  Will be switched on again in x_update_window_end.  */
    updated_window = w;
    x_clear_cursor (w);
--- 5508,5514 ----
      }
  
    BLOCK_INPUT;
! 
    /* Cursor off.  Will be switched on again in x_update_window_end.  */
    updated_window = w;
    x_clear_cursor (w);
***************
*** 5547,5553 ****
  /***********************************************************************
                           Exposure Events
   ***********************************************************************/
!                                                                       
  /* Redisplay an exposed area of frame F.  X and Y are the upper-left
     corner of the exposed rectangle.  W and H are width and height of
     the exposed area.  All are pixel values.  W or H zero means redraw
--- 5546,5552 ----
  /***********************************************************************
                           Exposure Events
   ***********************************************************************/
! 
  /* Redisplay an exposed area of frame F.  X and Y are the upper-left
     corner of the exposed rectangle.  W and H are width and height of
     the exposed area.  All are pixel values.  W or H zero means redraw
***************
*** 5698,5704 ****
            x += first->pixel_width;
            ++first;
          }
!   
        /* Find the last one.  */
        last = first;
        first_x = x;
--- 5697,5703 ----
            x += first->pixel_width;
            ++first;
          }
! 
        /* Find the last one.  */
        last = first;
        first_x = x;
***************
*** 5730,5736 ****
       RECT *r;
  {
    xassert (row->enabled_p);
!   
    if (row->mode_line_p || w->pseudo_window_p)
      x_draw_glyphs (w, 0, row, TEXT_AREA, 0, row->used[TEXT_AREA],
                   DRAW_NORMAL_TEXT, 0);
--- 5729,5735 ----
       RECT *r;
  {
    xassert (row->enabled_p);
! 
    if (row->mode_line_p || w->pseudo_window_p)
      x_draw_glyphs (w, 0, row, TEXT_AREA, 0, row->used[TEXT_AREA],
                   DRAW_NORMAL_TEXT, 0);
***************
*** 5788,5805 ****
       struct glyph_row *last_overlapping_row;
  {
    struct glyph_row *row;
!   
    for (row = first_overlapping_row; row <= last_overlapping_row; ++row)
      if (row->overlapping_p)
        {
        xassert (row->enabled_p && !row->mode_line_p);
!         
        if (row->used[LEFT_MARGIN_AREA])
          x_fix_overlapping_area (w, row, LEFT_MARGIN_AREA);
!   
        if (row->used[TEXT_AREA])
          x_fix_overlapping_area (w, row, TEXT_AREA);
!   
        if (row->used[RIGHT_MARGIN_AREA])
          x_fix_overlapping_area (w, row, RIGHT_MARGIN_AREA);
        }
--- 5787,5804 ----
       struct glyph_row *last_overlapping_row;
  {
    struct glyph_row *row;
! 
    for (row = first_overlapping_row; row <= last_overlapping_row; ++row)
      if (row->overlapping_p)
        {
        xassert (row->enabled_p && !row->mode_line_p);
! 
        if (row->used[LEFT_MARGIN_AREA])
          x_fix_overlapping_area (w, row, LEFT_MARGIN_AREA);
! 
        if (row->used[TEXT_AREA])
          x_fix_overlapping_area (w, row, TEXT_AREA);
! 
        if (row->used[RIGHT_MARGIN_AREA])
          x_fix_overlapping_area (w, row, RIGHT_MARGIN_AREA);
        }
***************
*** 5888,5894 ****
                    first_overlapping_row = row;
                  last_overlapping_row = row;
                }
!             
              if (expose_line (w, row, &r))
                mouse_face_overwritten_p = 1;
            }
--- 5887,5893 ----
                    first_overlapping_row = row;
                  last_overlapping_row = row;
                }
! 
              if (expose_line (w, row, &r))
                mouse_face_overwritten_p = 1;
            }
***************
*** 5912,5918 ****
          /* Fix the display of overlapping rows.  */
          if (first_overlapping_row)
            expose_overlaps (w, first_overlapping_row, last_overlapping_row);
!           
          /* Draw border between windows.  */
          x_draw_vertical_border (w);
  
--- 5911,5917 ----
          /* Fix the display of overlapping rows.  */
          if (first_overlapping_row)
            expose_overlaps (w, first_overlapping_row, last_overlapping_row);
! 
          /* Draw border between windows.  */
          x_draw_vertical_border (w);
  
***************
*** 6152,6158 ****
  /* Parse a button MESSAGE. The button index is returned in PBUTTON, and
     the state in PUP. XBUTTON provides extra information for extended mouse
     button messages. Returns FALSE if unable to parse the message.  */
! BOOL 
  parse_button (message, xbutton, pbutton, pup)
       int message;
       int xbutton;
--- 6151,6157 ----
  /* Parse a button MESSAGE. The button index is returned in PBUTTON, and
     the state in PUP. XBUTTON provides extra information for extended mouse
     button messages. Returns FALSE if unable to parse the message.  */
! BOOL
  parse_button (message, xbutton, pbutton, pup)
       int message;
       int xbutton;
***************
*** 6161,6167 ****
  {
    int button = 0;
    int up = 0;
!   
    switch (message)
      {
      case WM_LBUTTONDOWN:
--- 6160,6166 ----
  {
    int button = 0;
    int up = 0;
! 
    switch (message)
      {
      case WM_LBUTTONDOWN:
***************
*** 6211,6220 ****
      default:
        return (FALSE);
      }
!   
    if (pup) *pup = up;
    if (pbutton) *pbutton = button;
!   
    return (TRUE);
  }
  
--- 6210,6219 ----
      default:
        return (FALSE);
      }
! 
    if (pup) *pup = up;
    if (pbutton) *pbutton = button;
! 
    return (TRUE);
  }
  
***************
*** 6477,6483 ****
          else if (!buffer_only_p || BUFFERP (glyph->object))
            break;
        }
!       
        x0 += glyph->pixel_width;
        ++glyph;
      }
--- 6476,6482 ----
          else if (!buffer_only_p || BUFFERP (glyph->object))
            break;
        }
! 
        x0 += glyph->pixel_width;
        ++glyph;
      }
***************
*** 6540,6552 ****
        struct glyph *glyph, *end;
        Lisp_Object help, map;
        int x0;
!       
        /* Find the glyph under X.  */
        glyph = row->glyphs[TEXT_AREA];
        end = glyph + row->used[TEXT_AREA];
        x0 = - (FRAME_LEFT_SCROLL_BAR_WIDTH (f) * CANON_X_UNIT (f)
              + FRAME_X_LEFT_FRINGE_WIDTH (f));
!       
        while (glyph < end
             && x >= x0 + glyph->pixel_width)
        {
--- 6539,6551 ----
        struct glyph *glyph, *end;
        Lisp_Object help, map;
        int x0;
! 
        /* Find the glyph under X.  */
        glyph = row->glyphs[TEXT_AREA];
        end = glyph + row->used[TEXT_AREA];
        x0 = - (FRAME_LEFT_SCROLL_BAR_WIDTH (f) * CANON_X_UNIT (f)
              + FRAME_X_LEFT_FRINGE_WIDTH (f));
! 
        while (glyph < end
             && x >= x0 + glyph->pixel_width)
        {
***************
*** 6904,6910 ****
                 the text ``under'' it might have.  */
              struct glyph_row *r = MATRIX_ROW (w->current_matrix, vpos);
              int start = MATRIX_ROW_START_CHARPOS (r);
!             
              pos = string_buffer_position (w, object, start);
              if (pos > 0)
                mouse_face = get_char_property_and_overlay (make_number (pos),
--- 6903,6909 ----
                 the text ``under'' it might have.  */
              struct glyph_row *r = MATRIX_ROW (w->current_matrix, vpos);
              int start = MATRIX_ROW_START_CHARPOS (r);
! 
              pos = string_buffer_position (w, object, start);
              if (pos > 0)
                mouse_face = get_char_property_and_overlay (make_number (pos),
***************
*** 6928,6934 ****
                                      &dpyinfo->mouse_face_beg_x,
                                      &dpyinfo->mouse_face_beg_y,
                                      object);
!                      
                  dpyinfo->mouse_face_past_end
                    = !fast_find_position (w, XFASTINT (after),
                                           &dpyinfo->mouse_face_end_col,
--- 6927,6933 ----
                                      &dpyinfo->mouse_face_beg_x,
                                      &dpyinfo->mouse_face_beg_y,
                                      object);
! 
                  dpyinfo->mouse_face_past_end
                    = !fast_find_position (w, XFASTINT (after),
                                           &dpyinfo->mouse_face_end_col,
***************
*** 6960,6966 ****
        for (i = noverlays - 1; i >= 0 && NILP (help); --i)
          {
            overlay = overlay_vec[i];
!           help = Foverlay_get (overlay, Qhelp_echo); 
          }
  
        if (!NILP (help))
--- 6959,6965 ----
        for (i = noverlays - 1; i >= 0 && NILP (help); --i)
          {
            overlay = overlay_vec[i];
!           help = Foverlay_get (overlay, Qhelp_echo);
          }
  
        if (!NILP (help))
***************
*** 7007,7013 ****
                     && charpos < ZV)
              help = Fget_text_property (make_number (charpos), Qhelp_echo,
                                         object);
!           
            if (!NILP (help))
              {
                help_echo = help;
--- 7006,7012 ----
                     && charpos < ZV)
              help = Fget_text_property (make_number (charpos), Qhelp_echo,
                                         object);
! 
            if (!NILP (help))
              {
                help_echo = help;
***************
*** 7094,7100 ****
          || *hpos < dpyinfo->mouse_face_end_col
          || dpyinfo->mouse_face_past_end))
      return 0;
!   
    return 1;
  }
  
--- 7093,7099 ----
          || *hpos < dpyinfo->mouse_face_end_col
          || dpyinfo->mouse_face_past_end))
      return 0;
! 
    return 1;
  }
  
***************
*** 7115,7121 ****
    Lisp_Object enabled_p;
    int x = XFASTINT (button_event->x);
    int y = XFASTINT (button_event->y);
!   
    /* If not on the highlighted tool-bar item, return.  */
    frame_to_window_pixel_xy (w, &x, &y);
    if (x_tool_bar_item (f, x, y, &glyph, &hpos, &vpos, &prop_idx) != 0)
--- 7114,7120 ----
    Lisp_Object enabled_p;
    int x = XFASTINT (button_event->x);
    int y = XFASTINT (button_event->y);
! 
    /* If not on the highlighted tool-bar item, return.  */
    frame_to_window_pixel_xy (w, &x, &y);
    if (x_tool_bar_item (f, x, y, &glyph, &hpos, &vpos, &prop_idx) != 0)
***************
*** 7125,7131 ****
    enabled_p = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_ENABLED_P);
    if (NILP (enabled_p))
      return;
!   
    if (button_event->modifiers & down_modifier)
      {
        /* Show item in pressed state.  */
--- 7124,7130 ----
    enabled_p = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_ENABLED_P);
    if (NILP (enabled_p))
      return;
! 
    if (button_event->modifiers & down_modifier)
      {
        /* Show item in pressed state.  */
***************
*** 7202,7208 ****
      goto set_help_echo;
  
    clear_mouse_face (dpyinfo);
!   
    /* Mouse is down, but on different tool-bar item?  */
    mouse_down_p = (dpyinfo->grabbed
                  && f == last_mouse_frame
--- 7201,7207 ----
      goto set_help_echo;
  
    clear_mouse_face (dpyinfo);
! 
    /* Mouse is down, but on different tool-bar item?  */
    mouse_down_p = (dpyinfo->grabbed
                  && f == last_mouse_frame
***************
*** 7213,7219 ****
  
    dpyinfo->mouse_face_image_state = DRAW_NORMAL_TEXT;
    draw = mouse_down_p ? DRAW_IMAGE_SUNKEN : DRAW_IMAGE_RAISED;
!   
    /* If tool-bar item is not enabled, don't highlight it.  */
    enabled_p = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_ENABLED_P);
    if (!NILP (enabled_p))
--- 7212,7218 ----
  
    dpyinfo->mouse_face_image_state = DRAW_NORMAL_TEXT;
    draw = mouse_down_p ? DRAW_IMAGE_SUNKEN : DRAW_IMAGE_RAISED;
! 
    /* If tool-bar item is not enabled, don't highlight it.  */
    enabled_p = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_ENABLED_P);
    if (!NILP (enabled_p))
***************
*** 7223,7250 ****
        row = MATRIX_ROW (w->current_matrix, vpos);
        for (i = x = 0; i < hpos; ++i)
        x += row->glyphs[TEXT_AREA][i].pixel_width;
!       
        /* Record this as the current active region.  */
        dpyinfo->mouse_face_beg_col = hpos;
        dpyinfo->mouse_face_beg_row = vpos;
        dpyinfo->mouse_face_beg_x = x;
        dpyinfo->mouse_face_beg_y = row->y;
        dpyinfo->mouse_face_past_end = 0;
!       
        dpyinfo->mouse_face_end_col = hpos + 1;
        dpyinfo->mouse_face_end_row = vpos;
        dpyinfo->mouse_face_end_x = x + glyph->pixel_width;
        dpyinfo->mouse_face_end_y = row->y;
        dpyinfo->mouse_face_window = window;
        dpyinfo->mouse_face_face_id = TOOL_BAR_FACE_ID;
!       
        /* Display it as active.  */
        show_mouse_face (dpyinfo, draw);
        dpyinfo->mouse_face_image_state = draw;
      }
!       
   set_help_echo:
!   
    /* Set help_echo to a help string.to display for this tool-bar item.
       w32_read_socket does the rest.  */
    help_echo_object = help_echo_window = Qnil;
--- 7222,7249 ----
        row = MATRIX_ROW (w->current_matrix, vpos);
        for (i = x = 0; i < hpos; ++i)
        x += row->glyphs[TEXT_AREA][i].pixel_width;
! 
        /* Record this as the current active region.  */
        dpyinfo->mouse_face_beg_col = hpos;
        dpyinfo->mouse_face_beg_row = vpos;
        dpyinfo->mouse_face_beg_x = x;
        dpyinfo->mouse_face_beg_y = row->y;
        dpyinfo->mouse_face_past_end = 0;
! 
        dpyinfo->mouse_face_end_col = hpos + 1;
        dpyinfo->mouse_face_end_row = vpos;
        dpyinfo->mouse_face_end_x = x + glyph->pixel_width;
        dpyinfo->mouse_face_end_y = row->y;
        dpyinfo->mouse_face_window = window;
        dpyinfo->mouse_face_face_id = TOOL_BAR_FACE_ID;
! 
        /* Display it as active.  */
        show_mouse_face (dpyinfo, draw);
        dpyinfo->mouse_face_image_state = draw;
      }
! 
   set_help_echo:
! 
    /* Set help_echo to a help string.to display for this tool-bar item.
       w32_read_socket does the rest.  */
    help_echo_object = help_echo_window = Qnil;
***************
*** 7266,7272 ****
  #if 0 /* This is a version of fast_find_position that's more correct
         in the presence of hscrolling, for example.  I didn't install
         it right away because the problem fixed is minor, it failed
!        in 20.x as well, and I think it's too risky to install 
         so near the release of 21.1.  2001-09-25 gerd.  */
  
  static int
--- 7265,7271 ----
  #if 0 /* This is a version of fast_find_position that's more correct
         in the presence of hscrolling, for example.  I didn't install
         it right away because the problem fixed is minor, it failed
!        in 20.x as well, and I think it's too risky to install
         so near the release of 21.1.  2001-09-25 gerd.  */
  
  static int
***************
*** 7299,7308 ****
    *x = row->x;
    *y = row->y;
    *vpos = MATRIX_ROW_VPOS (row, w->current_matrix);
!   
    glyph = row->glyphs[TEXT_AREA];
    end = glyph + row->used[TEXT_AREA];
!   
    /* Skip over glyphs not having an object at the start of the row.
       These are special glyphs like truncation marks on terminal
       frames.  */
--- 7298,7307 ----
    *x = row->x;
    *y = row->y;
    *vpos = MATRIX_ROW_VPOS (row, w->current_matrix);
! 
    glyph = row->glyphs[TEXT_AREA];
    end = glyph + row->used[TEXT_AREA];
! 
    /* Skip over glyphs not having an object at the start of the row.
       These are special glyphs like truncation marks on terminal
       frames.  */
***************
*** 7504,7510 ****
          *x += best_glyph->pixel_width;
          ++*hpos;
        }
!       
        *y = best_row->y;
        *vpos = best_row - w->current_matrix->rows;
      }
--- 7503,7509 ----
          *x += best_glyph->pixel_width;
          ++*hpos;
        }
! 
        *y = best_row->y;
        *vpos = best_row - w->current_matrix->rows;
      }
***************
*** 7523,7529 ****
  {
    struct window *w = XWINDOW (dpyinfo->mouse_face_window);
    struct frame *f = XFRAME (WINDOW_FRAME (w));
!   
    if (/* If window is in the process of being destroyed, don't bother
         to do anything.  */
        w->current_matrix != NULL
--- 7522,7528 ----
  {
    struct window *w = XWINDOW (dpyinfo->mouse_face_window);
    struct frame *f = XFRAME (WINDOW_FRAME (w));
! 
    if (/* If window is in the process of being destroyed, don't bother
         to do anything.  */
        w->current_matrix != NULL
***************
*** 7538,7544 ****
  
        first = MATRIX_ROW (w->current_matrix, dpyinfo->mouse_face_beg_row);
        last = MATRIX_ROW (w->current_matrix, dpyinfo->mouse_face_end_row);
!       
        for (row = first; row <= last && row->enabled_p; ++row)
        {
          int start_hpos, end_hpos, start_x;
--- 7537,7543 ----
  
        first = MATRIX_ROW (w->current_matrix, dpyinfo->mouse_face_beg_row);
        last = MATRIX_ROW (w->current_matrix, dpyinfo->mouse_face_end_row);
! 
        for (row = first; row <= last && row->enabled_p; ++row)
        {
          int start_hpos, end_hpos, start_x;
***************
*** 7562,7568 ****
  
          if (end_hpos > start_hpos)
            {
!             x_draw_glyphs (w, start_x, row, TEXT_AREA, 
                             start_hpos, end_hpos, draw, 0);
  
              row->mouse_face_p
--- 7561,7567 ----
  
          if (end_hpos > start_hpos)
            {
!             x_draw_glyphs (w, start_x, row, TEXT_AREA,
                             start_hpos, end_hpos, draw, 0);
  
              row->mouse_face_p
***************
*** 7804,7810 ****
        XFRAME (frame)->mouse_moved = 0;
  
        last_mouse_scroll_bar = Qnil;
!       
        GetCursorPos (&pt);
  
        /* Now we have a position on the root; find the innermost window
--- 7803,7809 ----
        XFRAME (frame)->mouse_moved = 0;
  
        last_mouse_scroll_bar = Qnil;
! 
        GetCursorPos (&pt);
  
        /* Now we have a position on the root; find the innermost window
***************
*** 7981,7994 ****
  /************************************************************************
                         Scroll bars, general
   ************************************************************************/
!                                                                        
! HWND 
  my_create_scrollbar (f, bar)
       struct frame * f;
       struct scroll_bar * bar;
  {
    return (HWND) SendMessage (FRAME_W32_WINDOW (f),
!                            WM_EMACS_CREATESCROLLBAR, (WPARAM) f, 
                             (LPARAM) bar);
  }
  
--- 7980,7993 ----
  /************************************************************************
                         Scroll bars, general
   ************************************************************************/
! 
! HWND
  my_create_scrollbar (f, bar)
       struct frame * f;
       struct scroll_bar * bar;
  {
    return (HWND) SendMessage (FRAME_W32_WINDOW (f),
!                            WM_EMACS_CREATESCROLLBAR, (WPARAM) f,
                             (LPARAM) bar);
  }
  
***************
*** 8028,8034 ****
       struct frame * f;
       HWND hwnd;
  {
!   SendMessage (FRAME_W32_WINDOW (f), WM_EMACS_SETFOCUS, 
               (WPARAM) hwnd, 0);
  }
  
--- 8027,8033 ----
       struct frame * f;
       HWND hwnd;
  {
!   SendMessage (FRAME_W32_WINDOW (f), WM_EMACS_SETFOCUS,
               (WPARAM) hwnd, 0);
  }
  
***************
*** 8044,8050 ****
       struct frame * f;
       HWND hwnd;
  {
!   SendMessage (FRAME_W32_WINDOW (f), WM_EMACS_DESTROYWINDOW, 
               (WPARAM) hwnd, 0);
  }
  
--- 8043,8049 ----
       struct frame * f;
       HWND hwnd;
  {
!   SendMessage (FRAME_W32_WINDOW (f), WM_EMACS_DESTROYWINDOW,
               (WPARAM) hwnd, 0);
  }
  
***************
*** 8171,8177 ****
  
    /* Compute the left edge of the scroll bar.  */
    if (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f))
!     sb_left = left + width - sb_width - (width - sb_width) / 2; 
    else
      sb_left = left + (width - sb_width) / 2;
  
--- 8170,8176 ----
  
    /* Compute the left edge of the scroll bar.  */
    if (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f))
!     sb_left = left + width - sb_width - (width - sb_width) / 2;
    else
      sb_left = left + (width - sb_width) / 2;
  
***************
*** 8192,8198 ****
      }
    else
      {
!       /* It may just need to be moved and resized.  */      
        HWND hwnd;
  
        bar = XSCROLL_BAR (w->vertical_scroll_bar);
--- 8191,8197 ----
      }
    else
      {
!       /* It may just need to be moved and resized.  */
        HWND hwnd;
  
        bar = XSCROLL_BAR (w->vertical_scroll_bar);
***************
*** 8414,8420 ****
  
  
      last_mouse_scroll_bar_pos = msg->msg.wParam;
!  
      switch (LOWORD (msg->msg.wParam))
        {
        case SB_LINEDOWN:
--- 8413,8419 ----
  
  
      last_mouse_scroll_bar_pos = msg->msg.wParam;
! 
      switch (LOWORD (msg->msg.wParam))
        {
        case SB_LINEDOWN:
***************
*** 8614,8627 ****
     We return the number of characters stored into the buffer,
     thus pretending to be `read'.
  
!    EXPECTED is nonzero if the caller knows input is available.  
  
     Some of these messages are reposted back to the message queue since the
!    system calls the windows proc directly in a context where we cannot return 
     the data nor can we guarantee the state we are in.  So if we dispatch  them
     we will get into an infinite loop.  To prevent this from ever happening we
     will set a variable to indicate we are in the read_socket call and indicate
!    which message we are processing since the windows proc gets called 
     recursively with different messages by the system.
  */
  
--- 8613,8626 ----
     We return the number of characters stored into the buffer,
     thus pretending to be `read'.
  
!    EXPECTED is nonzero if the caller knows input is available.
  
     Some of these messages are reposted back to the message queue since the
!    system calls the windows proc directly in a context where we cannot return
     the data nor can we guarantee the state we are in.  So if we dispatch  them
     we will get into an infinite loop.  To prevent this from ever happening we
     will set a variable to indicate we are in the read_socket call and indicate
!    which message we are processing since the windows proc gets called
     recursively with different messages by the system.
  */
  
***************
*** 8662,8668 ****
        case WM_PAINT:
          f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
  
!         if (f) 
            {
              if (msg.rect.right == msg.rect.left ||
                  msg.rect.bottom == msg.rect.top)
--- 8661,8667 ----
        case WM_PAINT:
          f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
  
!         if (f)
            {
              if (msg.rect.right == msg.rect.left ||
                  msg.rect.bottom == msg.rect.top)
***************
*** 8722,8728 ****
            {
              if (numchars == 0)
                abort ();
!         
              bufp->kind = LANGUAGE_CHANGE_EVENT;
              XSETFRAME (bufp->frame_or_window, f);
              bufp->arg = Qnil;
--- 8721,8727 ----
            {
              if (numchars == 0)
                abort ();
! 
              bufp->kind = LANGUAGE_CHANGE_EVENT;
              XSETFRAME (bufp->frame_or_window, f);
              bufp->arg = Qnil;
***************
*** 8737,8743 ****
        case WM_KEYDOWN:
        case WM_SYSKEYDOWN:
          f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
!         
          if (f && !f->iconified)
            {
              if (!dpyinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight))
--- 8736,8742 ----
        case WM_KEYDOWN:
        case WM_SYSKEYDOWN:
          f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
! 
          if (f && !f->iconified)
            {
              if (!dpyinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight))
***************
*** 8764,8770 ****
        case WM_SYSCHAR:
        case WM_CHAR:
          f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
!         
          if (f && !f->iconified)
            {
              if (!dpyinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight))
--- 8763,8769 ----
        case WM_SYSCHAR:
        case WM_CHAR:
          f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
! 
          if (f && !f->iconified)
            {
              if (!dpyinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight))
***************
*** 8798,8804 ****
            f = last_mouse_frame;
          else
            f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
!         
          if (dpyinfo->mouse_face_hidden)
            {
              dpyinfo->mouse_face_hidden = 0;
--- 8797,8803 ----
            f = last_mouse_frame;
          else
            f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
! 
          if (dpyinfo->mouse_face_hidden)
            {
              dpyinfo->mouse_face_hidden = 0;
***************
*** 8851,8867 ****
            int up;
  
              emacs_event.kind = NO_EVENT;
!           
            if (dpyinfo->grabbed && last_mouse_frame
                && FRAME_LIVE_P (last_mouse_frame))
              f = last_mouse_frame;
            else
              f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
!           
            if (f)
              {
                  construct_mouse_click (&emacs_event, &msg, f);
!                 
                  /* Is this in the tool-bar?  */
                  if (WINDOWP (f->tool_bar_window)
                      && XFASTINT (XWINDOW (f->tool_bar_window)->height))
--- 8850,8866 ----
            int up;
  
              emacs_event.kind = NO_EVENT;
! 
            if (dpyinfo->grabbed && last_mouse_frame
                && FRAME_LIVE_P (last_mouse_frame))
              f = last_mouse_frame;
            else
              f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
! 
            if (f)
              {
                  construct_mouse_click (&emacs_event, &msg, f);
! 
                  /* Is this in the tool-bar?  */
                  if (WINDOWP (f->tool_bar_window)
                      && XFASTINT (XWINDOW (f->tool_bar_window)->height))
***************
*** 8893,8899 ****
                        numchars--;
                      }
              }
!           
            parse_button (msg.msg.message, HIWORD (msg.msg.wParam),
                          &button, &up);
  
--- 8892,8898 ----
                        numchars--;
                      }
              }
! 
            parse_button (msg.msg.message, HIWORD (msg.msg.wParam),
                          &button, &up);
  
***************
*** 8917,8923 ****
              }
            break;
          }
!         
        case WM_MOUSEWHEEL:
            if (dpyinfo->grabbed && last_mouse_frame
                && FRAME_LIVE_P (last_mouse_frame))
--- 8916,8922 ----
              }
            break;
          }
! 
        case WM_MOUSEWHEEL:
            if (dpyinfo->grabbed && last_mouse_frame
                && FRAME_LIVE_P (last_mouse_frame))
***************
*** 8927,8933 ****
  
            if (f)
              {
!               if ((!dpyinfo->w32_focus_frame 
                     || f == dpyinfo->w32_focus_frame)
                    && (numchars >= 1))
                  {
--- 8926,8932 ----
  
            if (f)
              {
!               if ((!dpyinfo->w32_focus_frame
                     || f == dpyinfo->w32_focus_frame)
                    && (numchars >= 1))
                  {
***************
*** 8955,8961 ****
          {
            struct scroll_bar *bar =
              x_window_to_scroll_bar ((HWND)msg.msg.lParam);
!             
            if (bar && numchars >= 1)
              {
                if (w32_scroll_bar_handle_click (bar, &msg, bufp))
--- 8954,8960 ----
          {
            struct scroll_bar *bar =
              x_window_to_scroll_bar ((HWND)msg.msg.lParam);
! 
            if (bar && numchars >= 1)
              {
                if (w32_scroll_bar_handle_click (bar, &msg, bufp))
***************
*** 8967,8973 ****
              }
            break;
          }
!         
        case WM_WINDOWPOSCHANGED:
          f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
          if (f)
--- 8966,8972 ----
              }
            break;
          }
! 
        case WM_WINDOWPOSCHANGED:
          f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
          if (f)
***************
*** 8990,8996 ****
  
        case WM_MOVE:
          f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
!         
          if (f && !f->async_iconified)
            {
              int x, y;
--- 8989,8995 ----
  
        case WM_MOVE:
          f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
! 
          if (f && !f->async_iconified)
            {
              int x, y;
***************
*** 9032,9038 ****
  
        case WM_SIZE:
          f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
!         
          /* Inform lisp of whether frame has been iconified etc. */
          if (f)
            {
--- 9031,9037 ----
  
        case WM_SIZE:
          f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
! 
          /* Inform lisp of whether frame has been iconified etc. */
          if (f)
            {
***************
*** 9041,9047 ****
                case SIZE_MINIMIZED:
                  f->async_visible = 0;
                  f->async_iconified = 1;
!                 
                  bufp->kind = ICONIFY_EVENT;
                  XSETFRAME (bufp->frame_or_window, f);
                  bufp->arg = Qnil;
--- 9040,9046 ----
                case SIZE_MINIMIZED:
                  f->async_visible = 0;
                  f->async_iconified = 1;
! 
                  bufp->kind = ICONIFY_EVENT;
                  XSETFRAME (bufp->frame_or_window, f);
                  bufp->arg = Qnil;
***************
*** 9054,9064 ****
                case SIZE_RESTORED:
                  f->async_visible = 1;
                  f->async_iconified = 0;
!                 
                  /* wait_reading_process_input will notice this and update
                     the frame's display structures.  */
                  SET_FRAME_GARBAGED (f);
!                 
                  if (f->iconified)
                    {
                        int x, y;
--- 9053,9063 ----
                case SIZE_RESTORED:
                  f->async_visible = 1;
                  f->async_iconified = 0;
! 
                  /* wait_reading_process_input will notice this and update
                     the frame's display structures.  */
                  SET_FRAME_GARBAGED (f);
! 
                  if (f->iconified)
                    {
                        int x, y;
***************
*** 9096,9116 ****
              int columns;
              int width;
              int height;
!             
              GetClientRect (msg.msg.hwnd, &rect);
!             
              height = rect.bottom - rect.top;
              width = rect.right - rect.left;
!             
              rows = PIXEL_TO_CHAR_HEIGHT (f, height);
              columns = PIXEL_TO_CHAR_WIDTH (f, width);
!             
              /* TODO: Clip size to the screen dimensions.  */
!             
              /* Even if the number of character rows and columns has
                 not changed, the font size may have changed, so we need
                 to check the pixel dimensions as well.  */
!             
              if (columns != f->width
                  || rows != f->height
                  || width != f->output_data.w32->pixel_width
--- 9095,9115 ----
              int columns;
              int width;
              int height;
! 
              GetClientRect (msg.msg.hwnd, &rect);
! 
              height = rect.bottom - rect.top;
              width = rect.right - rect.left;
! 
              rows = PIXEL_TO_CHAR_HEIGHT (f, height);
              columns = PIXEL_TO_CHAR_WIDTH (f, width);
! 
              /* TODO: Clip size to the screen dimensions.  */
! 
              /* Even if the number of character rows and columns has
                 not changed, the font size may have changed, so we need
                 to check the pixel dimensions as well.  */
! 
              if (columns != f->width
                  || rows != f->height
                  || width != f->output_data.w32->pixel_width
***************
*** 9157,9168 ****
                }
            }
          break;
!             
        case WM_SETFOCUS:
          f = x_any_window_to_frame (dpyinfo, msg.msg.hwnd);
  
            dpyinfo->w32_focus_event_frame = f;
!           
            if (f)
              x_new_focus_frame (dpyinfo, f);
  
--- 9156,9167 ----
                }
            }
          break;
! 
        case WM_SETFOCUS:
          f = x_any_window_to_frame (dpyinfo, msg.msg.hwnd);
  
            dpyinfo->w32_focus_event_frame = f;
! 
            if (f)
              x_new_focus_frame (dpyinfo, f);
  
***************
*** 9214,9225 ****
  
        case WM_CLOSE:
          f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
!         
          if (f)
            {
              if (numchars == 0)
                abort ();
!             
              bufp->kind = DELETE_WINDOW_EVENT;
              XSETFRAME (bufp->frame_or_window, f);
              bufp->arg = Qnil;
--- 9213,9224 ----
  
        case WM_CLOSE:
          f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
! 
          if (f)
            {
              if (numchars == 0)
                abort ();
! 
              bufp->kind = DELETE_WINDOW_EVENT;
              XSETFRAME (bufp->frame_or_window, f);
              bufp->arg = Qnil;
***************
*** 9231,9242 ****
  
        case WM_INITMENU:
          f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
!         
          if (f)
            {
              if (numchars == 0)
                abort ();
!         
              bufp->kind = MENU_BAR_ACTIVATE_EVENT;
              XSETFRAME (bufp->frame_or_window, f);
              bufp->arg = Qnil;
--- 9230,9241 ----
  
        case WM_INITMENU:
          f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
! 
          if (f)
            {
              if (numchars == 0)
                abort ();
! 
              bufp->kind = MENU_BAR_ACTIVATE_EVENT;
              XSETFRAME (bufp->frame_or_window, f);
              bufp->arg = Qnil;
***************
*** 9262,9268 ****
        case WM_DISPLAYCHANGE:
          f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
  
!         if (f) 
            {
              dpyinfo->width = (short) LOWORD (msg.msg.lParam);
              dpyinfo->height = (short) HIWORD (msg.msg.lParam);
--- 9261,9267 ----
        case WM_DISPLAYCHANGE:
          f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
  
!         if (f)
            {
              dpyinfo->width = (short) LOWORD (msg.msg.lParam);
              dpyinfo->height = (short) HIWORD (msg.msg.lParam);
***************
*** 9270,9276 ****
              DebPrint (("display change: %d %d\n", dpyinfo->width,
                         dpyinfo->height));
            }
!         
          check_visibility = 1;
          break;
  
--- 9269,9275 ----
              DebPrint (("display change: %d %d\n", dpyinfo->width,
                         dpyinfo->height));
            }
! 
          check_visibility = 1;
          break;
  
***************
*** 9278,9292 ****
          /* Check for messages registered at runtime. */
          if (msg.msg.message == msh_mousewheel)
            {
!             if (dpyinfo->grabbed && last_mouse_frame 
                  && FRAME_LIVE_P (last_mouse_frame))
                f = last_mouse_frame;
              else
                f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
!           
              if (f)
                {
!                 if ((!dpyinfo->w32_focus_frame 
                       || f == dpyinfo->w32_focus_frame)
                      && (numchars >= 1))
                    {
--- 9277,9291 ----
          /* Check for messages registered at runtime. */
          if (msg.msg.message == msh_mousewheel)
            {
!             if (dpyinfo->grabbed && last_mouse_frame
                  && FRAME_LIVE_P (last_mouse_frame))
                f = last_mouse_frame;
              else
                f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
! 
              if (f)
                {
!                 if ((!dpyinfo->w32_focus_frame
                       || f == dpyinfo->w32_focus_frame)
                      && (numchars >= 1))
                    {
***************
*** 9643,9649 ****
       screen.  */
    if (w->phys_cursor_type == NO_CURSOR)
      goto mark_cursor_off;
!          
    /* VPOS >= active_glyphs->nrows means that window has been resized.
       Don't bother to erase the cursor.  */
    if (vpos >= active_glyphs->nrows)
--- 9642,9648 ----
       screen.  */
    if (w->phys_cursor_type == NO_CURSOR)
      goto mark_cursor_off;
! 
    /* VPOS >= active_glyphs->nrows means that window has been resized.
       Don't bother to erase the cursor.  */
    if (vpos >= active_glyphs->nrows)
***************
*** 9654,9666 ****
    cursor_row = MATRIX_ROW (active_glyphs, vpos);
    if (!cursor_row->enabled_p)
      goto mark_cursor_off;
!   
    /* If row is completely invisible, don't attempt to delete a cursor which
       isn't there.  This may happen if cursor is at top of window, and
       we switch to a buffer with a header line in that window.  */
    if (cursor_row->visible_height <= 0)
      goto mark_cursor_off;
!   
    /* This can happen when the new row is shorter than the old one.
       In this case, either x_draw_glyphs or clear_end_of_line
       should have cleared the cursor.  Note that we wouldn't be
--- 9653,9665 ----
    cursor_row = MATRIX_ROW (active_glyphs, vpos);
    if (!cursor_row->enabled_p)
      goto mark_cursor_off;
! 
    /* If row is completely invisible, don't attempt to delete a cursor which
       isn't there.  This may happen if cursor is at top of window, and
       we switch to a buffer with a header line in that window.  */
    if (cursor_row->visible_height <= 0)
      goto mark_cursor_off;
! 
    /* This can happen when the new row is shorter than the old one.
       In this case, either x_draw_glyphs or clear_end_of_line
       should have cleared the cursor.  Note that we wouldn't be
***************
*** 9706,9712 ****
                        cursor_row->visible_height);
        release_frame_dc (f, hdc);
      }
!   
    /* Erase the cursor by redrawing the character underneath it.  */
    if (mouse_face_here_p)
      hl = DRAW_MOUSE_FACE;
--- 9705,9711 ----
                        cursor_row->visible_height);
        release_frame_dc (f, hdc);
      }
! 
    /* Erase the cursor by redrawing the character underneath it.  */
    if (mouse_face_here_p)
      hl = DRAW_MOUSE_FACE;
***************
*** 9729,9735 ****
    struct w32_display_info *dpyinfo
      = FRAME_W32_DISPLAY_INFO (XFRAME (w->frame));
    int in_mouse_face = 0;
!   
    if (WINDOWP (dpyinfo->mouse_face_window)
        && XWINDOW (dpyinfo->mouse_face_window) == w)
      {
--- 9728,9734 ----
    struct w32_display_info *dpyinfo
      = FRAME_W32_DISPLAY_INFO (XFRAME (w->frame));
    int in_mouse_face = 0;
! 
    if (WINDOWP (dpyinfo->mouse_face_window)
        && XWINDOW (dpyinfo->mouse_face_window) == w)
      {
***************
*** 9784,9791 ****
    current_glyphs = w->current_matrix;
    glyph_row = MATRIX_ROW (current_glyphs, vpos);
    glyph = glyph_row->glyphs[TEXT_AREA] + hpos;
!   
!   /* If cursor row is not enabled, we don't really know where to 
       display the cursor.  */
    if (!glyph_row->enabled_p)
      {
--- 9783,9790 ----
    current_glyphs = w->current_matrix;
    glyph_row = MATRIX_ROW (current_glyphs, vpos);
    glyph = glyph_row->glyphs[TEXT_AREA] + hpos;
! 
!   /* If cursor row is not enabled, we don't really know where to
       display the cursor.  */
    if (!glyph_row->enabled_p)
      {
***************
*** 9819,9825 ****
      {
        w->phys_cursor_ascent = glyph_row->ascent;
        w->phys_cursor_height = glyph_row->height;
!       
        /* Set phys_cursor_.* before x_draw_.* is called because some
         of them may need the information.  */
        w->phys_cursor.x = x;
--- 9818,9824 ----
      {
        w->phys_cursor_ascent = glyph_row->ascent;
        w->phys_cursor_height = glyph_row->height;
! 
        /* Set phys_cursor_.* before x_draw_.* is called because some
         of them may need the information.  */
        w->phys_cursor.x = x;
***************
*** 10256,10262 ****
    {
        RECT rt;
        rt.left = rt.right = rt.top = rt.bottom = 0;
!       
        BLOCK_INPUT;
        AdjustWindowRect(&rt, f->output_data.w32->dwStyle,
                       FRAME_EXTERNAL_MENU_BAR (f));
--- 10255,10261 ----
    {
        RECT rt;
        rt.left = rt.right = rt.top = rt.bottom = 0;
! 
        BLOCK_INPUT;
        AdjustWindowRect(&rt, f->output_data.w32->dwStyle,
                       FRAME_EXTERNAL_MENU_BAR (f));
***************
*** 10336,10347 ****
    if (f->output_data.w32->want_fullscreen & FULLSCREEN_BOTH)
      {
        int width, height, ign;
!                       
        x_real_positions (f, &f->output_data.w32->left_pos,
                          &f->output_data.w32->top_pos);
  
        x_fullscreen_adjust (f, &width, &height, &ign, &ign);
!                   
        /* We do not need to move the window, it shall be taken care of
           when setting WM manager hints.
           If the frame is visible already, the position is checked by
--- 10335,10346 ----
    if (f->output_data.w32->want_fullscreen & FULLSCREEN_BOTH)
      {
        int width, height, ign;
! 
        x_real_positions (f, &f->output_data.w32->left_pos,
                          &f->output_data.w32->top_pos);
  
        x_fullscreen_adjust (f, &width, &height, &ign, &ign);
! 
        /* We do not need to move the window, it shall be taken care of
           when setting WM manager hints.
           If the frame is visible already, the position is checked by
***************
*** 10377,10383 ****
        expect_top = 0;
      if (f->output_data.w32->want_fullscreen & FULLSCREEN_WIDTH)
        expect_left = 0;
!     
      if (expect_top != f->output_data.w32->top_pos
          || expect_left != f->output_data.w32->left_pos)
        x_set_offset (f, expect_left, expect_top, 1);
--- 10376,10382 ----
        expect_top = 0;
      if (f->output_data.w32->want_fullscreen & FULLSCREEN_WIDTH)
        expect_left = 0;
! 
      if (expect_top != f->output_data.w32->top_pos
          || expect_left != f->output_data.w32->left_pos)
        x_set_offset (f, expect_left, expect_top, 1);
***************
*** 10405,10415 ****
  
    *top_pos = f->output_data.w32->top_pos;
    *left_pos = f->output_data.w32->left_pos;
!   
    if (f->output_data.w32->want_fullscreen & FULLSCREEN_HEIGHT)
      {
        int ph;
!       
        ph = FRAME_X_DISPLAY_INFO (f)->height;
        newheight = PIXEL_TO_CHAR_HEIGHT (f, ph);
        ph = CHAR_TO_PIXEL_HEIGHT (f, newheight)
--- 10404,10414 ----
  
    *top_pos = f->output_data.w32->top_pos;
    *left_pos = f->output_data.w32->left_pos;
! 
    if (f->output_data.w32->want_fullscreen & FULLSCREEN_HEIGHT)
      {
        int ph;
! 
        ph = FRAME_X_DISPLAY_INFO (f)->height;
        newheight = PIXEL_TO_CHAR_HEIGHT (f, ph);
        ph = CHAR_TO_PIXEL_HEIGHT (f, newheight)
***************
*** 10421,10427 ****
    if (f->output_data.w32->want_fullscreen & FULLSCREEN_WIDTH)
      {
        int pw;
!       
        pw = FRAME_X_DISPLAY_INFO (f)->width;
        newwidth = PIXEL_TO_CHAR_WIDTH (f, pw);
        pw = CHAR_TO_PIXEL_WIDTH (f, newwidth)
--- 10420,10426 ----
    if (f->output_data.w32->want_fullscreen & FULLSCREEN_WIDTH)
      {
        int pw;
! 
        pw = FRAME_X_DISPLAY_INFO (f)->width;
        newwidth = PIXEL_TO_CHAR_WIDTH (f, pw);
        pw = CHAR_TO_PIXEL_WIDTH (f, newwidth)
***************
*** 10447,10455 ****
       int cols, rows;
  {
    int pixelwidth, pixelheight;
!   
    BLOCK_INPUT;
!   
    check_frame_size (f, &rows, &cols);
    f->output_data.w32->vertical_scroll_bar_extra
      = (!FRAME_HAS_VERTICAL_SCROLL_BARS (f)
--- 10446,10454 ----
       int cols, rows;
  {
    int pixelwidth, pixelheight;
! 
    BLOCK_INPUT;
! 
    check_frame_size (f, &rows, &cols);
    f->output_data.w32->vertical_scroll_bar_extra
      = (!FRAME_HAS_VERTICAL_SCROLL_BARS (f)
***************
*** 10460,10492 ****
  
    pixelwidth = CHAR_TO_PIXEL_WIDTH (f, cols);
    pixelheight = CHAR_TO_PIXEL_HEIGHT (f, rows);
!   
    f->output_data.w32->win_gravity = NorthWestGravity;
    x_wm_set_size_hint (f, (long) 0, 0);
!   
    {
      RECT rect;
  
      rect.left = rect.top = 0;
      rect.right = pixelwidth;
      rect.bottom = pixelheight;
!       
      AdjustWindowRect(&rect, f->output_data.w32->dwStyle,
                     FRAME_EXTERNAL_MENU_BAR (f));
!       
      my_set_window_pos (FRAME_W32_WINDOW (f),
!                      NULL, 
                       0, 0,
                       rect.right - rect.left,
                       rect.bottom - rect.top,
                       SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE);
    }
!   
    /* Now, strictly speaking, we can't be sure that this is accurate,
       but the window manager will get around to dealing with the size
       change request eventually, and we'll hear how it went when the
       ConfigureNotify event gets here.
!      
       We could just not bother storing any of this information here,
       and let the ConfigureNotify event set everything up, but that
       might be kind of confusing to the Lisp code, since size changes
--- 10459,10491 ----
  
    pixelwidth = CHAR_TO_PIXEL_WIDTH (f, cols);
    pixelheight = CHAR_TO_PIXEL_HEIGHT (f, rows);
! 
    f->output_data.w32->win_gravity = NorthWestGravity;
    x_wm_set_size_hint (f, (long) 0, 0);
! 
    {
      RECT rect;
  
      rect.left = rect.top = 0;
      rect.right = pixelwidth;
      rect.bottom = pixelheight;
! 
      AdjustWindowRect(&rect, f->output_data.w32->dwStyle,
                     FRAME_EXTERNAL_MENU_BAR (f));
! 
      my_set_window_pos (FRAME_W32_WINDOW (f),
!                      NULL,
                       0, 0,
                       rect.right - rect.left,
                       rect.bottom - rect.top,
                       SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE);
    }
! 
    /* Now, strictly speaking, we can't be sure that this is accurate,
       but the window manager will get around to dealing with the size
       change request eventually, and we'll hear how it went when the
       ConfigureNotify event gets here.
! 
       We could just not bother storing any of this information here,
       and let the ConfigureNotify event set everything up, but that
       might be kind of confusing to the Lisp code, since size changes
***************
*** 10509,10515 ****
    mark_window_cursors_off (XWINDOW (f->root_window));
  
    /* Clear out any recollection of where the mouse highlighting was,
!      since it might be in a place that's outside the new frame size. 
       Actually checking whether it is outside is a pain in the neck,
       so don't try--just let the highlighting be done afresh with new size.  */
    cancel_mouse_face (f);
--- 10508,10514 ----
    mark_window_cursors_off (XWINDOW (f->root_window));
  
    /* Clear out any recollection of where the mouse highlighting was,
!      since it might be in a place that's outside the new frame size.
       Actually checking whether it is outside is a pain in the neck,
       so don't try--just let the highlighting be done afresh with new size.  */
    cancel_mouse_face (f);
***************
*** 10761,10771 ****
    /* Don't keep the highlight on an invisible frame.  */
    if (FRAME_W32_DISPLAY_INFO (f)->x_highlight_frame == f)
      FRAME_W32_DISPLAY_INFO (f)->x_highlight_frame = 0;
!   
    BLOCK_INPUT;
!   
    my_show_window (f, FRAME_W32_WINDOW (f), SW_HIDE);
!   
    /* We can't distinguish this from iconification
       just by the event that we get from the server.
       So we can't win using the usual strategy of letting
--- 10760,10770 ----
    /* Don't keep the highlight on an invisible frame.  */
    if (FRAME_W32_DISPLAY_INFO (f)->x_highlight_frame == f)
      FRAME_W32_DISPLAY_INFO (f)->x_highlight_frame = 0;
! 
    BLOCK_INPUT;
! 
    my_show_window (f, FRAME_W32_WINDOW (f), SW_HIDE);
! 
    /* We can't distinguish this from iconification
       just by the event that we get from the server.
       So we can't win using the usual strategy of letting
***************
*** 10775,10781 ****
    FRAME_ICONIFIED_P (f) = 0;
    f->async_visible = 0;
    f->async_iconified = 0;
!   
    UNBLOCK_INPUT;
  }
  
--- 10774,10780 ----
    FRAME_ICONIFIED_P (f) = 0;
    f->async_visible = 0;
    f->async_iconified = 0;
! 
    UNBLOCK_INPUT;
  }
  
***************
*** 10819,10825 ****
  
    if (FRAME_W32_WINDOW (f))
      my_destroy_window (f, FRAME_W32_WINDOW (f));
!       
    free_frame_menubar (f);
  
    unload_color (f, f->output_data.x->foreground_pixel);
--- 10818,10824 ----
  
    if (FRAME_W32_WINDOW (f))
      my_destroy_window (f, FRAME_W32_WINDOW (f));
! 
    free_frame_menubar (f);
  
    unload_color (f, f->output_data.x->foreground_pixel);
***************
*** 10835,10844 ****
  
    if (FRAME_FACE_CACHE (f))
      free_frame_faces (f);
!       
    xfree (f->output_data.w32);
    f->output_data.w32 = NULL;
!   
    if (f == dpyinfo->w32_focus_frame)
      dpyinfo->w32_focus_frame = 0;
    if (f == dpyinfo->w32_focus_event_frame)
--- 10834,10843 ----
  
    if (FRAME_FACE_CACHE (f))
      free_frame_faces (f);
! 
    xfree (f->output_data.w32);
    f->output_data.w32 = NULL;
! 
    if (f == dpyinfo->w32_focus_frame)
      dpyinfo->w32_focus_frame = 0;
    if (f == dpyinfo->w32_focus_event_frame)
***************
*** 10944,10950 ****
    xassert (font != NULL);
  
    for (i = 0; i < dpyinfo->n_fonts; i++)
!     if (dpyinfo->font_table[i].name 
        && font == dpyinfo->font_table[i].font)
        break;
  
--- 10943,10949 ----
    xassert (font != NULL);
  
    for (i = 0; i < dpyinfo->n_fonts; i++)
!     if (dpyinfo->font_table[i].name
        && font == dpyinfo->font_table[i].font)
        break;
  
***************
*** 10988,11007 ****
    XFontStruct *font;
    int old_width = dpyinfo->smallest_char_width;
    int old_height = dpyinfo->smallest_font_height;
!   
    dpyinfo->smallest_font_height = 100000;
    dpyinfo->smallest_char_width = 100000;
!   
    for (i = 0; i < dpyinfo->n_fonts; ++i)
      if (dpyinfo->font_table[i].name)
        {
        struct font_info *fontp = dpyinfo->font_table + i;
        int w, h;
!       
        font = (XFontStruct *) fontp->font;
        xassert (font != (XFontStruct *) ~0);
        x_font_min_bounds (font, &w, &h);
!       
        dpyinfo->smallest_font_height = min (dpyinfo->smallest_font_height, h);
        dpyinfo->smallest_char_width = min (dpyinfo->smallest_char_width, w);
        }
--- 10987,11006 ----
    XFontStruct *font;
    int old_width = dpyinfo->smallest_char_width;
    int old_height = dpyinfo->smallest_font_height;
! 
    dpyinfo->smallest_font_height = 100000;
    dpyinfo->smallest_char_width = 100000;
! 
    for (i = 0; i < dpyinfo->n_fonts; ++i)
      if (dpyinfo->font_table[i].name)
        {
        struct font_info *fontp = dpyinfo->font_table + i;
        int w, h;
! 
        font = (XFontStruct *) fontp->font;
        xassert (font != (XFontStruct *) ~0);
        x_font_min_bounds (font, &w, &h);
! 
        dpyinfo->smallest_font_height = min (dpyinfo->smallest_font_height, h);
        dpyinfo->smallest_char_width = min (dpyinfo->smallest_char_width, w);
        }
***************
*** 11041,11047 ****
    w32_display_name_list = Fcons (Fcons (display_name, Qnil),
                                   w32_display_name_list);
    dpyinfo->name_list_element = XCAR (w32_display_name_list);
!   
    dpyinfo->w32_id_name
      = (char *) xmalloc (SCHARS (Vinvocation_name)
                        + SCHARS (Vsystem_name)
--- 11040,11046 ----
    w32_display_name_list = Fcons (Fcons (display_name, Qnil),
                                   w32_display_name_list);
    dpyinfo->name_list_element = XCAR (w32_display_name_list);
! 
    dpyinfo->w32_id_name
      = (char *) xmalloc (SCHARS (Vinvocation_name)
                        + SCHARS (Vsystem_name)
***************
*** 11079,11093 ****
  {
    struct w32_display_info *dpyinfo;
    HDC hdc;
!   
    BLOCK_INPUT;
!   
    if (!w32_initialized)
      {
        w32_initialize ();
        w32_initialized = 1;
      }
!   
    {
      int argc = 0;
      char *argv[3];
--- 11078,11092 ----
  {
    struct w32_display_info *dpyinfo;
    HDC hdc;
! 
    BLOCK_INPUT;
! 
    if (!w32_initialized)
      {
        w32_initialize ();
        w32_initialized = 1;
      }
! 
    {
      int argc = 0;
      char *argv[3];
***************
*** 11100,11106 ****
        argv[argc++] = xrm_option;
        }
    }
!   
    w32_initialize_display_info (display_name);
  
    dpyinfo = &one_w32_display_info;
--- 11099,11105 ----
        argv[argc++] = xrm_option;
        }
    }
! 
    w32_initialize_display_info (display_name);
  
    dpyinfo = &one_w32_display_info;
***************
*** 11108,11114 ****
    /* Put this display on the chain.  */
    dpyinfo->next = x_display_list;
    x_display_list = dpyinfo;
!   
    hdc = GetDC (GetDesktopWindow ());
  
    dpyinfo->height = GetDeviceCaps (hdc, VERTRES);
--- 11107,11113 ----
    /* Put this display on the chain.  */
    dpyinfo->next = x_display_list;
    x_display_list = dpyinfo;
! 
    hdc = GetDC (GetDesktopWindow ());
  
    dpyinfo->height = GetDeviceCaps (hdc, VERTRES);
***************
*** 11291,11297 ****
    init_crit ();
  
    dwMainThreadId = GetCurrentThreadId ();
!   DuplicateHandle (GetCurrentProcess (), GetCurrentThread (), 
                   GetCurrentProcess (), &hMainThread, 0, TRUE, 
DUPLICATE_SAME_ACCESS);
  
    /* Wait for thread to start */
--- 11290,11296 ----
    init_crit ();
  
    dwMainThreadId = GetCurrentThreadId ();
!   DuplicateHandle (GetCurrentProcess (), GetCurrentThread (),
                   GetCurrentProcess (), &hMainThread, 0, TRUE, 
DUPLICATE_SAME_ACCESS);
  
    /* Wait for thread to start */
***************
*** 11301,11313 ****
  
      PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE);
  
!     hWindowsThread = CreateThread (NULL, 0, 
!                              (LPTHREAD_START_ROUTINE) w32_msg_worker, 
                               0, 0, &dwWindowsThreadId);
  
      GetMessage (&msg, NULL, WM_EMACS_DONE, WM_EMACS_DONE);
    }
!   
    /* It is desirable that mainThread should have the same notion of
       focus window and active window as windowsThread.  Unfortunately, the
       following call to AttachThreadInput, which should do precisely what
--- 11300,11312 ----
  
      PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE);
  
!     hWindowsThread = CreateThread (NULL, 0,
!                              (LPTHREAD_START_ROUTINE) w32_msg_worker,
                               0, 0, &dwWindowsThreadId);
  
      GetMessage (&msg, NULL, WM_EMACS_DONE, WM_EMACS_DONE);
    }
! 
    /* It is desirable that mainThread should have the same notion of
       focus window and active window as windowsThread.  Unfortunately, the
       following call to AttachThreadInput, which should do precisely what
***************
*** 11387,11393 ****
               &Vw32_recognize_altgr,
               doc: /* Recognize right-alt and left-ctrl as AltGr.
  When nil, the right-alt and left-ctrl key combination is
! interpreted normally.  */); 
    Vw32_recognize_altgr = Qt;
  
    DEFVAR_BOOL ("w32-enable-unicode-output",
--- 11386,11392 ----
               &Vw32_recognize_altgr,
               doc: /* Recognize right-alt and left-ctrl as AltGr.
  When nil, the right-alt and left-ctrl key combination is
! interpreted normally.  */);
    Vw32_recognize_altgr = Qt;
  
    DEFVAR_BOOL ("w32-enable-unicode-output",
***************
*** 11420,11426 ****
  using the system caret instead of drawing its own cursor.  Some screen
  reader software does not track the system cursor properly when it is
  invisible, and gets confused by Emacs drawing its own cursor, so this
! variable is initialized to t when Emacs detects that screen reader 
  software is running as it starts up.
  
  When this variable is set, other variables affecting the appearance of
--- 11419,11425 ----
  using the system caret instead of drawing its own cursor.  Some screen
  reader software does not track the system cursor properly when it is
  invisible, and gets confused by Emacs drawing its own cursor, so this
! variable is initialized to t when Emacs detects that screen reader
  software is running as it starts up.
  
  When this variable is set, other variables affecting the appearance of




reply via email to

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