]> git.eshelyaron.com Git - emacs.git/commitdiff
Handle Wayland displays correctly in browse-url
authorPo Lu <luangruo@yahoo.com>
Fri, 11 Mar 2022 08:36:11 +0000 (16:36 +0800)
committerPo Lu <luangruo@yahoo.com>
Fri, 11 Mar 2022 08:36:11 +0000 (16:36 +0800)
* lisp/net/browse-url.el (browse-url-process-environment): Use
WAYLAND_DISPLAY as the display environment variable on
PGTK.  (bug#54333)

lisp/net/browse-url.el

index 6d28e318fff763efb3045f874a873699510483b6..776f774172f2f786b0cdf5e404ad1610a6d1b25e 100644 (file)
@@ -970,7 +970,13 @@ non-nil, or the same display as Emacs if different from the current
 environment, otherwise just use the current environment."
   (let ((display (or browse-url-browser-display (browse-url-emacs-display))))
     (if display
-       (cons (concat "DISPLAY=" display) process-environment)
+       (cons (concat (if (and (eq window-system 'pgtk)
+                               (equal (pgtk-backend-display-class)
+                                      "GdkWaylandDisplay"))
+                          "WAYLAND_DISPLAY="
+                        "DISPLAY=")
+                      display)
+              process-environment)
       process-environment)))
 
 (defun browse-url-emacs-display ()