Subject: Re: FVWM: gimp2 + StartsOnDesk + SkipMapping

From: "Felix E. Klee" <[email-masked]>
Date: Thu, 2 Sep 2004 16:51:53 +0200

Hi Chris,

On Thu, 3 Jun 2004 14:24:29 +0200 Chris Rouch wrote:
> I want the gimp to start on desk 3, so I have the following
> configuration:
> 
> Style	"gimp-2.0"	    StartsOnDesk 3 SkipMapping
> 
> The splash screen goes to desk 3 without altering my current desk.
> However as soon as the main application appears my desk is switched, so
> it looks like the SkipMapping is being ignored. 
> 
> Does anyone know how to fix this?

Did you ever solve that problem. I find it quite annoying.

Felix
--
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: Dominik Vogt <[email-masked]>
Date: Thu, 2 Sep 2004 17:34:11 +0200

> Did you ever solve that problem. I find it quite annoying.

Put

  BugOpts ExplainWindowPlacement on

in your fvwm config file (2.5.10 or later).  Fvwm then prints a
detailed explanation of why and how new windows are placed.  The
output should enable us to find out what's going on.

By the way, I just checked the sources, and there is no way fvwm
ignores the SkipMapping style (unless it's overridden by another
style).

Ciao

Dominik ^_^  ^_^

 --
Dominik Vogt, [email-masked]

---

From: Chris Rouch <[email-masked]>
Date: Thu, 2 Sep 2004 18:08:53 +0200

On Thu, 2 Sep 2004 17:34:11 +0200
Dominik Vogt <[email-masked]> wrote:

> > > However as soon as the main application appears my desk is
> > > switched, so it looks like the SkipMapping is being ignored. 
> > > 

No I didn't.

>   BugOpts ExplainWindowPlacement on
I've tried that. If I'm on desk 0, the output I get is:

[FVWM][__explain_placement]: placed new window 0x2a00002 'GIMP Startup':
  desk 0 (specified by style)
  current page
  position 488 362  (used program specified position)

[FVWM][__explain_placement]: placed new window 0x2a00a5d 'The GIMP':
  desk 0 (specified by style)
  current page
  position 0 61  (used user specified position)

[FVWM][__explain_placement]: placed new window 0x2a00af1 'The GIMP':
  desk 0 (specified by style)
  current page
  position 964 64  (used user specified position)

This corresponds to the splash screen and the two gimp windows. I only
have 1 page per desk. The style option is:

Style "Gimp*" StartsOnDesk 3, SkipMapping, RandomPlacement

Thanks for any help.

Regards,

Chris

---

From: Tavis Ormandy <[email-masked]>
Date: Thu, 2 Sep 2004 17:34:37 +0100

> Style "Gimp*" StartsOnDesk 3, SkipMapping, RandomPlacement

This works here:

Style Gimp-2.0 StartsOnPage 2 2, SkipMapping, !FPFocusByFunction

-- 
-------------------------------------
[email-masked] | finger me for my gpg key.
-------------------------------------------------------
--
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: "Felix E. Klee" <[email-masked]>
Date: Fri, 3 Sep 2004 00:05:57 +0200

> Style Gimp-2.0 StartsOnPage 2 2, SkipMapping, !FPFocusByFunction

Just tired that. It doesn't work for me, but I'm still using
2.5.8. BTW, I've

    Style * SkipMapping

and no styles with ShowMapping in my config. So, I assume that this is
either a bug in FVWM 2.5.8 or Gimp 2.0.2 uses a special feature to
circumvent SkipMapping.

Felix

---

From: Dominik Vogt <[email-masked]>
Date: Fri, 3 Sep 2004 10:25:44 +0200

> Style "Gimp*" StartsOnDesk 3, SkipMapping, RandomPlacement

Some conclusions:

  1) The output of the ExplainWinowPlacement option is broken (it
     shows the current desk, not the target desk).  I'll fix that.

  2) Fvwm did *not* ignore SkipMapping and did *not* switch desks
     when the window was placed.

  ==> The application must have caused it.  Probably the
      application used the ewmh interface to switch desks.

Try to comment out the "gogo_desk(...)" call in fvwm/ewmh_events.c
in the ewmh_CurrentDesktop function.  If my theory is correct,
this should suppress the problem.

If this really is the cause, contact the gimp developers and ask
them to remove this mis-feature.  If they want all windows on one
desk, they should use the window group hint and hope all windows
are placed on the same desk as the group leader.

Ciao

Dominik ^_^  ^_^

---

From: Chris Rouch <[email-masked]>
Date: Fri, 3 Sep 2004 13:20:59 +0200

On Fri, 3 Sep 2004 10:25:44 +0200

> this should suppress the problem.

This doesn't make any difference. However Tavis' suggestion

> Style Gimp-2.0 StartsOnPage 2 2, SkipMapping, !FPFocusByFunction

does work. It's the "!FPFocusByFunction" that fixes it.

Thanks Tavis -I would never have guessed that myself.

Chris

---

From: Dominik Vogt <[email-masked]>
Date: Mon, 6 Sep 2004 13:09:11 +0200

> Thanks Tavis -I would never have guessed that myself.

I see.  EWMH is indeed the culprit.  Gimp sends an "activate
window" message to fvwm which in turn switches to the window's
desk by running the EWMHActivateWindowFunc function:

  DestroyFunc EWMHActivateWindowFunc
  AddToFunc EWMHActivateWindowFunc I Iconify Off
  + I Focus
  ^^^^^^^^^
  + I Raise
  + I WarpToWindow 50 50

The !FPFocusByFunction works because it disables the Focus
function which switches desks.

You can replace this with something like

  DestroyFunc EWMHActivateWindowFunc
  AddToFunc EWMHActivateWindowFunc I ThisWindow (!Gimp*) Iconify Off
  + I ThisWindow (!Gimp*) Focus
  + I ThisWindow (!Gimp*) Raise
  + I ThisWindow (!Gimp*) WarpToWindow 50 50

Or with current CVS (I had to fix a bug first):

  DestroyFunc EWMHActivateWindowFunc
  AddToFunc EWMHActivateWindowFunc
  + I ThisWindow (Gimp*) break
  + I Iconify Off
  + I Focus
  + I Raise
  + I WarpToWindow 50 50

Ciao

Dominik ^_^  ^_^