all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Moore <gustav@morpheus.demon.co.uk>
Subject: Re: New frame position (FSF Emacs on Windows)
Date: Sat, 08 Feb 2003 18:43:21 +0000	[thread overview]
Message-ID: <u1fer4ty.fsf@morpheus.demon.co.uk> (raw)
In-Reply-To: m3of5n7nnp.fsf@defun.localdomain

Jesper Harder <harder@myrealbox.com> writes:

> Paul Moore <gustav@morpheus.demon.co.uk> 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.

Paul.
-- 
This signature intentionally left blank

  reply	other threads:[~2003-02-08 18:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-07 20:37 New frame position (FSF Emacs on Windows) Paul Moore
2003-02-07 21:25 ` Kai Großjohann
2003-02-08 17:42   ` Paul Moore
2003-02-07 22:04 ` Jesper Harder
2003-02-08 18:43   ` Paul Moore [this message]
2003-02-09  4:31     ` Jesper Harder
2003-02-09 11:52       ` Paul Moore
2003-02-08  2:30 ` Galen Boyer
2003-02-08 18:46   ` Paul Moore
2003-02-09  3:32     ` Galen Boyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=u1fer4ty.fsf@morpheus.demon.co.uk \
    --to=gustav@morpheus.demon.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.