[Top][All Lists]

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

Re: [PATCH/Now RFA] Console based mouse face highlighting.

From: Nick Roberts
Subject: Re: [PATCH/Now RFA] Console based mouse face highlighting.
Date: Wed, 16 May 2007 15:54:00 +1200

 > I actually don't understand at all why you need to modify the glyph
 > matrix.  What are you modifying there, exactly?

Just the face_id.  I'm replacing it with mouse_face_face_id and putting it
back afterwards:

         term_show_mouse_face (draw)
         i loop ...

          if(draw == DRAW_MOUSE_FACE)
              struct glyph* glyph;
              face_ids[i] = xmalloc (nglyphs * sizeof (int));
              for (j = 0; j < nglyphs; j = j++)
                  glyph = (row->glyphs[TEXT_AREA] + start_hpos + j);
                  face_ids[i][j] = glyph->face_id;
                  glyph->face_id = mouse_face_face_id;
          else /* draw == DRAW_NORMAL_TEXT */
              for (j = 0; j< nglyphs; j = j++)
                  (row->glyphs[TEXT_AREA] + start_hpos + j)->face_id
                    = face_ids[i][j];
              if (face_ids[i])
                  xfree (face_ids[i]);
                  face_ids[i] = NULL;

          pos_y = row->y + WINDOW_TOP_EDGE_Y (w);
          pos_x = row->used[LEFT_MARGIN_AREA] + start_hpos
            + WINDOW_LEFT_EDGE_X (w);
          cursor_to (pos_y, pos_x);
          write_glyphs (row->glyphs[TEXT_AREA] + start_hpos, nglyphs);

 > > Anyway I'd like to commit these changes now.
 > I'd be happier if you fixed the two aspects we've been talking about
 > (not change the glyph matrix and avoid calling this code on non-tty
 > frames.  I think these are really nasty bugs.  And I don't see any
 > reason for haste here.

Thre's no hurry, but once it's in people can, and will, tell me what's wrong
with it.  I'm not sure these are really nasty bugs: you can only open a
connection with Gpm from a Linux console, e.g., it's a no-op on X, and the
display seems pretty much to DTRT. Currently, the variable row is a row from
the current matrix, but it needn't be.  However I don't think declaring a new
struct glyph_row varable would save much.  I'm not sure what else I could do.

 > Thanks for working on this.

Thanks for the hints.

Nick                                           http://www.inet.net.nz/~nickrob

reply via email to

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