A fix to call switch-to-buffer/find-file within an exwm-floating-frame
zhenhua-wang opened this issue · 0 comments
zhenhua-wang commented
When switching-to-buffer/find-file
is invoked within an exwm-floating-frame
, it currently results in the new buffer opening underneath the floating window. To address this issue, I have added the following advice to refocus on the main frame before calling switching-to-buffer/find-file
. We might want to incorporate similar advice into the exwm package or redefine the behavior of switch-to-buffer for floating windows.
(defun zw/exwm-switch-to-buffer-advice (&rest args)
(when exwm--floating-frame
(select-frame-set-input-focus exwm-workspace--current)))
(advice-add 'find-file :before 'zw/exwm-switch-to-buffer-advice)
(advice-add 'switch-to-buffer :before 'zw/exwm-switch-to-buffer-advice)
(advice-add 'exwm-workspace-switch-to-buffer :before 'zw/exwm-switch-to-buffer-advice)