From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Fran Litterio" Newsgroups: gmane.emacs.devel Subject: Re: Patch to fix frame positioning with negative top/left values onWindows Date: Sat, 1 Apr 2006 11:22:09 -0500 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1143908552 365 80.91.229.2 (1 Apr 2006 16:22:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 1 Apr 2006 16:22:32 +0000 (UTC) Cc: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Apr 01 18:22:30 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FPirt-0005TH-MT for ged-emacs-devel@m.gmane.org; Sat, 01 Apr 2006 18:22:30 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FPirt-0001kD-1f for ged-emacs-devel@m.gmane.org; Sat, 01 Apr 2006 11:22:29 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FPird-0001hu-Re for emacs-devel@gnu.org; Sat, 01 Apr 2006 11:22:13 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FPirb-0001gc-UX for emacs-devel@gnu.org; Sat, 01 Apr 2006 11:22:13 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FPirb-0001gW-L7 for emacs-devel@gnu.org; Sat, 01 Apr 2006 11:22:11 -0500 Original-Received: from [64.233.182.184] (helo=nproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FPiuF-00020T-P8 for emacs-devel@gnu.org; Sat, 01 Apr 2006 11:24:56 -0500 Original-Received: by nproxy.gmail.com with SMTP id l36so349567nfa for ; Sat, 01 Apr 2006 08:22:10 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=HLeDORf50j3i0IM/kRwsa/ONNeXq8oMfePVUGA9Sq1B5f1TYO+CakxW06agGECjzBACZfe/1YcEqdwqCZVPRwzGhLCk4ccuimi2YYqljI9cWfVVCUyLJC0Dyn3adApBhBBkdWF5vM4l+ksIe3VcvqbsD73AWGcgjB5J/j3EwXjI= Original-Received: by 10.49.40.5 with SMTP id s5mr856225nfj; Sat, 01 Apr 2006 08:22:09 -0800 (PST) Original-Received: by 10.49.23.5 with HTTP; Sat, 1 Apr 2006 08:22:09 -0800 (PST) Original-To: emacs-devel@gnu.org In-Reply-To: Content-Disposition: inline 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: news.gmane.org gmane.emacs.devel:52294 Archived-At: I just checked the CVS archive, and my patch has not been applied.=20 I've been running with it for well over a year with no negative side-effects. I would like to see it applied. -- Fran Litterio On 4/1/06, Drew Adams wrote: > I've been using a 2005-06-26 CVS snapshot on Windows that had this bug. I > thought that this had been fixed since that snapshot. I just tried a > 2006-03-20 snapshot on Windows, however, and the same bug is still there. > > Did Fran's patch never get applied, or doesn't it work? His patch dates f= rom > January of 2005 - soon to be a year and a half! The bug symptoms are the > same as before. See thread "Improved patch to fix frame positioning bug o= n > Windows" from 2005-01-14. > > -----Original Message----- > From: emacs-devel-bounces+drew.adams=3Doracle.com@gnu.org > [mailto:emacs-devel-bounces+drew.adams=3Doracle.com@gnu.org]On Behalf= Of > Francis Litterio > Sent: Thursday, July 07, 2005 9:24 AM > To: emacs-devel@gnu.org > Cc: help-emacs-windows@gnu.org > Subject: Patch to fix frame positioning with negative top/left values > onWindows > > Emacs developers, > > This patch to the CVS Emacs sources fixes the way that function > x_calc_absolute_position() accounts for the Windows-drawn borders aro= und > a frame when converting a negative 'top or 'left parameter into the > equivalent positive value. > > I have submitted this patch before, but RMS told me that the FSF need= ed > a copyright assignment from me before it could applied. The FSF now = has > mysigned the copyright assignment, so please let me know if there's a= ny > problem with this patch. I've been running Emacs with it for some > months with no problems. > -- > Francis Litterio > franl world . std . com > > > diff -w -u -u -w -r1.228 w32term.c > --- w32term.c 4 Jul 2005 16:06:37 -0000 1.228 > +++ w32term.c 7 Jul 2005 16:19:39 -0000 > @@ -5438,17 +5438,58 @@ > { > int flags =3D f->size_hint_flags; > > - /* Treat negative positions as relative to the leftmost bottommost > + /* left_right_borders_width holds the sum of the widths of > the frame's left > + and right borders (in pixels) drawn by Windows. */ > + > + unsigned int left_right_borders_width =3D 8; /* A sensible > default value. */ > + > + /* top_bottom_borders_height holds the sum of the heights of > the frame's top and > + bottom borders (in pixels) drawn by Windows. */ > + > + unsigned int top_bottom_borders_height =3D 32; /* A sensible > default value. */ > + > + /* Now obtain the actual values of the above two variables. > If we fail to > + obtain the actual values, we will use the defaults > assigned above. We compute > + the border width (height) by subtracting the width > (height) of the frame's > + client area from the width (height) of the frame's entire windo= w. > + */ > + > + WINDOWPLACEMENT wp =3D { 0 }; > + > + BOOL status =3D GetWindowPlacement (FRAME_W32_WINDOW (f), &wp); > + > + if (status !=3D FALSE) > + { > + RECT client_rect =3D { 0 }; > + > + status =3D GetClientRect (FRAME_W32_WINDOW (f), &client_rect); > + > + if (status !=3D FALSE) > + { > + left_right_borders_width =3D > + (wp.rcNormalPosition.right - wp.rcNormalPosition.left) - > + (client_rect.right - client_rect.left); > + > + top_bottom_borders_height =3D > + (wp.rcNormalPosition.bottom - wp.rcNormalPosition.top) - > + (client_rect.bottom - client_rect.top); > + } > + } > + > + /* Treat negative positions as relative to the rightmost bottommos= t > position that fits on the screen. */ > if (flags & XNegative) > f->left_pos =3D (FRAME_W32_DISPLAY_INFO (f)->width > - FRAME_PIXEL_WIDTH (f) > - + f->left_pos); > + + f->left_pos > + - (left_right_borders_width - 1)); > > if (flags & YNegative) > f->top_pos =3D (FRAME_W32_DISPLAY_INFO (f)->height > - FRAME_PIXEL_HEIGHT (f) > - + f->top_pos); > + + f->top_pos > + - (top_bottom_borders_height - 1)); > + > /* The left_pos and top_pos > are now relative to the top and left screen edges, > so the flags should correspond. */ > > > > _______________________________________________ > Emacs-devel mailing list > Emacs-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-devel > >