ch11ng / exwm

Emacs X Window Manager
2.86k stars 137 forks source link

When exwm-workspace-minibuffer-position is set to bottom, the minibuffer loses focus whenever an unfinished command occurs. #917

Closed zhenhua-wang closed 11 months ago

zhenhua-wang commented 11 months ago

When the variable exwm-workspace-minibuffer-position is set to 'bottom, the minibuffer loses focus and cannot retain focus whenever an unfinished command occurs. For instance, after using find-file, if you click somewhere outside the minibuffer, this issue will arise. Issue #199 suggests using c-] to address this temporarily, but it would be great if we could find a permanent solution to this problem.

199 might partially solve this problem, but it still happens when the variable exwm-workspace-minibuffer-position is set to 'bottom.

zhenhua-wang commented 10 months ago

For those who lost focus in minibuffer, here is a function to refocus

(defun zw/exwm-focus-minibuffer ()
  (interactive)
  (let ((id (frame-parameter exwm-workspace--minibuffer 'exwm-id)))
    (xcb:+request exwm--connection
        (make-instance 'xcb:SetInputFocus
                       :revert-to xcb:InputFocus:Parent
                       :focus id
                       :time xcb:Time:CurrentTime))
    (xcb:flush exwm--connection)))