Subject: Notification: incoming/447

From: [email-masked]
Date: Mon, 30 Aug 1999 11:13:21 -0500 (CDT)

FVWM Bug Tracking notification

new message incoming/447

Message summary for PR#447
	From: [email-masked]
	Subject: Unable to position window from inside GNU Emacs
	Date: Mon, 30 Aug 1999 11:13:19 -0500 (CDT)
	0 replies 	0 followups

====> ORIGINAL MESSAGE FOLLOWS <====

---

From: Dominik Vogt <[email-masked]>
Date: Mon, 30 Aug 1999 20:41:28 +0200

On Mon, Aug 30, 1999 at 11:13:21AM -0500, [email-masked] wrote:
> If I only have a few windows up, I can place them on different desktop
> pages outside the current screen using GNU Emacs Lisp functions.
> 
> However, when I have many windows (100s),

B..b..but, you really mean *hundreds* of windows? Your machine must
be swapping for minutes before opening a new window, unless you have
a 256-way SMP machine (each CPU with 500 TeraHertz and 10 zillion
bytes of RAM) ;-)

> the window placement many times fail to work at all. Emacs Lisp
> is unable to get the correct coordinates and cannot properly
> calculate the target position.
> 
> Any ideas why this is so?

Hm, unless you tell us what kind of windows you try to place, how
you do it ('I use Emacs' is way too vague) and what happens in
comparison to your expectations I can only guess. There are a
number of fvwm commands influencing window placement. For example
the ...Placement styles and StartsOn... styles.

In the end it's a problem of Emacs ('Emacs Lisp is unable to get
the correct coordinates') and I know a bug in Emacs that seems to
be fixed in 20.4 (although nobody intentionally fixed it). It
caused the position calculations of Emacs Frames to go awry, but
only for a few pixels. And my XEmacs request a window height of
65519 pixels or so from time to time.  You get the point; the
(X)Emacs window positioning and sizing code isn't famous for being
bug free ;-)

My advice is: try playing with aforementioned styles and try setting

  Style * HandleWidth 0

I know it's ugly, but if this helps it's a clear indication that
Emacs does some calculations wrong. If it does help, try Emacs 20.4.

Bye

Dominik ^_^

--
Dominik Vogt, [email-masked]
Reply-To: [email-masked]
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: [email-masked] (Paul D. Smith)
Date: 31 Aug 1999 01:04:35 -0400

>> However, when I have many windows (100s),

  dv> B..b..but, you really mean *hundreds* of windows? Your machine
  dv> must be swapping for minutes before opening a new window, unless
  dv> you have a 256-way SMP machine (each CPU with 500 TeraHertz and 10
  dv> zillion bytes of RAM) ;-)

No problem.  Note he said "windows", not "instances of Emacs".  A single
Emacs executable can have as many individual frames (separate X window)
created as you like; there's very little incremental cost for making a
new frame once emacs is started.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[email-masked]>         Network Management Development
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
   These are my opinions---Nortel Networks takes no responsibility for them.
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Bertil Askelid <[email-masked]>
Date: Tue, 31 Aug 1999 05:58:13 -0700

<> Date: Mon, 30 Aug 1999 20:41:28 +0200
<> From: Dominik Vogt <[email-masked]>
<> Subject: Re: Notification: incoming/447
<>
<> On Mon, Aug 30, 1999 at 11:13:21AM -0500, [email-masked] wrote:
<> > If I only have a few windows up, I can place them on different desktop
<> > pages outside the current screen using GNU Emacs Lisp functions.
<> >
<> > However, when I have many windows (100s),
<>
<> B..b..but, you really mean *hundreds* of windows? Your machine must
<> be swapping for minutes before opening a new window, unless you have
<> a 256-way SMP machine (each CPU with 500 TeraHertz and 10 zillion
<> bytes of RAM) ;-)

   Yes, a couple of hundred GNU Emacs frames from 5-6 Emacs
   processes.  On a 166 MHz 128 MByte i586 running RedHat-6.0. I do this
   when I'm working on really complicated programming problems.  Helps a
   lot to have your whole system spread out over the desktop pages and
   then wander over the pages as the problems are being solved.  No need
   to have any (out of date) printouts.

<> > the window placement many times fail to work at all. Emacs Lisp
<> > is unable to get the correct coordinates and cannot properly
<> > calculate the target position.
<> >
<> > Any ideas why this is so?
<>
<> Hm, unless you tell us what kind of windows you try to place, how
<> you do it ('I use Emacs' is way too vague) and what happens in
<> comparison to your expectations I can only guess. There are a
<> number of fvwm commands influencing window placement. For example
<> the ...Placement styles and StartsOn... styles.

   I use the GNU Emacs Lisp function `set-frame-position' to place the
   frames on a page in a desktop.  The function `frame-parameters' gives
   me the current location of a frame through its `left' and `top'
   fields. As this only gives me the relative placement of a frame, I
   had to invent the trick of placing a "origo" frame on page (0 0) when
   I start GNU Emacs while there. Asking for the position of my "origo"
   frame as well as my current frame gives me enough info. The rest is
   just simple math.

   What goes awry here in fvwm2 is that `frame-parameters' fields `left'
   and `top' report erroneous values when I have too many frames
   up. Works fine when only a very few frames is there.

<> In the end it's a problem of Emacs ('Emacs Lisp is unable to get
<> the correct coordinates') and I know a bug in Emacs that seems to
<> be fixed in 20.4 (although nobody intentionally fixed it). It
<> caused the position calculations of Emacs Frames to go awry, but
<> only for a few pixels.

   How come, then, that everything works just fine in tvtwm with many
   hundreds of frames?  That makes me believe that the problem lies with
   fvwm2.

<>                        And my XEmacs request a window height of
<> 65519 pixels or so from time to time.  You get the point; the
<> (X)Emacs window positioning and sizing code isn't famous for being
<> bug free ;-)

   Haven't tried XEmacs. This is GNU Emacs I'm using. 20.3 right out of
   the box. I'll try 20.4 later.

<> My advice is: try playing with aforementioned styles and try setting
<>
<>   Style * HandleWidth 0

   I'll give that a trie. Thanks for the advice.

   With the information above, I hope you can figure out what is going
   on.

   Thanks a lot for your quick attention to my problem!

      With Kindest Regards

         Bertil

---

From: Dominik Vogt <[email-masked]>
Date: Tue, 31 Aug 1999 15:20:33 +0200

>    up. Works fine when only a very few frames is there.

Can you give examples of the values?
 
>    hundreds of frames?  That makes me believe that the problem lies with

There are quite a few different ways of doing window management and
drawing decorations. Because a bug occurs with one window manager and
not another doesn't means it's the fault of the window manager. It can
be the application as well. The reason why I suspect an Emacs bug is
that if Emacs lisp fetches the window positions it won't ask the
window manager for them but X itself. And I don't think X is lying
about them.

What you could do too is run 'xwininfo -all' to get information
on one of the failing frames see if something is wrong there.

>    Thanks a lot for your quick attention to my problem!

That's what I'm here for :)

-- 
Dominik Vogt, Hewlett-Packard GmbH, Dept. BVS
Herrenberger Str.130, 71034 Boeblingen, Germany
phone: 07031/14-4596, fax: 07031/14-3883, [email-masked]
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Bertil Askelid <[email-masked]>
Date: Tue, 31 Aug 1999 06:19:31 -0700

<> Date: Mon, 30 Aug 1999 20:41:28 +0200
<> From: Dominik Vogt <[email-masked]>
<> To: [email-masked], fvwm-workers <[email-masked]>
<> Subject: Re: Notification: incoming/447
<>
<> Hm, unless you tell us what kind of windows you try to place, how
<> you do it ('I use Emacs' is way too vague) and what happens in
<> comparison to your expectations I can only guess. There are a
<> number of fvwm commands influencing window placement. For example
<> the ...Placement styles and StartsOn... styles.
<>
<> My advice is: try playing with aforementioned styles and try setting
<>
<>   Style * HandleWidth 0
<>
<> I know it's ugly, but if this helps it's a clear indication that
<> Emacs does some calculations wrong. If it does help, try Emacs 20.4.

   I have the following in my .fvwm2rc related to window placement:

      Style * NoTitle,NoHandles,BorderWidth 2
      Style * RandomPlacement,SmartPlacement

   which I guess is too ugly to many :^). But I concentrate on the text
   in the frames and don't care a bit about the decorations. They are
   just in the way. Being an Emacs freak, I have it all coded to the
   keyboard, so I don't need the handles.

   However, the placement commands you mentioned above only help when a
   frame is created.  I have no problem with that.  It comes up and is
   being randomly and smartly placed in my current page, just like I
   want it to.

   Yes, I could use those .fvwm2rc commands to place the frame wherever in any
   other page. But, that is too static. I want to be able to place my
   frames in different pages at different times.

   That's why I have reverted to use `set-frame-position' and
   `frame-parameters'.

---

From: Bertil Askelid <[email-masked]>
Date: Tue, 31 Aug 1999 08:19:58 -0700

After giving me all those hints, I had another look at my Emacs Lisp
   code. Played around a bit and figured out that the problem comes
   about when I do a `raise-frame' before `set-frame-position'. If I
   raise the frame after I have moved it, it works just fine!

   Seems to be a timing problem.

   Anyways, my problem is solved and I'm happily back using fvwm2.

      With Kindest Regards

         Bertil

---

From: Dominik Vogt <[email-masked]>
Date: Tue, 31 Aug 1999 18:25:09 +0200

>    Anyways, my problem is solved and I'm happily back using fvwm2.

:-)

I'll close the bug report then.

Bye

Dominik ^_^