emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/pgtk d2a29e8 040/100: emacsclient should use both of DISPLAY and


From: Yuuki Harano
Subject: feature/pgtk d2a29e8 040/100: emacsclient should use both of DISPLAY and WAYLAND_DISPLAY.
Date: Tue, 24 Nov 2020 08:02:33 -0500 (EST)

branch: feature/pgtk
commit d2a29e883e662a3f269628d5cbdf195c783ddf01
Author: Yuuki Harano <masm+github@masm11.me>
Commit: Jeff Walsh <jeff.walsh@drtusers-MacBook-Pro.local>

    emacsclient should use both of DISPLAY and WAYLAND_DISPLAY.
    
    * lisp/server.el (server-create-window-system-frame): error out when
    not on a supported window
    
    * lib-src/emacsclient.c (decode_options): handle WALAND_DISPLAY on PGTK
---
 lib-src/emacsclient.c |  5 +++++
 lisp/server.el        | 17 +++++++++++------
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index 871fa7a..a55e4bc 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -611,7 +611,12 @@ decode_options (int argc, char **argv)
       alt_display = "w32";
 #endif
 
+#ifdef HAVE_PGTK
+      display = egetenv ("WAYLAND_DISPLAY");
+      alt_display = egetenv ("DISPLAY");
+#else
       display = egetenv ("DISPLAY");
+#endif
     }
 
   if (!display)
diff --git a/lisp/server.el b/lisp/server.el
index 763f651..9559613 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -881,12 +881,17 @@ This handles splitting the command if it would be bigger 
than
       )
 
     (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)))
 
           (t
            (server-log "Window system unsupported" proc)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]