Fix wrong overhang display for gstring compositions (Bug#12364).
[bpt/emacs.git] / src / xterm.c
index 047b556..e5a5932 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
@@ -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;
              }
        }
     }
@@ -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 */
 }
 
@@ -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);
@@ -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);
 }