[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
set-frame-position problem(?)
From: |
Vinicius Jose Latorre |
Subject: |
set-frame-position problem(?) |
Date: |
Fri, 11 Jan 2008 21:22:09 -0300 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.11) Gecko/20071128 SeaMonkey/1.1.7 |
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?
- set-frame-position problem(?),
Vinicius Jose Latorre <=