aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2008-02-17 02:03:07 +0000
committerKenichi Handa2008-02-17 02:03:07 +0000
commitd45fefc73cafdfae7dc5bc729d3ad35d78d48b67 (patch)
tree7a2cede8ed67220cef3663005ca06e16214c9be0 /src
parent1c5c216ba99584a761cc3bdb78906e848530c043 (diff)
downloademacs-d45fefc73cafdfae7dc5bc729d3ad35d78d48b67.tar.gz
emacs-d45fefc73cafdfae7dc5bc729d3ad35d78d48b67.zip
(xfont_draw): Use BLOCK_INPUT and UNBLOCK_INPUT.
Diffstat (limited to 'src')
-rw-r--r--src/xfont.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/xfont.c b/src/xfont.c
index 8bbb2442bb1..edf15f940fc 100644
--- a/src/xfont.c
+++ b/src/xfont.c
@@ -781,9 +781,11 @@ xfont_draw (s, from, to, x, y, with_background)
781 XGCValues xgcv; 781 XGCValues xgcv;
782 Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (s->f); 782 Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (s->f);
783 783
784 BLOCK_INPUT;
784 XGetGCValues (s->display, gc, GCFont, &xgcv); 785 XGetGCValues (s->display, gc, GCFont, &xgcv);
785 if (xgcv.font != xfont->fid) 786 if (xgcv.font != xfont->fid)
786 XSetFont (s->display, gc, xfont->fid); 787 XSetFont (s->display, gc, xfont->fid);
788 UNBLOCK_INPUT;
787 } 789 }
788 790
789 if (xfont->min_byte1 == 0 && xfont->max_byte1 == 0) 791 if (xfont->min_byte1 == 0 && xfont->max_byte1 == 0)
@@ -795,22 +797,26 @@ xfont_draw (s, from, to, x, y, with_background)
795 SAFE_ALLOCA (str, char *, len); 797 SAFE_ALLOCA (str, char *, len);
796 for (i = 0; i < len ; i++) 798 for (i = 0; i < len ; i++)
797 str[i] = XCHAR2B_BYTE2 (s->char2b + from + i); 799 str[i] = XCHAR2B_BYTE2 (s->char2b + from + i);
800 BLOCK_INPUT;
798 if (with_background > 0) 801 if (with_background > 0)
799 XDrawImageString (FRAME_X_DISPLAY (s->f), FRAME_X_WINDOW (s->f), 802 XDrawImageString (FRAME_X_DISPLAY (s->f), FRAME_X_WINDOW (s->f),
800 gc, x, y, str, len); 803 gc, x, y, str, len);
801 else 804 else
802 XDrawString (FRAME_X_DISPLAY (s->f), FRAME_X_WINDOW (s->f), 805 XDrawString (FRAME_X_DISPLAY (s->f), FRAME_X_WINDOW (s->f),
803 gc, x, y, str, len); 806 gc, x, y, str, len);
807 UNBLOCK_INPUT;
804 SAFE_FREE (); 808 SAFE_FREE ();
805 return s->nchars; 809 return s->nchars;
806 } 810 }
807 811
812 BLOCK_INPUT;
808 if (with_background > 0) 813 if (with_background > 0)
809 XDrawImageString16 (FRAME_X_DISPLAY (s->f), FRAME_X_WINDOW (s->f), 814 XDrawImageString16 (FRAME_X_DISPLAY (s->f), FRAME_X_WINDOW (s->f),
810 gc, x, y, s->char2b + from, len); 815 gc, x, y, s->char2b + from, len);
811 else 816 else
812 XDrawString16 (FRAME_X_DISPLAY (s->f), FRAME_X_WINDOW (s->f), 817 XDrawString16 (FRAME_X_DISPLAY (s->f), FRAME_X_WINDOW (s->f),
813 gc, x, y, s->char2b + from, len); 818 gc, x, y, s->char2b + from, len);
819 UNBLOCK_INPUT;
814 820
815 return len; 821 return len;
816} 822}