unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Yuuki Harano <masm+emacs@masm11.me>
To: eliz@gnu.org
Cc: emacs-devel@gnu.org
Subject: Re: Merging the pgtk branch
Date: Tue, 03 Aug 2021 21:52:45 +0900 (JST)	[thread overview]
Message-ID: <20210803.215245.224350998069594262.masm@luna.pink.masm11.me> (raw)
In-Reply-To: <83mtq0m5gu.fsf@gnu.org>


On Mon, 02 Aug 2021 14:49:37 +0300,
	Eli Zaretskii <eliz@gnu.org> wrote:
>> >> -install: all install-arch-indep install-etcdoc install-arch-dep install-$(NTDIR) blessmail install-eln
>> >> +install: all install-arch-indep install-etcdoc install-arch-dep install-$(NTDIR) blessmail install-eln install-gsettings-schemas
>> >>  	@true
>> > 
>> > Does this mean gsettings-schemas will be installed by non-PGTK builds
>> > as well?  If not, where are the conditions to prevent that?
>> 
>> Yes, it is installed if gsettings is enabled, even if non-PGTK builds.
> 
> Is that useful without the PGTK build?  What is that used for?

No, it is not useful for non-PGTK build.

X build supports X defaults.  But GTK doesn't support it.
Instead, I implemented this hook with gsettings:
  terminal->get_string_resource_hook = pgtk_get_string_resource;

gsettings supports type. Type of each key is written in the schema file
etc/org.gnu.emacs.defaults.gschema.xml.
(I implemented this feature instead of X defaults, so types of all the key
are string.)

However, I'm not sure whether people want Xdefaults-like feature.
Emacs' frame parameters are enough...


>> >> --- a/lisp/server.el
>> >> +++ b/lisp/server.el
>> >> @@ -900,12 +900,17 @@ server-create-window-system-frame
>> >>        )
>> >  
>> >>      (cond (w
>> >> -           (server--create-frame
>> >> -            nowait proc
>> >> -            `((display . ,display)
>> >> -              ,@(if parent-id
>> >> -                    `((parent-id . ,(string-to-number parent-id))))
>> >> -              ,@parameters)))
>> >> +           (condition-case nil
>> >> +               (server--create-frame
>> >> +                nowait proc
>> >> +                `((display . ,display)
>> >> +                  ,@(if parent-id
>> >> +                        `((parent-id . ,(string-to-number parent-id))))
>> >> +                  ,@parameters))
>> >> +             (error
>> >> +              (server-log "Window system unsupported" proc)
>> >> +              (server-send-string proc "-window-system-unsupported \n")
>> >> +              nil)))
>> > 
>> > Why is this change needed?
>> 
>> emacsclient tries WAYLAND_DISPLAY, and DISPLAY if the first try is failed.
>> The code catches the display connection failure, and returns the failure
>> to emacsclient.
> 
> Hmm... what about window-systems that have neither WAYLAND_DISPLAY nor
> DISPLAY? will this always fail?  I feel that I'm missing something
> here: why wasn't this needed before?

Sorry, I mistook.

GTK supports GDK_BACKEND environment variable.

If GDK_BACKEND=wayland, GTK tries only wayland connection.
If GDK_BACKEND=x11, GTK tries only X connection.
If GDK_BACKEND=wayland,x11, GTK tries wayland connection, and X
connection if the first try failed.

If GDK_BACKEND=x11 and DISPLAY is not set, then emacs fails to start.
----
luna:objs % unset DISPLAY
luna:objs % GDK_BACKEND=x11 ./src/emacs      

(emacs:322982): Gtk-WARNING **: 00:31:26.986: cannot open display: 
luna:objs % 
----

If GDK_BACKEND=x11 and DISPLAY=:0, then emacs starts.
However, `emacsclient -c` first tries with WAYLAND_DISPLAY and
it fails, because GDK_BACKEND=x11 and emacs itself does not open
wayland connection.

The error is:
----
-error Cannot&_connect&_to&_display&_server&_wayland&-1
----
(In case of WAYLAND_DISPLAY=wayland-1.)

And emacsclient does not retry.

I wanted to work around this error.
I send -window-system-unsupported by that change.
In this case, emacsclient retry with alt_display, which is
DISPLAY by another change.

> what about window-systems that have neither WAYLAND_DISPLAY nor
> DISPLAY? will this always fail?

emacsclient.c:
----
#if defined (NS_IMPL_COCOA)
      alt_display = "ns";
#elif defined (HAVE_NTGUI)
      alt_display = "w32";
#endif
----
  if (!display)
    {
      display = alt_display;
      alt_display = NULL;
    }
----

On ns and w32, display is set.

To make sure whether that change works on ns and w32,
it is needed to test on such machines.
I didn't test on such machines.

-- 
Yuuki Harano



  reply	other threads:[~2021-08-03 12:52 UTC|newest]

Thread overview: 85+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-01  8:53 Merging the pgtk branch Eli Zaretskii
2021-08-01 16:38 ` Yuuki Harano
2021-08-01 16:57   ` Stefan Monnier
2021-08-02 14:17     ` Yuuki Harano
2021-08-02 11:49   ` Eli Zaretskii
2021-08-03 12:52     ` Yuuki Harano [this message]
2021-08-03 13:37       ` Stefan Monnier
2021-08-04 13:43         ` Yuuki Harano
2021-11-14 12:20   ` Yuuki Harano
2021-11-14 13:27     ` Eli Zaretskii
2021-11-14 14:55       ` Yuuki Harano
2021-08-04 12:53 ` Font size (was: Merging the pgtk branch) Kévin Le Gouguec
2021-08-04 13:45   ` Eli Zaretskii
2021-08-04 13:58     ` Font size Kévin Le Gouguec
2021-08-04 15:46       ` Yuri Khan
2021-08-04 16:11         ` Eli Zaretskii
2021-08-04 17:09           ` Yuri Khan
2021-08-04 18:23             ` Eli Zaretskii
2021-08-04 18:33               ` Yuri Khan
2021-08-05 14:51                 ` Robert Pluim
2021-08-05 16:19                   ` Eli Zaretskii
2021-08-04 13:55   ` Font size (was: Merging the pgtk branch) Eli Zaretskii
2021-08-04 14:15     ` Font size Kévin Le Gouguec
2021-08-10 15:15 ` Merging the pgtk branch Yuuki Harano
2021-08-10 16:19   ` Eli Zaretskii
2021-11-29 15:41   ` Yuuki Harano
2021-12-02  3:45     ` Po Lu
2021-12-02  9:47       ` Robert Pluim
2021-12-02  9:50         ` Po Lu
2021-12-02 10:06           ` Robert Pluim
2021-12-02 10:12             ` Po Lu
2021-12-02 10:04         ` Po Lu
2021-12-02 11:34           ` Robert Pluim
2021-12-05 14:08     ` Eli Zaretskii
2021-12-05 16:01       ` Yuuki Harano
2021-12-05 16:06         ` Eli Zaretskii
2021-12-06  0:56           ` Po Lu
2021-12-06  4:41             ` Po Lu
2021-12-06 13:12               ` Yuuki Harano
2021-12-06 13:24                 ` Po Lu
2021-12-06 16:01                   ` Yuuki Harano
2021-12-09  5:01                     ` Po Lu
2021-12-18  7:58                       ` Po Lu
2021-12-18 12:52                         ` Yuuki Harano
2021-12-18 12:53                           ` Eli Zaretskii
2021-12-18 12:56                             ` Po Lu
2021-12-18 13:00                               ` Eli Zaretskii
2021-12-18 13:02                                 ` Po Lu
2021-12-18 12:54                           ` Po Lu
2021-12-18 12:58                             ` Eli Zaretskii
2021-12-18 13:01                               ` Po Lu
2021-12-18 13:24                                 ` Po Lu
2021-12-18 13:26                                   ` Po Lu
2021-12-18 13:37                                     ` Lars Ingebrigtsen
2021-12-18 13:39                                       ` Po Lu via Emacs development discussions.
2021-12-18 14:18                                         ` Eli Zaretskii
2021-12-18 13:45                                       ` Lars Ingebrigtsen
2021-12-18 13:40                                     ` Eli Zaretskii
2021-12-18 13:56                                     ` Yuuki Harano
2021-12-18 14:15                                       ` Bozhidar Batsov
2021-12-18 14:21                                         ` Eli Zaretskii
2021-12-18 15:12                                           ` Bozhidar Batsov
2021-12-18 15:37                                             ` Philip Kaludercic
2021-12-18 15:48                                             ` Eli Zaretskii
2021-12-18 15:56                                               ` Ken Brown
2021-12-18 16:05                                               ` Stefan Kangas
2021-12-18 16:10                                                 ` Eli Zaretskii
2021-12-19  0:30                                                 ` Po Lu
2021-12-19  0:28                                               ` Po Lu
2021-12-18 16:15                                       ` Eli Zaretskii
2021-12-19  0:32                                         ` Po Lu
2021-12-19  9:39                                           ` Bozhidar Batsov
2021-12-18 14:15                                     ` Eli Zaretskii
2021-12-18 19:10                                     ` Stefan Monnier
2021-12-18 21:50                                     ` Sean Whitton
2021-12-18 23:15                                     ` David Koppelman
2021-12-18 13:26                                 ` Eli Zaretskii
2021-12-18 13:29                                   ` Po Lu
2021-12-18 13:32                                     ` Eli Zaretskii
2021-12-18 13:33                                       ` Po Lu
2021-12-18 19:08                                         ` Stefan Monnier
2021-09-01 15:06 ` Transitory GUI connections (was Re: Merging the pgtk branch) Alex Bennée
2021-09-02  6:22   ` Po Lu
2021-09-17 15:09   ` Robert Pluim
  -- strict thread matches above, loose matches on Subject: below --
2021-12-05 19:14 Merging the pgtk branch Vitaly Ankh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210803.215245.224350998069594262.masm@luna.pink.masm11.me \
    --to=masm+emacs@masm11.me \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).