emacs-lsp / lsp-ui

UI integrations for lsp-mode
https://emacs-lsp.github.io/lsp-ui
GNU General Public License v3.0
1.03k stars 141 forks source link

Fix lsp-ui-doc-glance not auto-hide after focus out from doc frame #727

Open kiennq opened 1 year ago

kiennq commented 1 year ago

Fix #726 I've reverted part of #711 and done other fixes to get it working again with both lsp-ui-doc-show and lsp-ui-doc-glance sharing a similar implementation.

@Lenbok

Lenbok commented 1 year ago

This does not work for me, the window hides as soon as I attempt to set focus into the window.

kiennq commented 1 year ago

This does not work for me, the window hides as soon as I attempt to set focus into the window.

Are you doing that in overlay instead of doc frame? AFAIK, the overlay doesn't support focus. For doc frame, you have to move your mouse out of where the doc frame is going to show up else the frame will be dismissed immediately (a limitation of child frame, same reason why posframe has to banish mouse to the top-left corner when its child frame is shown up).

Lenbok commented 1 year ago

While I normally use overlay, I am testing with child frame. The position of the mouse makes no difference to me, this still does not work.

kiennq commented 1 year ago

While I normally use overlay, I am testing with child frame. The position of the mouse makes no difference to me, this still does not work.

Can you take some screencast? I'm using both Ubuntu/Windows and this change is working fine.

Also, how do you focus on the doc frame? Via keyboard or mouse? Using mouse is not working if you're invoking the doc frame via keyboard, as mouse move will dismiss the doc frame immediately. After you're focusing on the doc frame, you can use the mouse to scroll though.