Skip to content

Commit

Permalink
Make the windows ID always a string
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tecosaur committed Apr 16, 2024
1 parent 98de031 commit 08e5101
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions emacs-everywhere.el
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 08e5101

Please sign in to comment.