From 08e5101045628f4452898854c54c4417fa499f4b Mon Sep 17 00:00:00 2001 From: TEC Date: Tue, 16 Apr 2024 11:20:12 +0800 Subject: [PATCH] Make the windows ID always a string With some Wayland DEs/compositors, the APP id isn't always a base 10 number, so let's just leave it as a string instead of parsing it then making it a string again. --- emacs-everywhere.el | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/emacs-everywhere.el b/emacs-everywhere.el index 0927d8a..39464f1 100644 --- a/emacs-everywhere.el +++ b/emacs-everywhere.el @@ -397,12 +397,11 @@ Never paste content when ABORT is non-nil." (cdr emacs-everywhere-copy-command)))))) (sleep-for emacs-everywhere-clipboard-sleep-delay) ; prevents weird multi-second pause, lets clipboard info propagate (when emacs-everywhere-window-focus-command - (let* ((window-id (emacs-everywhere-app-id emacs-everywhere-current-app)) - (window-id-str (if (numberp window-id) (number-to-string window-id) window-id))) + (let ((window-id (emacs-everywhere-app-id emacs-everywhere-current-app))) (apply #'call-process (car emacs-everywhere-window-focus-command) nil nil nil (mapcar (lambda (arg) - (replace-regexp-in-string "%w" window-id-str arg)) + (replace-regexp-in-string "%w" window-id arg)) (cdr emacs-everywhere-window-focus-command))) ;; The frame only has this parameter if this package initialized the temp ;; file its displaying. Otherwise, it was created by another program, likely @@ -465,7 +464,7 @@ Please go to 'System Preferences > Security & Privacy > Privacy > Accessibility' (`(wayland . KDE) (emacs-everywhere--app-info-linux-kde)) (_ (user-error "Unable to fetch app info with display server %S" emacs-everywhere--display-server))))) (make-emacs-everywhere-app - :id (string-to-number window-id) + :id window-id :class app-name :title window-title :geometry (list