[1794] in testers

home help back first fref pref prev next nref lref last post

Emacs/twm positioning problems: patch

daemon@ATHENA.MIT.EDU (daemon@ATHENA.MIT.EDU)
Wed Aug 7 08:00:01 1991

From: ckclark@ATHENA.MIT.EDU
Date: Wed, 7 Aug 91 08:00:04 -0400
To: testers@ATHENA.MIT.EDU
Cc: kevles@ATHENA.MIT.EDU, belville@ATHENA.MIT.EDU, vanharen@ATHENA.MIT.EDU
Reply-To: ckclark@mit.edu

(In response to transactions [1710] and [1775] in the testers discuss
meeting.) 

Twm is one of those windowmanagers which demands clients to set their
window gravity.  X Toolkit Applications, like xterm, often choose a
different window gravity based upon the signs of the initial geometry
specification.  The following patch to emacs will allow windows to be
positioned in a reasonable fashion with negative x or y coordinates in
the geometry string.  It turns out that the Console window also has the
same problem (which is why I have forwarded this reply to you, Chris.)
The problem can be seen more easily if you set "BorderWidth" to a large
number, like 30, in your .twmrc.

*** /source/third/common/gnu/emacs/src/x11term.c	Mon Jul 15 16:09:04 1991
--- x11term.c	Wed Aug  7 07:41:04 1991
***************
*** 2521,2526 ****
--- 2521,2543 ----
      sizehints.width_inc = XXfontw;
      sizehints.height_inc = XXfonth;
      sizehints.flags |= PResizeInc;
+     if ((XValue&pr) || (YValue&pr)) {
+       sizehints.flags |= PWinGravity;
+       switch (pr & (XNegative | YNegative)) {
+       case 0:
+       sizehints.win_gravity = NorthWestGravity;
+       break;
+       case XNegative:
+       sizehints.win_gravity = NorthEastGravity;
+       break;
+       case YNegative:
+       sizehints.win_gravity = SouthWestGravity;
+       break;
+       default:
+       sizehints.win_gravity = SouthEastGravity;
+       break;
+       }
+     }
  
      XSetWMNormalHints(XXdisplay, w, &sizehints);
      XConfigureWindow(XXdisplay, w, change_mask, &changes);


home help back first fref pref prev next nref lref last post