/[emacs]/emacs/src/xterm.c
ViewVC logotype

Diff of /emacs/src/xterm.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.681 by rms, Mon Nov 12 22:55:02 2001 UTC revision 1.682 by gerd, Thu Nov 15 11:01:58 2001 UTC
# Line 11223  x_draw_bar_cursor (w, row, width) Line 11223  x_draw_bar_cursor (w, row, width)
11223  {  {
11224    struct frame *f = XFRAME (w->frame);    struct frame *f = XFRAME (w->frame);
11225    struct glyph *cursor_glyph;    struct glyph *cursor_glyph;
   GC gc;  
   int x;  
   unsigned long mask;  
   XGCValues xgcv;  
   Display *dpy;  
   Window window;  
11226                
11227    /* If cursor is out of bounds, don't draw garbage.  This can happen    /* If cursor is out of bounds, don't draw garbage.  This can happen
11228       in mini-buffer windows when switching between echo area glyphs       in mini-buffer windows when switching between echo area glyphs
# Line 11248  x_draw_bar_cursor (w, row, width) Line 11242  x_draw_bar_cursor (w, row, width)
11242      }      }
11243    else    else
11244      {      {
11245        xgcv.background = f->output_data.x->cursor_pixel;        Display *dpy = FRAME_X_DISPLAY (f);
11246        xgcv.foreground = f->output_data.x->cursor_pixel;        Window window = FRAME_X_WINDOW (f);
11247          GC gc = FRAME_X_DISPLAY_INFO (f)->scratch_cursor_gc;
11248          unsigned long mask = GCForeground | GCBackground | GCGraphicsExposures;
11249          struct face *face = FACE_FROM_ID (f, cursor_glyph->face_id);
11250          XGCValues xgcv;
11251    
11252          /* If the glyph's background equals the color we normally draw
11253             the bar cursor in, the bar cursor in its normal color is
11254             invisible.  Use the glyph's foreground color instead in this
11255             case, on the assumption that the glyph's colors are chosen so
11256             that the glyph is legible.  */
11257          if (face->background == f->output_data.x->cursor_pixel)
11258            xgcv.background = xgcv.foreground = face->foreground;
11259          else
11260            xgcv.background = xgcv.foreground = f->output_data.x->cursor_pixel;
11261        xgcv.graphics_exposures = 0;        xgcv.graphics_exposures = 0;
       mask = GCForeground | GCBackground | GCGraphicsExposures;  
       dpy = FRAME_X_DISPLAY (f);  
       window = FRAME_X_WINDOW (f);  
       gc = FRAME_X_DISPLAY_INFO (f)->scratch_cursor_gc;  
11262        
11263        if (gc)        if (gc)
11264          XChangeGC (dpy, gc, mask, &xgcv);          XChangeGC (dpy, gc, mask, &xgcv);
# Line 11266  x_draw_bar_cursor (w, row, width) Line 11270  x_draw_bar_cursor (w, row, width)
11270        
11271        if (width < 0)        if (width < 0)
11272          width = f->output_data.x->cursor_width;          width = f->output_data.x->cursor_width;
11273          width = min (cursor_glyph->pixel_width, width);
11274        
       x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x);  
11275        x_clip_to_row (w, row, gc, 0);        x_clip_to_row (w, row, gc, 0);
11276        XFillRectangle (dpy, window, gc,        XFillRectangle (dpy, window, gc,
11277                        x,                        WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x),
11278                        WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y),                        WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y),
11279                        min (cursor_glyph->pixel_width, width),                        width, row->height);
                       row->height);  
11280        XSetClipMask (dpy, gc, None);        XSetClipMask (dpy, gc, None);
11281      }      }
11282  }  }

Legend:
Removed from v.1.681  
changed lines
  Added in v.1.682

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26