From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Francis Litterio Newsgroups: gmane.emacs.windows,gmane.emacs.devel Subject: Patch to fix frame positioning bug on Windows with (make-frame '((left . -1))) Date: Tue, 11 Jan 2005 15:30:13 -0500 Message-ID: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1105478109 2884 80.91.229.6 (11 Jan 2005 21:15:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 11 Jan 2005 21:15:09 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: help-emacs-windows-bounces+gnu-help-emacs-windows=m.gmane.org@gnu.org Tue Jan 11 22:15:02 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 1CoTLy-0001De-00 for ; Tue, 11 Jan 2005 22:15:02 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CoTXX-00076p-8c for gnu-help-emacs-windows@m.gmane.org; Tue, 11 Jan 2005 16:26:59 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1CoTO2-0003GF-EG for help-emacs-windows@gnu.org; Tue, 11 Jan 2005 16:17:13 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1CoTNk-00036C-TC for help-emacs-windows@gnu.org; Tue, 11 Jan 2005 16:16:53 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CoTNk-00034n-AT for help-emacs-windows@gnu.org; Tue, 11 Jan 2005 16:16:52 -0500 Original-Received: from [80.91.229.2] (helo=main.gmane.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CoT8i-0003FA-5i for help-emacs-windows@gnu.org; Tue, 11 Jan 2005 16:01:20 -0500 Original-Received: from root by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1CoT8g-0005Pr-00 for ; Tue, 11 Jan 2005 22:01:18 +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 ; Tue, 11 Jan 2005 22:01:18 +0100 Original-Received: from franl by brick.estc.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 11 Jan 2005 22:01:18 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-emacs-windows@gnu.org Original-Lines: 45 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" "") Gcc: nnfolder:sent-usenet X-Random-Quote: The optimist proclaims that we live in the best of all possible worlds; and the pessimist fears this is true. -- James Branch Cabell (1879 - 1958), The Silver Stallion, 1926 User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (windows-nt) Cancel-Lock: sha1:WFzY9UPiUKgzhumjAAXy8UxiqQw= X-BeenThere: help-emacs-windows@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion forum for users of the GNU Emacs port to Windows List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-emacs-windows-bounces+gnu-help-emacs-windows=m.gmane.org@gnu.org Errors-To: help-emacs-windows-bounces+gnu-help-emacs-windows=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.windows:2508 gmane.emacs.devel:32133 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:32133 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))) Those 7 pixels encompass the border of the Windows frame and some of the right fringe. This may have been caused by revision 1.220 of w32term.c in which function x_calc_absolute_position() was changed: revision 1.220 date: 2004/12/11 21:12:45; author: jhd; state: Exp; lines: +0 -30 * w32term.c (x_calc_absolute_position): Remove calculation of difference between inner and outer window. Don't subtract difference for left and top calculations. 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. One risk I see in this solution is that the user can change the Active Window Border size to have any pixel width (right click on the desktop, choose Properties, choose Appeareance, click Advanced, choose Active Window Border from the Item listbox). This code (both with and without my patch) does not take the user-configurable size of the Active Window Border into account. I hope this helps. -- Francis Litterio franl world . std . com --- w32term.c 03 Jan 2005 17:52:51 -0500 1.221 +++ w32term.c 11 Jan 2005 15:27:02 -0500 @@ -5381,7 +5381,8 @@ if (flags & XNegative) f->left_pos = (FRAME_W32_DISPLAY_INFO (f)->width - FRAME_PIXEL_WIDTH (f) - + f->left_pos); + + f->left_pos + - 7); if (flags & YNegative) f->top_pos = (FRAME_W32_DISPLAY_INFO (f)->height