]> git.eshelyaron.com Git - emacs.git/commitdiff
emacsclient should use both of DISPLAY and WAYLAND_DISPLAY.
authorYuuki Harano <masm+github@masm11.me>
Mon, 23 Mar 2020 15:33:57 +0000 (00:33 +0900)
committerJeff Walsh <jeff.walsh@drtusers-MacBook-Pro.local>
Tue, 24 Nov 2020 01:24:31 +0000 (12:24 +1100)
* 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
lisp/server.el

index 871fa7a8d3c285843f7f1856e19f91406e723b8a..a55e4bc705cdfc4575d748178bcf7dc0ff5dd7d7 100644 (file)
@@ -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)
index 763f651fefc219be36b9e551c105bc3e710a26a2..9559613a3637cc22fb133030ab3bb25f9e3d9ec5 100644 (file)
@@ -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)