From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Francis Litterio Newsgroups: gmane.emacs.devel,gmane.emacs.windows Subject: Re: Patch to fix frame positioning bug on Windows with (make-frame '((left . -1))) Date: Wed, 12 Jan 2005 15:45:49 -0500 Message-ID: References: <3ABA18C9-64D5-11D9-83C1-000D93505B76@swipnet.se> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1105564629 17740 80.91.229.6 (12 Jan 2005 21:17:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 12 Jan 2005 21:17:09 +0000 (UTC) Cc: help-emacs-windows@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 12 22:17:03 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CoprT-0005wL-00 for ; Wed, 12 Jan 2005 22:17:03 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Coq35-0003J1-HS for ged-emacs-devel@m.gmane.org; Wed, 12 Jan 2005 16:29:03 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Copy4-0001dN-O9 for emacs-devel@gnu.org; Wed, 12 Jan 2005 16:23:54 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Copxp-0001VV-3i for emacs-devel@gnu.org; Wed, 12 Jan 2005 16:23:43 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Copxn-0001Pg-55 for emacs-devel@gnu.org; Wed, 12 Jan 2005 16:23:35 -0500 Original-Received: from [80.91.229.2] (helo=main.gmane.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Copbf-0000qJ-Iv for emacs-devel@gnu.org; Wed, 12 Jan 2005 16:00:43 -0500 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1Copbe-0002Ld-00 for ; Wed, 12 Jan 2005 22:00:42 +0100 Original-Received: from brick.estc.com ([209.27.151.2]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 12 Jan 2005 22:00:42 +0100 Original-Received: from franl by brick.estc.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 12 Jan 2005 22:00:42 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 64 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: brick.estc.com X-Draft-From: ("nntp+news.gmane.org:gmane.emacs.devel" 32169) Gcc: nnfolder:sent-usenet X-Random-Quote: Reality is merely an illusion, albeit a very persistent one. -- Albert Einstein User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (windows-nt) Cancel-Lock: sha1:VnaZfkmyvtAOyvUBbFYnfmdkzOI= X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:32172 gmane.emacs.windows:2510 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:32172 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 world . std . com