I'm not sure if there is a bug/problem with set-frame-position
or if I'm missing something.
Anyway, please, follow the steps below:
1. start Emacs: emacs -Q
2. define and evaluate the following function:
(defun my-frame-test ()
(let ((mpos (cdr (mouse-pixel-position)))
(left (frame-parameter nil 'left))
(top (frame-parameter nil 'top))
(frame (select-frame
(make-frame
'((title . ": TEST :")
(name . ": TEST :")
(width . 40)
(height . 10)
(user-size . t)
(user-position . t)
(menu-bar-lines . nil)
(tool-bar-lines . nil))))))
;; if tool-bar-mode and/or menu-bar-mode is on,
;; the frame is positioned higher than it should.
(set-frame-position
frame
(+ (or (car mpos) 0) left)
(+ (or (cdr mpos) 0) top))))
3. turn on tool-bar-mode and menu-bar-mode:
M-: (tool-bar-mode 1) RET
M-: (menu-bar-mode 1) RET
4. position the mouse around the middle of the current frame.
5. now execute the function: M-: (my-frame-test) RET
Notice that the new frame is positioned higher than the mouse position.
6. kill the created frame and turn off tool-bar-mode and menu-bar-mode:
M-: (tool-bar-mode 0) RET
M-: (menu-bar-mode 0) RET
7. again position the mouse around the middle of the current frame
and execute the function: M-: (my-frame-test) RET
Notice that now the new frame is positioned at mouse position.
Does anyone have this problem?
_______________________________________________
Emacs-devel mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/emacs-devel