abo-abo / ace-window

Quickly switch windows in Emacs
965 stars 85 forks source link

other-window in terminal mode #225

Open basaran opened 2 years ago

basaran commented 2 years ago

Hello,

I ran into an issue where I have emacs running in server mode and I launch emacsclients in terminal mode.

When I try to ace-window from Terminal to GUI emacs, it works just fine. But when I try to switch from GUI emacs to terminal emacs, it doesn't work although the command goes through.

I made a video of the situation, and I also found out about x-send-client-message but I'm not sure where to add this to ace-window.

(defun raiseme ()
  (x-send-client-message
   nil                ; DISPLAY - nil is selected frame
   0                  ; DEST - 0 is root window of display
   nil                ; FROM - nil is selected frame
   "_NET_ACTIVE_WINDOW"    ; MESSAGE-TYPE - name of an Atom as a string
   32                 ; FORMAT  - size of the values in bits
   '(1 "_NET_WM_USER_TIME" 0) ; VALUES
   )
  )

ace-window.webm

abo-abo commented 1 year ago

Hi. I've tried to debug your example, and found nothing that works in a good way. Neither select-frame-set-input-focus, nor select-frame, nor x-focus-frame. Actually the built-in other-frame command also doesn't work. I think you should raise an Emacs bug about this. It should be fixed in the core.

The only thing I can think of to make it work is stuff like wmctrl, but I don't want to include that dependency in ace-window.