diff options
| -rw-r--r-- | src/xfont.c | 6 |
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 | } |