Closed kiennq closed 3 years ago
@sebastiencs
Thanks @kiennq, I think removing this line fixes your issue: https://github.com/emacs-lsp/lsp-ui/blob/7873160d3ad33081bf6dc25a68430e83133d880e/lsp-ui-doc.el#L804
I don't remember why I added it and it seems that removing it doesn't cause undesired behavior.
It's a simpler solution that modifying the parameter cursor-type
as you propose.
Can you confirm ?
Well, remove the frame parameter at that time also fine. But when you focus the doc frame by mouse, the cursor will show up, having the cursor-type there will help hiding that. Why using keyboard to navigate doc frame need cursor, using mouse doesn't require that (rather should not display text cursor in that case).
You are right, modifying the frame parameter gives us more control. I will merge the PR.
Can you just reset the variable (not frame parameter) cursor-type
to nil
in lsp-ui-doc-unfocus-frame
.
As a side note, it should not be necessary anymore to click with the mouse on the frame to be able to scroll it. Just moving the mouse pointer over the frame, and using the mouse wheel will scroll the documentation. (Without any click). Can you observe the same behavior ? It depends on the windows manager and I didn't get any feedback about that change
Can you just reset the variable (not frame parameter)
cursor-type
tonil
inlsp-ui-doc-unfocus-frame
.
While it requires both local variable cursor-type
and frame parameter cursor-type
to showing the cursor, just setting frame parameter one to nil
only will hide it.
That's why the cursor is not showing up in the old code.
I think we can just stop assigning local cursor-type
, to save a few CPU cycles. But that can be done later.
For now I reset the variable as you suggested.
As a side note, it should not be necessary anymore to click with the mouse on the frame to be able to scroll it. Just moving the mouse pointer over the frame, and using the mouse wheel will scroll the documentation. (Without any click). Can you observe the same behavior ? It depends on the windows manager and I didn't get any feedback about that change
No, I didn't observer that behavior. I'm on Windows though.
Another thing is that the lsp-ui-doc--no-focus
is reset only when lsp-ui-doc--from-mouse
, is that okay?
Does that affect the case where I focus on doc frame once and unfocus it (by keyboard), then later whenever doc frame show up, mouse will be captured inside it?
I think we can just stop assigning local cursor-type, to save a few CPU cycles. But that can be done later.
Agreed, if setting the frame parameter is enough there is no need to set the variable.
No, I didn't observer that behavior. I'm on Windows though.
Ah, windows is a bit particular I guess
Another thing is that the lsp-ui-doc--no-focus is reset only when lsp-ui-doc--from-mouse, is that okay?
mmh I don't think it's intended. It shouldn't depend on lsp-ui-doc--from-mouse
.
Can you change that as well ?
Can you change that as well ?
Done
@kiennq I just test your branch and I still see the cursor after lsp-ui-doc-unfocus-frame
, or just by scrolling with the mouse wheel.
Looks like the variable cursor-type
is still necessary
@sebastiencs Can you check it with latest one? The cursor-type
is not set to t
in doc frame anymore
Thanks @kiennq, it's working now
Fix issue mentioned in https://github.com/emacs-lsp/lsp-ui/issues/414#issuecomment-691512719