tumashu / posframe

Pop a posframe (just a child-frame) at point, posframe is a **GNU ELPA** package!
450 stars 58 forks source link

Top inconsistent placement with respect to toolbar #116

Open goldfita opened 2 years ago

goldfita commented 2 years ago

Dap is using top-center to place the ui-controls. This places the controls over the toolbar, which makes sense to me, as long as there aren't already buttons there. But if you remove the toolbar, the controls end up in the buffer. I moved it left in scratch, to make it obvious. Whether it should be in the buffer or over the toolbar, the behavior should probably be consistent. Maybe check the toolbar before placing??

https://github.com/emacs-lsp/dap-mode/blob/master/dap-ui.el

posframe-in-buffer

tumashu commented 1 year ago

Sorry, I do not undersand this issue.

goldfita commented 1 year ago

Maybe this is a dap-ui issue. Normally the ui-controls are placed over the Emacs toolbar. But when you remove the toolbar, it places the ui-controls inside the buffer, over the text, as you can see from the image.

 (posframe-show dap-ui--control-buffer
                           :string content
                           :poshandler #'posframe-poshandler-frame-top-center
                           :internal-border-width 8)

Really this is a limitation of Emacs. Most modern UIs have dockable windows, so you can make sure things stay where you put them.

tumashu commented 1 year ago
Normally the ui-controls are placed over the Emacs toolbar. But when you remove the toolbar, , it places the ui-controls inside the buffer

This seem to be expected behavior,

you can try refposhandler argument, but I don't think it is a good idea

(posframe-show "test"
               :string "hello world"
               :poshandler #'posframe-poshandler-frame-top-center
               :internal-border-width 8
               :refposhandler (lambda (frame) (cons 0 0))
               )