Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lsp Hover causes desktop spaces to be switched to the previous one on MacOs Sequoia #4552

Closed
3 tasks done
ScriptMang opened this issue Sep 19, 2024 · 6 comments
Closed
3 tasks done
Labels

Comments

@ScriptMang
Copy link

ScriptMang commented Sep 19, 2024

Thank you for the bug report

  • I am using the latest version of lsp-mode related packages.
  • I checked FAQ and Troubleshooting sections
  • You may also try reproduce the issue using clean environment using the following command: M-x lsp-start-plain

Bug description

I'm getting an issue where the current virtual desktop space I have emacs in, keeps switching back to the previous one. In particular after every code completion from corfu when emacs is fullscreen. Or when lsp mode shows function definitions on hover in fullscreen. No error is produced in the message or warning buffer. However, if I set the app not to launch on a specific desktop, it doesn't happen. Currently I'm using emacs-plus@29(29.4) and elpaca as my pkg manager. The lsp mode I used was
gopls for go files.

Steps to reproduce

MacOs Sequoia must be installed
right click on emacs after launch and click on "set this desktop"
set emacs to fullscreen and open a programming file
activate lsp mode and hover over function

Expected behavior

My expectation is on hover lsp mode doesn't change desktop focus from fullscreen emacs.

Which Language Server did you use?

I used gopls

OS

MacOS

Error callstack

No response

Anything else?

No response

@ScriptMang ScriptMang added the bug label Sep 19, 2024
@certainty
Copy link

I experience the same. However I do not think it is LSP related. I use eglot. It is probably emacs itself and corfu . IIRC the corfu overlay is a frame. Maybe there are weird interactions with macOS window handling. Which emacs build are you using?

@ScriptMang
Copy link
Author

emacs plus 29.4-1

@ScriptMang
Copy link
Author

@david-krentzlin
Copy link

Thanks. So I did a bit of experimentation and at least for me, the switch happens only after I switch the frame to fullscreen. And it happens only once after that. So the experiment to try is.

  1. Open emacs (not in fullscreen)
  2. Try complete => it should not switch away
  3. Bring emacs to fullscreen
  4. Try complete => switch to different desktop
  5. Try complete again => no switch anymore

I have a hunch that corfu misplaces the childframe because for some reason it doesn't know the correct dimensions of the emacs frame. So it maybe places it to the left of a fullscreen window which makes the window manager of OSX switch to a different desktop.

Again, none of this is lsp-mode related in my mind, but I wanted to comment here for completeness.
I am still trying to find a solution myself (with hopefully not too much effort).

@david-krentzlin
Copy link

As a workaround instead of putting emacs into fullscreen you can put emacs into maximized state, which doesn't have this problem.

@ScriptMang
Copy link
Author

ScriptMang commented Dec 20, 2024

I managed to work around this by removing the application's assignment to a virtual desktop window. After that I no longer experience the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants