unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* set-frame-position problem(?)
@ 2008-01-12  0:22 Vinicius Jose Latorre
  2008-01-12  9:16 ` martin rudalics
  2008-01-12 12:19 ` Jan Djärv
  0 siblings, 2 replies; 4+ messages in thread
From: Vinicius Jose Latorre @ 2008-01-12  0:22 UTC (permalink / raw)
  To: GNU Emacs (devel)


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?

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-01-12 13:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-12  0:22 set-frame-position problem(?) Vinicius Jose Latorre
2008-01-12  9:16 ` martin rudalics
2008-01-12 13:12   ` Vinicius Jose Latorre
2008-01-12 12:19 ` Jan Djärv

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).