tumashu / ivy-posframe

ivy-posframe is a ivy extension, which let ivy use posframe to show its candidate menu, ivy-posframe is a **GNU ELPA** package.
413 stars 26 forks source link

ivy-posframe creates an empty posframe in first emacsclient frame when ivy-posframe is called from a second emacsclient frame #119

Open digikar99 opened 2 years ago

digikar99 commented 2 years ago

So:

  1. I start emacs daemon.
  2. I start one emacsclient frame.
  3. (EDIT: Additional step) I call ivy-posframe through counsel-M-x or counsel-imenu-or-semantic in it, and exit the posframe through C-g (keyboard-quit).
  4. I start another emacsclient frame.
  5. I call counsel-M-x or counsel-imenu-or-semantic in the second frame.
  6. I get the appropriate posframe in the second frame.
  7. But, I also get an empty posframe in the first frame.

And the last one can be annoying depending on what else I'm doing.

Also, using ivy-posframe in the first emacsclient frame does not create such an empty posframe in the second or later emacsclient frames. And ivy-posframe from second emacsclient frame affects only the first but not the later created emacsclient frames.*

I have the following as the value of ivy-posframe-display-functions-alist:

  (setq ivy-posframe-display-functions-alist
        '((t . ivy-posframe-display-at-frame-top-center)))

posframe version: 20220110.422 ivy-posframe version: 20211217.234

emacs-version: GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30, cairo version 1.15.10) of 2020-09-19


*It seems I might have discovered a temporary workaround while trying to specify the issue. The "target" of the empty posframe is the emacsclient frame in which ivy-posframe was called for the first time after all the emacsclient frames were closed. So, if I keep the first emacsclient frame as a "spare frame" on a separate unused workspace, it won't get in my way.

mmahmoudian commented 6 months ago

I have faced similar issue. For me the "ghost" posframe does not get created but when I follow the steps above. The issue I faced is:

  1. run emacs daemon
  2. create a new frame of emacsclient (Frame1)
  3. create second frame of emacsclient (Frame2)
  4. in one of them (e.g Frame1) try counsel-M-x
  5. without closing or choosing any item, switch to the other frame (e.g Alt-tab)
  6. try counsel-M-x and now try to move around in the list

What you observe is that the posframe in the "inactive" frame will stay active and you can move in the items of that posframe although that is not the "currrent frame".

If you tried this and it didn't happen, try running counsel-M-x and without closing swicth to the other frame and run counsel-M-x, and repeat it few more times.