posframe icon indicating copy to clipboard operation
posframe copied to clipboard

Top inconsistent placement with respect to toolbar

Open goldfita opened this issue 3 years ago • 3 comments

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

goldfita avatar Aug 12 '22 13:08 goldfita

Sorry, I do not undersand this issue.

tumashu avatar Dec 12 '22 12:12 tumashu

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.

goldfita avatar Dec 12 '22 15:12 goldfita

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))
               )

tumashu avatar Dec 12 '22 18:12 tumashu