[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: New frame position (FSF Emacs on Windows)
From: |
Jesper Harder |
Subject: |
Re: New frame position (FSF Emacs on Windows) |
Date: |
Sun, 09 Feb 2003 05:31:42 +0100 |
User-agent: |
Gnus/5.090015 (Oort Gnus v0.15) Emacs/21.3.50 |
Paul Moore <gustav@morpheus.demon.co.uk> writes:
> Jesper Harder <harder@myrealbox.com> writes:
>
>> This doesn't help you, but on X this usually something you adjust in you
>> window manager.
>
> 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 :-)
I think Emacs ought to follow the standard behaviour on ms-windows.
Submit a bug report :-)
> 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.
OK, here's an improved version:
(require 'assoc)
(defvar my-frame-position-x-offset 20)
(defvar my-frame-position-y-offset 20)
(defvar my-frame-position-taskbar-height 30)
(defun my-frame-position ()
(let ((left (+ my-frame-position-x-offset
(or (frame-parameter nil 'left) 0)))
(top (+ my-frame-position-y-offset
(or (frame-parameter nil 'top) 0))))
(when (or (> (+ (frame-pixel-width) left)
(display-pixel-width))
(> (+ (frame-pixel-height) top
my-frame-position-taskbar-height)
(display-pixel-height)))
(setq left 0 top 0))
(aput 'default-frame-alist 'left left)
(aput 'default-frame-alist 'top top)))
(aput 'default-frame-alist 'user-position t)
(add-hook 'before-make-frame-hook 'my-frame-position)