Subject: Re: bug#63555: closed (Re: bug#63555: emacs 29 complains that it can't connect to the display)

From: Po Lu <[email-masked]>
Date: Mon, 22 May 2023 19:15:40 +0800

Robert Pluim <[email-masked]> writes:

>>>>>> On Mon, 22 May 2023 17:26:27 +0800, Po Lu <[email-masked]> said:
>
>     Po> The problem with this approach is that gtk_init_check initializes the
>     Po> window system upon success, so once pgtk_term_init is called in
>     Po> pgtkterm.c, the window system is set up a second time, leaving two
>     Po> display connections open...
>
> Is there anything stopping us from removing that call to gtk_init?

Yes, since the PGTK build is supposed to support multiple displays.

BTW, the other problem with calling `gtk_init_check' is that when it
returns FALSE, calling any other GTK function results in undefined
behavior.  Thus, if `gtk_init_check' is used at startup, opening a
display later becomes unsafe, even if a display connection is then
available.