From: Po Lu Date: Fri, 11 Mar 2022 08:36:11 +0000 (+0800) Subject: Handle Wayland displays correctly in browse-url X-Git-Tag: emacs-29.0.90~1931^2~1201 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=61a038bec0fe34a81531b38ebf0a2cb5ece9b789;p=emacs.git Handle Wayland displays correctly in browse-url * lisp/net/browse-url.el (browse-url-process-environment): Use WAYLAND_DISPLAY as the display environment variable on PGTK. (bug#54333) --- diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 6d28e318fff..776f774172f 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -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 ()