emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs/src ChangeLog nsterm.m w32term.c xterm.c


From: Jason Rumney
Subject: [Emacs-diffs] emacs/src ChangeLog nsterm.m w32term.c xterm.c
Date: Sun, 19 Apr 2009 15:09:27 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Jason Rumney <jasonr>   09/04/19 15:09:27

Modified files:
        src            : ChangeLog nsterm.m w32term.c xterm.c 

Log message:
        The following changes fix Bug#3005 for wide glyphs on each platform,
        without reintroducing Bug#1258 for stretch glyphs.
        
        * xterm.c (x_draw_bar_cursor): Limit cursor width differently for
        BAR_CURSOR and HBAR_CURSOR.  Calculate width of HBAR_CURSOR using
        get_phys_cursor_geometry.
        
        * w32term.c (x_draw_bar_cursor):  Limit cursor width differently
        for BAR_CURSOR and HBAR_CURSOR.  Calculate width of HBAR_CURSOR
        using get_phys_cursor_geometry.
        
        * nsterm.m (ns_draw_window_cursor): HBAR_CURSOR width already
        correctly calculated.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/src/ChangeLog?cvsroot=emacs&r1=1.7498&r2=1.7499
http://cvs.savannah.gnu.org/viewcvs/emacs/src/nsterm.m?cvsroot=emacs&r1=1.67&r2=1.68
http://cvs.savannah.gnu.org/viewcvs/emacs/src/w32term.c?cvsroot=emacs&r1=1.323&r2=1.324
http://cvs.savannah.gnu.org/viewcvs/emacs/src/xterm.c?cvsroot=emacs&r1=1.1023&r2=1.1024

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/src/ChangeLog,v
retrieving revision 1.7498
retrieving revision 1.7499
diff -u -b -r1.7498 -r1.7499
--- ChangeLog   19 Apr 2009 10:53:18 -0000      1.7498
+++ ChangeLog   19 Apr 2009 15:09:25 -0000      1.7499
@@ -1,3 +1,19 @@
+2009-04-19  Jason Rumney  <address@hidden>
+
+       The following changes fix Bug#3005 for wide glyphs on each platform,
+       without reintroducing Bug#1258 for stretch glyphs.
+
+       * xterm.c (x_draw_bar_cursor): Limit cursor width differently for
+       BAR_CURSOR and HBAR_CURSOR.  Calculate width of HBAR_CURSOR using
+       get_phys_cursor_geometry.
+
+       * w32term.c (x_draw_bar_cursor):  Limit cursor width differently
+       for BAR_CURSOR and HBAR_CURSOR.  Calculate width of HBAR_CURSOR
+       using get_phys_cursor_geometry.
+
+       * nsterm.m (ns_draw_window_cursor): HBAR_CURSOR width already
+       correctly calculated.
+
 2009-04-19  Jan Djärv  <address@hidden>
 
        * gtkutil.c (xg_tool_bar_menu_proxy, update_frame_tool_bar): Use

Index: nsterm.m
===================================================================
RCS file: /sources/emacs/emacs/src/nsterm.m,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -b -r1.67 -r1.68
--- nsterm.m    14 Mar 2009 21:20:09 -0000      1.67
+++ nsterm.m    19 Apr 2009 15:09:26 -0000      1.68
@@ -2412,7 +2412,6 @@
     case HBAR_CURSOR:
       s = r;
       s.origin.y += lrint (0.75 * s.size.height);
-      s.size.width = min (FRAME_COLUMN_WIDTH (f), s.size.width);
       s.size.height = lrint (s.size.height * 0.25);
       NSRectFill (s);
       break;

Index: w32term.c
===================================================================
RCS file: /sources/emacs/emacs/src/w32term.c,v
retrieving revision 1.323
retrieving revision 1.324
diff -u -b -r1.323 -r1.324
--- w32term.c   22 Mar 2009 02:39:30 -0000      1.323
+++ w32term.c   19 Apr 2009 15:09:26 -0000      1.324
@@ -4970,8 +4970,6 @@
 {
   struct frame *f = XFRAME (w->frame);
   struct glyph *cursor_glyph;
-  int x;
-  HDC hdc;
 
   /* If cursor is out of bounds, don't draw garbage.  This can happen
      in mini-buffer windows when switching between echo area glyphs
@@ -4993,6 +4991,8 @@
     {
       COLORREF cursor_color = f->output_data.w32->cursor_pixel;
       struct face *face = FACE_FROM_ID (f, cursor_glyph->face_id);
+      int x;
+      HDC hdc;
 
       /* If the glyph's background equals the color we normally draw
         the bar cursor in, the bar cursor in its normal color is
@@ -5004,29 +5004,36 @@
 
       x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x);
 
+      hdc = get_frame_dc (f);
+      w32_clip_to_row (w, row, TEXT_AREA, hdc);
+
+      if (kind == BAR_CURSOR)
+       {
       if (width < 0)
         width = FRAME_CURSOR_WIDTH (f);
       width = min (cursor_glyph->pixel_width, width);
 
       w->phys_cursor_width = width;
 
-
-      hdc = get_frame_dc (f);
-      w32_clip_to_row (w, row, TEXT_AREA, hdc);
-
-      if (kind == BAR_CURSOR)
-       {
          w32_fill_area (f, hdc, cursor_color, x,
                         WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y),
                         width, row->height);
        }
       else
        {
+         int dummy_x, dummy_y, dummy_h;
+
+         if (width < 0)
+           width = row->height;
+
+         width = min (row->height, width);
+
+         get_phys_cursor_geometry (w, row, cursor_glyph, &dummy_x,
+                                   &dummy_y, &dummy_h);
          w32_fill_area (f, hdc, cursor_color, x,
                         WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y +
                                                  row->height - width),
-                        min (FRAME_COLUMN_WIDTH (f), 
cursor_glyph->pixel_width),
-                        width);
+                        w->phys_cursor_width, width);
        }
 
       w32_set_clip_rectangle (hdc, NULL);

Index: xterm.c
===================================================================
RCS file: /sources/emacs/emacs/src/xterm.c,v
retrieving revision 1.1023
retrieving revision 1.1024
diff -u -b -r1.1023 -r1.1024
--- xterm.c     27 Mar 2009 18:37:56 -0000      1.1023
+++ xterm.c     19 Apr 2009 15:09:26 -0000      1.1024
@@ -7426,7 +7426,7 @@
       XGCValues xgcv;
 
       /* If the glyph's background equals the color we normally draw
-        the bar cursor in, the bar cursor in its normal color is
+        the bars cursor in, the bar cursor in its normal color is
         invisible.  Use the glyph's foreground color instead in this
         case, on the assumption that the glyph's colors are chosen so
         that the glyph is legible.  */
@@ -7444,25 +7444,39 @@
          FRAME_X_DISPLAY_INFO (f)->scratch_cursor_gc = gc;
        }
 
+      x_clip_to_row (w, row, TEXT_AREA, gc);
+
+      if (kind == BAR_CURSOR)
+       {
       if (width < 0)
        width = FRAME_CURSOR_WIDTH (f);
       width = min (cursor_glyph->pixel_width, width);
 
       w->phys_cursor_width = width;
-      x_clip_to_row (w, row, TEXT_AREA, gc);
 
-      if (kind == BAR_CURSOR)
          XFillRectangle (dpy, window, gc,
                          WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x),
                          WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y),
                          width, row->height);
+       }
       else
+       {
+         int dummy_x, dummy_y, dummy_h;
+
+         if (width < 0)
+           width = row->height;
+
+         width = min (row->height, width);
+
+         get_phys_cursor_geometry (w, row, cursor_glyph, &dummy_x,
+                                   &dummy_y, &dummy_h);
+
          XFillRectangle (dpy, window, gc,
                          WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x),
                          WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y +
                                                   row->height - width),
-                         min (FRAME_COLUMN_WIDTH (f), 
cursor_glyph->pixel_width),
-                         width);
+                         w->phys_cursor_width, width);
+       }
 
       XSetClipMask (dpy, gc, None);
     }




reply via email to

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