]> code.delx.au - gnu-emacs/blobdiff - src/xterm.c
Fix wrong overhang display for gstring compositions (Bug#12364).
[gnu-emacs] / src / xterm.c
index f497b5322bf8580b9fd6200a63c8bdcdd782a760..e5a5932beaedf95f6800c9cfea84969699010893 100644 (file)
@@ -21,7 +21,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 /* Xt features made by Fred Pierresteguy.  */
 
 #include <config.h>
-#include <signal.h>
 #include <stdio.h>
 #include <setjmp.h>
 
@@ -29,9 +28,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "lisp.h"
 #include "blockinput.h"
-
-/* Need syssignal.h for various externs and definitions that may be required
-   by some configurations for calls to signal later in this source file.  */
 #include "syssignal.h"
 
 /* This may include sys/types.h, and that somehow loses
@@ -1467,7 +1463,7 @@ x_frame_of_widget (Widget widget)
        && f->output_data.x->widget == widget)
       return f;
 
-  abort ();
+  emacs_abort ();
 }
 
 /* Allocate a color which is lighter or darker than *PIXEL by FACTOR
@@ -2696,7 +2692,7 @@ x_draw_underwave (struct glyph_string *s)
     y2 += dy;
 
   if (INT_MAX - dx < xmax)
-    abort ();
+    emacs_abort ();
 
   while (x1 <= xmax)
     {
@@ -2805,7 +2801,7 @@ x_draw_glyph_string (struct glyph_string *s)
       break;
 
     default:
-      abort ();
+      emacs_abort ();
     }
 
   if (!s->for_overlaps)
@@ -2979,6 +2975,7 @@ x_draw_glyph_string (struct glyph_string *s)
                XSetClipMask (next->display, next->gc, None);
                next->hl = save;
                next->num_clips = 0;
+               next->clip_head = s->next;
              }
        }
     }
@@ -3005,7 +3002,7 @@ x_shift_glyphs_for_insert (struct frame *f, int x, int y, int width, int height,
 static void
 x_delete_glyphs (struct frame *f, register int n)
 {
-  abort ();
+  emacs_abort ();
 }
 
 
@@ -3278,7 +3275,7 @@ XTset_terminal_window (struct frame *f, int n)
 static void
 x_ins_del_lines (struct frame *f, int vpos, int n)
 {
-  abort ();
+  emacs_abort ();
 }
 
 
@@ -4115,7 +4112,7 @@ x_window_to_scroll_bar (Display *display, Window window_id)
       frame = XCAR (tail);
       /* All elements of Vframe_list should be frames.  */
       if (! FRAMEP (frame))
-       abort ();
+       emacs_abort ();
 
       if (! FRAME_X_P (XFRAME (frame)))
         continue;
@@ -5434,7 +5431,7 @@ XTredeem_scroll_bar (struct window *window)
 
   /* We can't redeem this window's scroll bar if it doesn't have one.  */
   if (NILP (window->vertical_scroll_bar))
-    abort ();
+    emacs_abort ();
 
   bar = XSCROLL_BAR (window->vertical_scroll_bar);
 
@@ -5453,7 +5450,7 @@ XTredeem_scroll_bar (struct window *window)
       else
        /* If its prev pointer is nil, it must be at the front of
           one or the other!  */
-       abort ();
+       emacs_abort ();
     }
   else
     XSCROLL_BAR (bar->prev)->next = bar->next;
@@ -5551,7 +5548,7 @@ static void
 x_scroll_bar_handle_click (struct scroll_bar *bar, XEvent *event, struct input_event *emacs_event)
 {
   if (! WINDOWP (bar->window))
-    abort ();
+    emacs_abort ();
 
   emacs_event->kind = SCROLL_BAR_CLICK_EVENT;
   emacs_event->code = event->xbutton.button - Button1;
@@ -6457,7 +6454,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr,
                 }
               else if (status_return != XLookupKeySym
                        && status_return != XLookupBoth)
-                abort ();
+                emacs_abort ();
             }
           else
             nbytes = XLookupString (&event.xkey, (char *) copy_bufptr,
@@ -7496,7 +7493,7 @@ x_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, int x, int
              break;
 
            default:
-             abort ();
+             emacs_abort ();
            }
        }
 
@@ -7766,7 +7763,9 @@ x_connection_signal (int signalnum)       /* If we don't have an argument, */
 #ifdef USG
   /* USG systems forget handlers when they are used;
      must reestablish each time */
-  signal (signalnum, x_connection_signal);
+  struct sigaction action;
+  emacs_sigaction_init (&action, x_connection_signal);
+  sigaction (signalnum, &action, 0);
 #endif /* USG */
 }
 
@@ -7849,7 +7848,7 @@ When compiled with GTK, Emacs cannot recover from X disconnects.\n\
 This is a GTK bug: https://bugzilla.gnome.org/show_bug.cgi?id=85715\n\
 For details, see etc/PROBLEMS.\n",
               error_msg);
-      abort ();
+      emacs_abort ();
 #endif /* USE_GTK */
 
       /* Indicate that this display is dead.  */
@@ -7859,7 +7858,7 @@ For details, see etc/PROBLEMS.\n",
       dpyinfo->terminal->reference_count--;
       if (dpyinfo->reference_count != 0)
         /* We have just closed all frames on this display. */
-        abort ();
+        emacs_abort ();
 
       {
        Lisp_Object tmp;
@@ -7876,10 +7875,15 @@ For details, see etc/PROBLEMS.\n",
     }
 
   /* Ordinary stack unwind doesn't deal with these.  */
+  {
+    sigset_t unblocked;
+    sigemptyset (&unblocked);
 #ifdef SIGIO
-  sigunblock (sigmask (SIGIO));
+    sigaddset (&unblocked, SIGIO);
 #endif
-  sigunblock (sigmask (SIGALRM));
+    sigaddset (&unblocked, SIGALRM);
+    pthread_sigmask (SIG_UNBLOCK, &unblocked, 0);
+  }
   TOTALLY_UNBLOCK_INPUT;
 
   unbind_to (idx, Qnil);
@@ -10436,7 +10440,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
     to.addr = (XPointer)&font;
     x_catch_errors (dpy);
     if (!XtCallConverter (dpy, XtCvtStringToFont, &d, 1, &fr, &to, NULL))
-      abort ();
+      emacs_abort ();
     if (x_had_errors_p (dpy) || !XQueryFont (dpy, font))
       XrmPutLineResource (&xrdb, "Emacs.dialog.*.font: 9x15");
     x_uncatch_errors ();
@@ -10759,6 +10763,8 @@ x_create_terminal (struct x_display_info *dpyinfo)
 void
 x_initialize (void)
 {
+  struct sigaction action;
+
   baud_rate = 19200;
 
   x_noop_count = 0;
@@ -10805,7 +10811,8 @@ x_initialize (void)
   XSetErrorHandler (x_error_handler);
   XSetIOErrorHandler (x_io_error_quitter);
 
-  signal (SIGPIPE, x_connection_signal);
+  emacs_sigaction_init (&action, x_connection_signal);
+  sigaction (SIGPIPE, &action, 0);
 }