[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[h-e-w] Patch to fix frame positioning bug on Windows with (make-frame '

From: Francis Litterio
Subject: [h-e-w] Patch to fix frame positioning bug on Windows with (make-frame '((left . -1)))
Date: Tue, 11 Jan 2005 15:30:13 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (windows-nt)

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 <at> 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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]