From 54c0cfdba0ae036cfca6083154ed52f7e2499174 Mon Sep 17 00:00:00 2001 From: Akira Kyle Date: Thu, 5 Nov 2020 13:20:42 -0700 Subject: [PATCH] Fix xwidget's webkitgtk widget overriding of Emacs SIGCHLD handler * src/xwidget.c (make-xwidget): Save and restore Emacs SIGCHLD signal handler since glib doesn't (but should) do this. --- src/xwidget.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/xwidget.c b/src/xwidget.c index c505af58f6..69f0e03625 100644 --- a/src/xwidget.c +++ b/src/xwidget.c @@ -125,6 +125,16 @@ DEFUN ("make-xwidget", 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 it's 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, -- 2.28.0