minad / mini-popup

24 stars 3 forks source link

Tried it in EXWM, noticed a few issues #2

Open daviwil opened 3 years ago

daviwil commented 3 years ago

Hey @minad! Here's a quick video capture of me trying mini-popup in EXWM. There are three things I noticed:

Thanks for giving this a shot!

https://user-images.githubusercontent.com/79405/119261195-2de89e80-bb8b-11eb-8fbd-3ed074b96b9a.mp4

minad commented 3 years ago
  1. Not sure what causes this. What I would try - take a look at the corfu/vertico-map and remove all the remappings or start from an empty keymap. It can be that the issue is a remapping which is interfering here. It could also be some interaction with evil-mode?
  2. The current implementation uses only one child frame which is reused all the time. We could certainly recreate the child frame every time, but this is a bit slower in the simple use cases.
  3. This may be related to some issues where Vertico is not immediately updating. I think a (run-at-time 0 nil #'vertico--exhibit) at the end of vertico--setup may be needed.

Note that mini-popup will not work well with EXWM in general since the X11 windows will be shown on top of the child frame windows. I think mini-popup is more a replacement for ivy-posframe and for this purpose it works well. For all the more complicated scenarios, mini-frame is the better bet. mini-frame can also show the Completions buffer in a child frame, so it does a lot more.

minad commented 3 years ago

Btw, @daviwil does it make sense to use a dedicated minibuffer frame in EXWM? If you add the following to the configuration, every frame is started without a minibuffer. And then the minibuffer pops up in a dedicated frame.

(mapc (lambda (p)
          (add-to-list 'initial-frame-alist p)
          (add-to-list 'default-frame-alist p))
        '((minibuffer . nil)
          (menu-bar-lines . 0)
          (tool-bar-lines . 0)
          (vertical-scroll-bars . nil)
          (horizontal-scroll-bars . nil)))

Is this too inconvenient? Since under the hood this is essentially what you get with mini-frame too on EXWM. I would like to understand a bit better what the best configuration for Vertico is for each scenario (such infos would be a good fit for the wiki).

  1. Plain old minibuffer - unfortunately bumps the windows, but works well in all scenarios
  2. No EXWM, floating window - use mini-popup (or mini-frame without special standalone configuration)
  3. EXWM, floating window - use mini-frame with special standalone configuration
  4. EXWM, floating window - use dedicated mini-frame (see above) and teach EXWM that it floats on top of everything
jwijenbergh commented 3 years ago

vertico-next and vertico-previous not working is definitely an evil-mode issue, I have the same problem. As a quick hack I just use the following:

(advice-add #'mini-popup--setup :after #'turn-off-evil-mode)
mclearc commented 3 years ago

Just FYI -- I had the same issues with vertico-next and vertico-previous not working properly with evil but declaring the states explicitly in which the commands are bound seems to work and resolve the issue. I have the following in my use-package declaration (note that this uses general.el):

  :general
  (:states '(normal insert emacs) :keymaps 'vertico-map
   "C-j"     #'vertico-next
   "C-k"    #'vertico-previous)