Subject: FVWM: Using FvwmEvent to move to current desk: not working

From: Von Welch <[email-masked]>
Date: Tue, 23 Jan 2001 10:44:20 -0600 (CST)

Hello all-

First of all I am using:

FVWM version 2.3.27 compiled on Jan  7 2001 at 17:22:21
with support for: ReadLine, RPlay, Stroke, XPM, GNOME WM hints, SM

I'm seeing the following problem- I create new xemacs frames using
gnuclient. The problem is that no matter what desk I'm on, the new
frames always appear on the initial desk (0 in this case) that xemacs
was created on.

No problem, I thought, I'll just use FvwmEvent to move them to the
current desktop. So I added the following to my .fvwm2rc:

--cut--
Style "emacs*"		SkipMapping

AddToFunc AddWindowFunc	
# Move emacs windows to current desk as they tend to appear on the
# original desk
+ "I" WindowId $0 ("emacs") MoveToDesk 0 $d

*FvwmEventPassId
*FvwmEvent add_window AddWindowFunc
--end cut--

Except this doesn't work. $d apparently resolves to Desk 0, where the
xemacs frame is created and not the desk I'm currently on. I checked
that FvwmEvent is working by replacing '$d' with '1' and sure enough
xemacs frames were then moved to desk 1 after creation so this seems
to be a $d problem.

Am I misusing or misunderstanding $d? Or any suggestions for other
solutions to my problem?

Thanks,

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

---

From: Dan Espen <[email-masked]>
Date: Tue, 23 Jan 2001 11:58:28 -0500

> frames always appear on the initial desk (0 in this case) that xemacs

Style "emacs*" NoPPosition

might help.

--
Dan Espen
444 Hoes Lane  Room RRC 1C-214           E-mail: [email-masked]
Piscataway, NJ 08854                     Phone: (732) 699-5570
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Von Welch <[email-masked]>
Date: Tue, 23 Jan 2001 11:37:01 -0600 (CST)

> Style "emacs*" NoPPosition

Doesn't seem to make any difference in behavior.

Von

---

From: Dan Espen <[email-masked]>
Date: Tue, 23 Jan 2001 12:52:08 -0500

> Doesn't seem to make any difference in behavior.

Ok, add:

Style "emacs*" ActivePlacementHonorsStartsOnPage

that seemed to work for me.  I actually used:

Style "*macs*" StartsOnPage 0    0 1, SkipMapping
Style "*macs*" NoPPosition
Style "*macs*" ActivePlacementHonorsStartsOnPage

---

From: Von Welch <[email-masked]>
Date: Thu, 25 Jan 2001 15:03:13 -0600 (CST)

> Style "*macs*" ActivePlacementHonorsStartsOnPage

I added ActivePlacementHonorsStartsOnPage and it didn't change
anything. I tried your whole configuration above and it didn't help my
problem, which is xemacs always appearing on desk 0 regardless of the
currently desk. You configuration always makes it appear on a certain
page, but it still always appears on desk 0. Maybe I'm missing
something you are suggesting.

Thanks,

Von

---

From: Dan Espen <[email-masked]>
Date: Thu, 25 Jan 2001 16:31:48 -0500

> something you are suggesting.

I'm sorry, I usually only run with one desk and 2x2 pages.
I didn't pay any attention to the page vs. desk distinction,
I figured you'd set the page and desk as you wanted.

I just changed what I supplied to this:

Style "*macs*" StartsOnPage 1 0 0, SkipMapping
Style "*macs*" NoPPosition
Style "*macs*" ActivePlacementHonorsStartsOnPage

Brought up the pager, and started XEmacs and it came up on desk 1,
at page 0,0.

StartsOnPage with 3 arguments treat the args as "desk" "page-x" "page-y".

Hope this helps.

---

From: Von Welch <[email-masked]>
Date: Thu, 25 Jan 2001 16:42:50 -0600 (CST)

> >  > Von Welch <[email-masked]> writes:
<cut>
 > StartsOnPage with 3 arguments treat the args as "desk" "page-x" "page-y".

Thanks, but not really - my intent is to get xemacs frames to appear
on the current desk (no matter what number that is).

Actually I just figured out a solution, if I do the following it
works (xemacs frames all get moved to the current desk):

# start copy
*FvwmEventPassId

AddToFunc AddWindowFunc
+ "I" WindowId $0 ("emacs") MoveToDesk $d
#end

However, if instead I use the following, which is what I had been
trying, (with the same FvwmEvent configuration), it does not work (all
emacs frames appear on desk 0):

# start
AddToFunc AddWindowFunc
#end

I understand why the first works, but I'm not sure why the second one
doesn't work.

In any case, thanks for your help.

Von

---

From: Mikhael Goikhman <[email-masked]>
Date: Thu, 25 Jan 2001 23:49:18 -0600

> I understand why the first works, but I'm not sure why the second one

Due to the current way that FVWM expands $d, it is expanded to 0 (or
whatever your desk was when the function was defined).

If you want $d to be expanded at function execution time, you should
escape it in functions - $$d. Then both examples should work.

Regards,
Mikhael.

---

From: Von Welch <[email-masked]>
Date: Fri, 26 Jan 2001 11:30:25 -0600 (CST)

> escape it in functions - $$d. Then both examples should work.

I tried this and you are correct. Thanks for the explanation.

Von