From 61a038bec0fe34a81531b38ebf0a2cb5ece9b789 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Fri, 11 Mar 2022 16:36:11 +0800 Subject: [PATCH] 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) --- lisp/net/browse-url.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 () -- 2.39.2