unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Francis Litterio <franl@world.std.com>
Cc: help-emacs-windows@gnu.org
Subject: Re: Patch to fix frame positioning bug on Windows with (make-frame '((left . -1)))
Date: Wed, 12 Jan 2005 15:45:49 -0500	[thread overview]
Message-ID: <uekgqjrb4.fsf@world.std.com> (raw)
In-Reply-To: 3ABA18C9-64D5-11D9-83C1-000D93505B76@swipnet.se

Jan D. wrote:

>> Using Emacs built from CVS source code on Windows XP, the frame created
>> using the following Emacs-Lisp code is positioned such that the
>> rightmost 7 pixels of the frame are off the right edge of the screen:
>>
>>   (make-frame '((width . 80) (height . 20) (top . 0) (left . -1)))
...
>> The below patch solves the problem but it may not be optimal because it
>> simply subtracts 7 from the computed value of f->left_pos.
>
> Can you verify if your change has any impact on this bug:
>
> http://lists.gnu.org/archive/html/emacs-pretest-bug/2004-11/msg00519.html
>
> This was the reason a change was made.  It may be impossible to get
> Emacs to work correctly on W32.  Just [subtracting] 7 is no good, as
> you self pointed out, a more general solution must be found.

My change breaks the fix for that bug, so I'm going to investigate
further.

In my testing, I noticed that (make-frame '((top . -1))) on Windows
suffers an even worse positioning error -- about 30 pixels at the bottom
of the frame fall off the bottom of the screen!

I would think that when a frame is positioned so that it is completely
visible, we have the following variables and relations:

  OUTER-LEFT: The number of pixels between the left screen edge
	      and the left border drawn by Windows of the frame.
	      This can be 0.

  LEFT-BORDER: The width of the left border drawn by Windows (in pixels).

  FRAME-CONTENT-WIDTH: The width of the frame content, including
		       the fringes but not including the left and
		       right borders drawn by Windows.

  RIGHT-BORDER: The width of the right border drawn by Windows (in
		pixels).

  OUTER-RIGHT: The number of pixels between the right screen edge
	       and the right border drawn by Windows of the frame.
	       This can be 0.

  DISPLAY-WIDTH: The width of the display (in pixels).

and finally this relation should hold:

  DISPLAY-WIDTH = OUTER-LEFT + LEFT-BORDER + FRAME-CONTENT-WIDTH +
		  RIGHT-BORDER + OUTER-RIGHT

A similar relation can be constructed for the vertical screen
dimension.

Given this model, we should be able to make w32term.c position frames
consistently, regardless of whether the 'top or 'left frame parameter
was positive or negative (modulo the issue with the user being able to
change the width of the border drawn by Windows -- but it should work
with Windows' default border sizes).
--
Francis Litterio
franl <at> world . std . com

  reply	other threads:[~2005-01-12 20:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-11 20:30 Patch to fix frame positioning bug on Windows with (make-frame '((left . -1))) Francis Litterio
2005-01-12 20:04 ` Jan D.
2005-01-12 20:45   ` Francis Litterio [this message]
2005-01-13  2:59     ` Francis Litterio
2005-01-13  3:37       ` Francis Litterio

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=uekgqjrb4.fsf@world.std.com \
    --to=franl@world.std.com \
    --cc=help-emacs-windows@gnu.org \
    /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 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).