muffinmad/emacs-mini-frame

Display mini-frame at top of emacs' title bar?

Closed this issue · 2 comments

jsyjr commented

(I run emacs 28.0.50 built with --with-x-toolkit=gtk2.)

I would like to position the mini-frame over the OS
window manager's title bar. (OS is Ubuntu 20.10.)

With mini-frame-standalone nil everything works very
nicely except that mini-frame obliterates the first line
of any Emacs window touching the top of the managed
area.

Is this possible with the current package? If so, how?
If not, could it be added?

jsyjr commented

Solved it:


(use-package mini-frame
  :straight (:host github :repo "muffinmad/emacs-mini-frame" :files("mini-frame.el"))
  :custom
  (mini-frame-color-shift-step 0)
  (mini-frame-create-lazy nil)
  (mini-frame-internal-border-color "white")
  ;; Overlay "parent" frame's title bar, stretch from left to right edge
  (mini-frame-show-parameters (lambda ()
                                (let ((sf (selected-frame)))
                                  `((user-position . t)
                                    (fullscreen . nil)
                                    (left . ,(+ (frame-parameter sf 'left)
                                                (car (cdr (assq 'external-border-size (frame-geometry sf))))))
                                    (width . ,(frame-parameter sf 'width))
                                    (top   . ,(frame-parameter sf 'top))))))
  (mini-frame-standalone t)) ; Escape parent confines to allow above positioning

Solved it:

Cool! I was going to propose exactly the same solution: make the mini-frame standalone and set the left, top and width parameters same as the selected frame :)