]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix xwidget's webkitgtk widget overriding of Emacs SIGCHLD handler
authorAkira Kyle <akira@akirakyle.com>
Mon, 9 Nov 2020 13:51:48 +0000 (14:51 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 9 Nov 2020 13:51:48 +0000 (14:51 +0100)
* src/xwidget.c (make-xwidget): Save and restore Emacs SIGCHLD signal
handler since glib doesn't (but should) do this.
Copyright-paperwork-exempt: yes

src/xwidget.c

index 031975fafb9ffff8bc7abeb4b359e898b2ab37fe..e078a28a35b987e34e170d102c2a7b39ade82eb8 100644 (file)
@@ -128,6 +128,16 @@ Returns the newly constructed xwidget, or nil if construction fails.  */)
       if (EQ (xw->type, Qwebkit))
         {
           xw->widget_osr = webkit_web_view_new ();
+
+          /* webkitgtk uses GSubprocess which sets sigaction causing
+             Emacs to not catch SIGCHLD with its usual handle setup in
+             catch_child_signal().  This resets the SIGCHLD
+             sigaction.  */
+          struct sigaction old_action;
+          sigaction (SIGCHLD, NULL, &old_action);
+          webkit_web_view_load_uri(WEBKIT_WEB_VIEW (xw->widget_osr),
+                                   "about:blank");
+          sigaction (SIGCHLD, &old_action, NULL);
         }
 
       gtk_widget_set_size_request (GTK_WIDGET (xw->widget_osr), xw->width,