aboutsummaryrefslogtreecommitdiffstats
path: root/src/xterm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xterm.c')
-rw-r--r--src/xterm.c67
1 files changed, 27 insertions, 40 deletions
diff --git a/src/xterm.c b/src/xterm.c
index a68725a463c..c54b96a19b7 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -1,6 +1,6 @@
1/* X Communication module for terminals which understand the X protocol. 1/* X Communication module for terminals which understand the X protocol.
2 Copyright (C) 1989, 93, 94, 95, 96, 97, 98, 1999, 2000,01,02,03,04 2 Copyright (C) 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
3 Free Software Foundation, Inc. 3 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -7157,7 +7157,7 @@ x_clip_to_row (w, row, area, gc)
7157 window_box (w, area, &window_x, &window_y, &window_width, 0); 7157 window_box (w, area, &window_x, &window_y, &window_width, 0);
7158 7158
7159 clip_rect.x = window_x; 7159 clip_rect.x = window_x;
7160 clip_rect.y = WINDOW_TO_FRAME_PIXEL_Y (w, row->y); 7160 clip_rect.y = WINDOW_TO_FRAME_PIXEL_Y (w, max (0, row->y));
7161 clip_rect.y = max (clip_rect.y, window_y); 7161 clip_rect.y = max (clip_rect.y, window_y);
7162 clip_rect.width = window_width; 7162 clip_rect.width = window_width;
7163 clip_rect.height = row->visible_height; 7163 clip_rect.height = row->visible_height;
@@ -7187,29 +7187,10 @@ x_draw_hollow_cursor (w, row)
7187 if (cursor_glyph == NULL) 7187 if (cursor_glyph == NULL)
7188 return; 7188 return;
7189 7189
7190 /* Compute the width of the rectangle to draw. If on a stretch 7190 /* Compute frame-relative coordinates for phys cursor. */
7191 glyph, and `x-stretch-block-cursor' is nil, don't draw a
7192 rectangle as wide as the glyph, but use a canonical character
7193 width instead. */
7194 wd = cursor_glyph->pixel_width - 1;
7195 if (cursor_glyph->type == STRETCH_GLYPH
7196 && !x_stretch_cursor_p)
7197 wd = min (FRAME_COLUMN_WIDTH (f), wd);
7198 w->phys_cursor_width = wd;
7199
7200 /* Compute frame-relative coordinates from window-relative
7201 coordinates. */
7202 x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x); 7191 x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x);
7203 y = WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y); 7192 y = get_phys_cursor_geometry (w, row, cursor_glyph, &h);
7204 7193 wd = w->phys_cursor_width;
7205 /* Compute the proper height and ascent of the rectangle, based
7206 on the actual glyph. Using the full height of the row looks
7207 bad when there are tall images on that row. */
7208 h = max (min (FRAME_LINE_HEIGHT (f), row->height),
7209 cursor_glyph->ascent + cursor_glyph->descent);
7210 if (h < row->height)
7211 y += row->ascent /* - w->phys_cursor_ascent */ + cursor_glyph->descent - h;
7212 h--;
7213 7194
7214 /* The foreground of cursor_gc is typically the same as the normal 7195 /* The foreground of cursor_gc is typically the same as the normal
7215 background color, which can cause the cursor box to be invisible. */ 7196 background color, which can cause the cursor box to be invisible. */
@@ -7773,11 +7754,32 @@ x_connection_closed (dpy, error_message)
7773 error ("%s", error_msg); 7754 error ("%s", error_msg);
7774} 7755}
7775 7756
7757/* We specifically use it before defining it, so that gcc doesn't inline it,
7758 otherwise gdb doesn't know how to properly put a breakpoint on it. */
7759static void x_error_quitter (Display *display, XErrorEvent *error);
7760
7761/* This is the first-level handler for X protocol errors.
7762 It calls x_error_quitter or x_error_catcher. */
7763
7764static int
7765x_error_handler (display, error)
7766 Display *display;
7767 XErrorEvent *error;
7768{
7769 if (! NILP (x_error_message_string))
7770 x_error_catcher (display, error);
7771 else
7772 x_error_quitter (display, error);
7773 return 0;
7774}
7776 7775
7777/* This is the usual handler for X protocol errors. 7776/* This is the usual handler for X protocol errors.
7778 It kills all frames on the display that we got the error for. 7777 It kills all frames on the display that we got the error for.
7779 If that was the only one, it prints an error message and kills Emacs. */ 7778 If that was the only one, it prints an error message and kills Emacs. */
7780 7779
7780/* It is after x_error_handler so that it won't get inlined in
7781 x_error_handler. */
7782
7781static void 7783static void
7782x_error_quitter (display, error) 7784x_error_quitter (display, error)
7783 Display *display; 7785 Display *display;
@@ -7795,21 +7797,6 @@ x_error_quitter (display, error)
7795} 7797}
7796 7798
7797 7799
7798/* This is the first-level handler for X protocol errors.
7799 It calls x_error_quitter or x_error_catcher. */
7800
7801static int
7802x_error_handler (display, error)
7803 Display *display;
7804 XErrorEvent *error;
7805{
7806 if (! NILP (x_error_message_string))
7807 x_error_catcher (display, error);
7808 else
7809 x_error_quitter (display, error);
7810 return 0;
7811}
7812
7813/* This is the handler for X IO errors, always. 7800/* This is the handler for X IO errors, always.
7814 It kills all frames on the display that we lost touch with. 7801 It kills all frames on the display that we lost touch with.
7815 If that was the only one, it prints an error message and kills Emacs. */ 7802 If that was the only one, it prints an error message and kills Emacs. */