[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: New frame position (FSF Emacs on Windows)

From: Paul Moore
Subject: Re: New frame position (FSF Emacs on Windows)
Date: Sat, 08 Feb 2003 18:43:21 +0000
User-agent: Gnus/5.090013 (Oort Gnus v0.13) XEmacs/21.5 (burdock, i586-pc-win32) Hamster/

Jesper Harder <> writes:

> Paul Moore <> writes:
>> I currently use XEmacs 21.5.10 on Windows (2000 and XP), mainly for
>> news/mail via Gnus and occasionally for general editing tasks.
>> Anyway, one annoying feature in FSF Emacs is that when I open a new
>> frame (for example, with C-X 5 f) it appears in *exactly* the same
>> position on screen as the current frame. It therefore looks like I
>> didn't open a new frame!
> This doesn't help you, but on X this usually something you adjust in you
> window manager.  For me a new frame is placed slightly offset from the
> previous one by default.  There's also a plethora of other placement
> algorithms I could select.

Yes, I have seen this in X. As usual in Windows, there aren't any
options - you get what Bill things is best for you. Unfortunately, in
this instance, I actually like the Windows behaviour :-)

>> How can I get the frame creation behaviour I want from FSF Emacs?
> I'm not sure exactly which algorithm you want.  But this should give you
> an idea: It places a new frame offset by 15 pixels from the previous:
> (defun my-frame-position ()
>   (let ((left (or (cdr (assq 'left default-frame-alist)) 0))
>       (top (or (cdr (assq 'top default-frame-alist)) 0)))
>     (setq default-frame-alist 
>         (cons (cons 'left (+ left 15))
>               (assq-delete-all 'left default-frame-alist))
>         default-frame-alist
>         (cons (cons 'top (+ top 15))
>               (assq-delete-all 'top default-frame-alist)))))
> (add-to-list 'default-frame-alist '(user-position . t))
> (add-hook 'before-make-frame-hook 'my-frame-position)

Phew. That's not something I'd have worked out for myself! It's a good
start, but there's a bit more to the "Windows behaviour" - if the
calculated position is "too far" (off the screen, or overlapping the
taskbar) the window is put back up at the top left. Also, rather than
a fixed 15 pixels (or whatever) the Windows behaviour is to go down by
the width of the title bar (user configurable) and right by the size
of the "system menu" icon. So you need to do a lot of digging in
system parameters to get the right values.

Most of this is nit-picking, and in practice, a fixed amount is
perfectly OK. It's just that I like my applications to "look native"
(Windows-like on Windows, KDE-style on KDE, Gnome compatible on Gnome,
etc etc) and anything that doesn't "fit" gives me a mildly
uncomfortable feeling. (It's the same reason I don't like Tk
applications, or Cygwin).

We're well into religious war territory now, though, so I'll shut
up :-) Thanks for the code, which is fine for what I need.

This signature intentionally left blank

reply via email to

[Prev in Thread] Current Thread [Next in Thread]