From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.devel Subject: Re: long-standing GTK bug Date: Wed, 02 Mar 2022 22:12:35 +0800 Message-ID: <871qzktpd8.fsf@yahoo.com> References: <83zhbcg6s4.fsf@gnu.org> <87r1wng2ki.fsf@linaro.org> <83o8rrenn1.fsf@gnu.org> <87blnr6uck.fsf@tullinup.koldfront.dk> <87wo5kumkn.fsf_-_@tullinup.koldfront.dk> <86ftc5hc8j.fsf@gmail.com> <87d079io10.fsf@tullinup.koldfront.dk> <87ftbyokll.fsf@tullinup.koldfront.dk> <87pmn5cqpk.fsf@tullinup.koldfront.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35063"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) Cc: Adam =?utf-8?Q?Sj=C3=B8gren?= To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Mar 02 15:14:09 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nPPjz-0008tE-S0 for ged-emacs-devel@m.gmane-mx.org; Wed, 02 Mar 2022 15:14:07 +0100 Original-Received: from localhost ([::1]:41510 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nPPjy-0001pl-9y for ged-emacs-devel@m.gmane-mx.org; Wed, 02 Mar 2022 09:14:06 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:50850) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nPPin-0000Nx-7q for emacs-devel@gnu.org; Wed, 02 Mar 2022 09:12:54 -0500 Original-Received: from sonic302-21.consmr.mail.ne1.yahoo.com ([66.163.186.147]:46387) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nPPik-0006UO-FE for emacs-devel@gnu.org; Wed, 02 Mar 2022 09:12:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1646230367; bh=u76AyZ0KuZ7HAKkHFgBgaEnV807JzukXZGZKOXSUlmE=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=blNfkLeLouUYmv74s8G20O33z/NMeYGPsOoQQgLAmfWT9+1YFTzz37bqFY/ICDpQ1e8GT3qxAdXHtN2kcUBKcspqZsmCW8+FFlrwgkBjtlBUHz0/o6ETZsyxA8Tw48f7gtuBUYw19E6IboqlI4MPYh2t7/D7nFCgnCfuJK0YVyJ87wRQywoxWpKkFv+uhKVM2/1UcrhOHilQTmfGQI0Yww5qjdCLaoB/wna3b0+ouxy5eXQuyLSgsNhSKWUkElUWmfWF99uFjiP6icH7fbmdfdnizrmwV7bkyccz+sFISi3s43xVWAEL11jCim1jg28wjsE/e9FHyRri4eHOtwiVww== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1646230367; bh=Y+mZaqRO+n7I+7BP+dMCf2HbFXLJ/pQFOjTzilemH6+=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=BMuuq3ECLxqxf+XEm87SfmzC1zWj5O5Xu3TinGhqxeUeIIcdnclPT4Uz59KyQAGxo3pBUf6NrW4gdU/Smk78m5zQxAQELxqWmkZEc/AFI/gYXPTuYVCRYtJutJ9R7nTBJWP+HUKJBXYxfzG0kfV/EB7hSFBwFDlW7q11nKSmCk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onic.gate.mail.ne1.yahoo.com by sonic302.consmr.mail.ne1.yahoo.com with HTTP; Wed, 2 Mar 2022 14:12:47 +0000 Original-Received: by kubenode501.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 75f928290aa2b22a3ebaa0b518cef5e6; Wed, 02 Mar 2022 14:12:41 +0000 (UTC) In-Reply-To: <87pmn5cqpk.fsf@tullinup.koldfront.dk> ("Adam =?utf-8?Q?Sj?= =?utf-8?Q?=C3=B8gren=22's?= message of "Tue, 01 Mar 2022 22:23:19 +0100") X-Mailer: WebService/1.1.19724 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.186.147; envelope-from=luangruo@yahoo.com; helo=sonic302-21.consmr.mail.ne1.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:286773 Archived-At: Adam Sj=C3=B8gren writes: > A recent blog post: > https://tychoish.com/post/the-emacs-daemon-gtk-bug-a-parable/ made me > aware of the continued discussion that happened on the GTK issue 11 > months ago, which I had previously missed. > > A very interesting comment is this one by Michel D=C3=A4nzer: > > FWIW, the upcoming release 40 of mutter (which uses GTK3 for drawing > X11 client window decorations) is able to survive Xwayland dying > abruptly, using the new XSetIOErrorExitHandler API (which removes > the need for longjmp hacks) available as of libX11 1.7.0. > > =C2=B7 https://gitlab.gnome.org/GNOME/gtk/-/issues/2315#note_1052481 > > Which sounds like exactly what is needed, doesn't it? > > Switch from using the current XIOErrorHandler to the "new" > XSetIOErrorExitHandler API to avoid the longjmp and the sketchy patchy > hackery I ended up with. > > This API is available in libX11 1.7.0 - I just checked the version in > Debian stable, and it is 1.7.2, so it's not some outrageously new > bleeding edge addition. > > Now we just need someone with libX11 API chops to start ... eh, > chopping! It doesn't work. The part of Mutter that inherited from Metacity is special in how it uses GTK for various reasons, so it works for them. The call to longjmp is not the problem. Rather, it was the original workaround. Removing the longjmp will just make GTK call _exit upon an IO error, which we cannot avoid. (See for example the `_gdk_x11_display_error_event' function in the GTK source code.) Thanks.