emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs/src nsterm.m


From: David Reitter
Subject: [Emacs-diffs] emacs/src nsterm.m
Date: Thu, 07 May 2009 13:46:57 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     David Reitter <davidswelt>      09/05/07 13:46:57

Modified files:
        src            : nsterm.m 

Log message:
        ns_dumpglyphs_stretch, ns_dumpglyphs_image:  respect mouse face 
background.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/src/nsterm.m?cvsroot=emacs&r1=1.71&r2=1.72

Patches:
Index: nsterm.m
===================================================================
RCS file: /sources/emacs/emacs/src/nsterm.m,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -b -r1.71 -r1.72
--- nsterm.m    7 May 2009 03:22:09 -0000       1.71
+++ nsterm.m    7 May 2009 13:46:56 -0000       1.72
@@ -2808,6 +2808,7 @@
   int th;
   char raised_p;
   NSRect br;
+  struct face *face;
 
   NSTRACE (ns_dumpglyphs_image);
 
@@ -2827,8 +2828,17 @@
   /* Draw BG: if we need larger area than image itself cleared, do that,
      otherwise, since we composite the image under NS (instead of mucking
      with its background color), we must clear just the image area. */
-  [ns_lookup_indexed_color (NS_FACE_BACKGROUND
-            (FACE_FROM_ID (s->f, s->first_glyph->face_id)), s->f) set];
+  if (s->hl == DRAW_MOUSE_FACE)
+    {
+      face = FACE_FROM_ID
+       (s->f, FRAME_NS_DISPLAY_INFO (s->f)->mouse_face_face_id);
+      if (!face)
+       face = FACE_FROM_ID (s->f, MOUSE_FACE_ID);
+    }
+  else
+    face = FACE_FROM_ID (s->f, s->first_glyph->face_id);
+
+  [ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), s->f) set];
 
   if (bg_height > s->slice.height || s->img->hmargin || s->img->vmargin
       || s->img->mask || s->img->pixmap == 0 || s->width != 
s->background_width)
@@ -2899,6 +2909,7 @@
 {
   NSRect r[2];
   int n, i;
+  struct face *face;
 
   if (!s->background_filled_p)
     {
@@ -2940,8 +2951,19 @@
         }
 
       ns_focus (s->f, r, n);
-      [ns_lookup_indexed_color (NS_FACE_BACKGROUND
-           (FACE_FROM_ID (s->f, s->first_glyph->face_id)), s->f) set];
+
+      if (s->hl == DRAW_MOUSE_FACE)
+       {
+         face = FACE_FROM_ID
+           (s->f, FRAME_NS_DISPLAY_INFO (s->f)->mouse_face_face_id);
+         if (!face)
+           face = FACE_FROM_ID (s->f, MOUSE_FACE_ID);
+       }
+      else
+       face = FACE_FROM_ID (s->f, s->first_glyph->face_id);
+
+      [ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), s->f) set];
+
       NSRectFill (r[0]);
       NSRectFill (r[1]);
       ns_unfocus (s->f);




reply via email to

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