From a05810b2d5f1a87ad1b20c4e61adc464a31e315d Mon Sep 17 00:00:00 2001 From: Akira Kyle Date: Mon, 9 Nov 2020 14:51:48 +0100 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. Copyright-paperwork-exempt: yes --- src/xwidget.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/xwidget.c b/src/xwidget.c index 031975fafb9..e078a28a35b 100644 --- a/src/xwidget.c +++ b/src/xwidget.c @@ -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, -- 2.39.2