The main advantages are:
NOTE:
GNOME users with GTK3 builds need Emacs 27 or later. See variable `posframe-gtk-resize-child-frames' which auto-detects this configuration.
More details:
[[file:./snapshots/posframe-1.png]]
(require 'posframe)
** Create a posframe
*** Simple way
(when (posframe-workable-p) (posframe-show " my-posframe-buffer" :string "This is a test" :position (point)))
*** Advanced way
(defvar my-posframe-buffer " my-posframe-buffer")
(with-current-buffer (get-buffer-create my-posframe-buffer) (erase-buffer) (insert "Hello world"))
(when (posframe-workable-p) (posframe-show my-posframe-buffer :position (point)))
*** Arguments
C-h f posframe-show
** Hide a posframe
(posframe-hide " my-posframe-buffer")
** Hide all posframes
M-x posframe-hide-all
** Delete a posframe
(posframe-delete " my-posframe-buffer")
(posframe-delete-frame " my-posframe-buffer")
** Delete all posframes
M-x posframe-delete-all
Note: this command will delete all posframe buffers. You probably shouldn't use it if you are sharing a buffer between posframe and other packages.
** posframe-arghandler
posframe-arghandler feature has been removed from posframe-1.1, user can use advice feature instead.
** Mouse banish Default setting will work well in most case, but for EXWM user, suggest use the below config.
(setq posframe-mouse-banish-function #'posframe-mouse-banish-simple)