Subject: Netscape doesn't listen to StartsOnPage well

From: TG <[email-masked]>
Date: Mon, 27 Sep 1999 12:05:46 +0200

(latest cvs versions)

I have a problem letting the Netscape windows start on the right page.
They pick out the right desk, but it just takes the page coordinates of
the desk I'm working in.

Suppose I am at desk 1 and page (1,0) the mail window shows up at desk
3, but page (1,0) instead of page (0,0) like I specified in the Style.

I verified I don't have this problem with other applications.

---
Style "Netscape Navigator*" StartsOnPage 2 0 0, SkipMapping
Style "Netscape Mail*"      StartsOnPage 3 0 0, SkipMapping
Style "Compose*"            StartsAnyWhere
Style "Netscape: Open Page" StartsAnyWhere
---

Is this Netscape behaving bad again?

Regards,

Tung
--
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: Neil Bird <[email-masked]>
Date: Mon, 27 Sep 1999 13:47:11 +0100

> Style "Netscape: Open Page" StartsAnyWhere

  It's OK for me (although I'm a couple of weeks out-of-date from CVS).

  However, I use:

Style "Navigator"       ... StartsOnPage 1 0, ...
Style "MailThread"      IconBox 54x54+925+0

  My NS windows have titles "Netscape Mail & Newsgroups:*" and
"Netscape:*" (browser) - these won't match your strings (which is why I
match on the NS window classes rather than names). (BTW, all NS popups
match "*_popup").

-- 
=====================- http://www.racaldefence.com/ -===================
 Neil Bird                   |   This is who we are     The time is near
                             |
 mailto:[email-masked] |        There are 96 days remaining
--
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: Dominik Vogt <[email-masked]>
Date: Mon, 27 Sep 1999 14:48:41 +0200

> Is this Netscape behaving bad again?

Probably. What name/resource/class do these windows have
(use FvwmIdent to get this info)?

Bye

Dominik ^_^

-- 
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: TG <[email-masked]>
Date: Tue, 28 Sep 1999 00:48:22 +0200

> (use FvwmIdent to get this info)?

Navigator window:

Name: Netscape Navigator 4.51
Resource: Navigator
Class: Netscape
Icon Name: Netscape

Mail window:

Name: Netscape Mail & Newsgroups: Re: Netscape doesn't listen to
StartsOnPage well
Resource: MailThread
Class: Netscape
Icon Name: Mail & Newsgroups

It would be fun to copy the text from the FvwmIdent window, now it
disappaers when I try selecting some text.

Regards,

Tung

---

From: Dominik Vogt <[email-masked]>
Date: Tue, 28 Sep 1999 12:30:24 +0200

> Icon Name: Mail & Newsgroups

Well, this looks right.  I can only guess that netscape is too lazy
about setting up its title and possibly class/resource.  Probably
it is already mapped when its sets its name. In the file
add_window.c around line 233 you should find this code:

    else
      tmp_win->name = NoName;
  
    /* removing NoClass change for now... */

Could you add an fprintf before the comment:

    else
      tmp_win->name = NoName;

    fprintf(stderr,"name of new window: %s\n", (tmp_win->name == NoName) ? "(null)" : tmp_win->name);
    /* removing NoClass change for now... */

> disappaers when I try selecting some text.

It wouldn't let you copy it anyway. 

Bye

Dominik ^_^

---

From: Neil Bird <[email-masked]>
Date: Tue, 28 Sep 1999 11:35:00 +0100

I'm reposting this 'cos I think it's still relevant, and the way the
thread's going, I think it wasn't read! (or I'm thicker than I thought)

  ----

  However, I use:

---

From: TG <[email-masked]>
Date: Tue, 28 Sep 1999 14:46:42 +0200

> Style "MailThread"      IconBox 54x54+925+0

I tried using the class names as you said, but the problem persists.
---
Style "Navigator"               StartsOnPage 2 0 0, SkipMapping
Style "MailThread"              StartsOnPage 3 0 0, SkipMapping
---

> match on the NS window classes rather than names). (BTW, all NS popups

Why doesn't my string ("Netscape Mail*") doesn't match the "Netscape
Mail & Newsgroups:*" title? I don't see the problem. And why do the mail
and navigator windows shows up at the desk I have specified in the two
Style lines and not at the current page like a regular window?

Regards,

Tung

---

From: TG <[email-masked]>
Date: Tue, 28 Sep 1999 14:32:02 +0200

(Dominik: sorry for posting this twice, I just forgot to change the To:
field in my reply)

>     /* removing NoClass change for now... */

This is what I get:
---
name of new window: Netscape Navigator 4.51
name of new window: Netscape Mail & Newsgroups
---

Looks ok to me.. though I know nothing from fvwm2 internals.

> It wouldn't let you copy it anyway.

Can't you make the text selectable?

Regards,

Tung

---

From: TG <[email-masked]>
Date: Tue, 28 Sep 1999 15:58:34 +0200

> Style "Netscape: Open Page" StartsAnyWhere

I just discovered removing SkipMapping "solves" the problem. Other
Netscape popup windows also suffers from SkipMapping.

There is another thread "SkipMapping" going on about problems placing
Netscape windows too.

I use Netscape 4.51, in case it does matter.. Bob Woodside tells it
works ok for 4.6, but right now, I can't afford upgrading to 4.6.

Regards,

Tung

---

From: Dominik Vogt <[email-masked]>
Date: Wed, 29 Sep 1999 02:37:54 +0200

> There is another thread "SkipMapping" going on about problems placing

Do you have any other style lines that might affect netscape windows
that use 'Starts...' or 'SkipMapping' or some related style? Can
you send me your config file please?

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: Bob Woodside <[email-masked]>
Date: Tue, 28 Sep 1999 21:28:19 -0400

TG wrote:
> 
> Why doesn't my string ("Netscape Mail*") doesn't match the
> "Netscape Mail & Newsgroups:*" title?

	It does. And "Netscape*" would match all the window titles of the
windows I commonly use; furthermore, the Class for all of them is simply
"Netscape", so there should be a backup match.

> Netscape popup windows also suffers from SkipMapping.

	Which means we are matching the style to the right window. I have no
idea what's inhibiting the StartsOnDesk/SkipMapping combination - as
I've said, I can't reproduce it on my Linux system with 4.6.

	I think we need to compare notes on our environments - I've lost track
of who has what. Would everyone having this problem please let us know:

	1) Which version(s) of Netscape misbehave(s) this way?
	2) What OS and version are you running?
	3) Do you have any special X resources set for Netscape? - particularly
	   any of the more arcane ones listed in the Netscape.ad file under the
	   comments to the effect of "Don't install this file, and you really
	   don't want to change any of this stuff, but...".
	4) Do you start it with command line args -  -geometry or the like?

Cheers,
Bob

---

From: Dan Espen <[email-masked]>
Date: Wed, 29 Sep 1999 11:23:32 -0400

> I've said, I can't reproduce it on my Linux system with 4.6.

My .fvwm2rc stuff is:

Style "*" MouseFocus
Style "*" ActivePlacement, SmartPlacement
Style "Netscape*" MiniIcon mini.netscape.xpm
Style "Netscape" StartsOnPage 0 0 1, SkipMapping,ActivePlacementHonorsStartsOnPage

> 	1) Which version(s) of Netscape misbehave(s) this way?

I tried 3.0 and 4.61, both started on the main page and desk.

> 	2) What OS and version are you running?

Solaris 2.6 and 2.5.1.

> 	   don't want to change any of this stuff, but...".

me> appres Netscape
*Toggle.translations:   #override\n\
None<Key>Return: toggle() notify()
*Load*font:     6x10
*Load*height:   35
*Load*width:    90
*Command.translations:  #override\n\
None<Key>Return: set() notify() unset()
*BitmapFilePath:        /usr/local/X11/include/X11/bitmaps:/usr/local/X11/icons

> 	4) Do you start it with command line args -  -geometry or the like?

I normally use:

"-geom 930x873 -install" but I tried it from the command line without
the -geom and got the same result.

--
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-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Dominik Vogt <[email-masked]>
Date: Wed, 29 Sep 1999 21:45:07 +0200

On Wed, Sep 29, 1999 at 11:23:32AM -0400, Dan Espen wrote:
> [stuff deleted]

Can you exchange the lookup_style function in style.c with
this code and see if the failing style lines are matched
at all?

------------------------------------------------------------
void lookup_style(FvwmWindow *tmp_win, window_style *styles)
{
  window_style *nptr;

  /* clear callers return area */
  memset(styles, 0, sizeof(window_style));
  /* initialize to default layer */
  styles->layer = Scr.DefaultLayer;
#ifdef GNOME
  /* initialize with GNOME hints */
  GNOME_GetStyle (tmp_win, styles);
#endif
  /* look thru all styles in order defined. */
fprintf(stderr,"trying to match n='%s', r='%s', c='%s'\n", tmp_win->name, tmp_win->class.res_name, tmp_win->class.res_class);
  for (nptr = all_styles; nptr != NULL; nptr = nptr->next) {
    /* If name/res_class/res_name match, merge */
fprintf(stderr, "style='%s'\n", nptr->name);
    if (matchWildcards(nptr->name,tmp_win->class.res_class) == TRUE) {
fprintf(stderr,"matched class\n");
      merge_styles(styles, nptr);
    } else if (matchWildcards(nptr->name,tmp_win->class.res_name) == TRUE) {
fprintf(stderr,"matched resource\n");
      merge_styles(styles, nptr);
    } else if (matchWildcards(nptr->name,tmp_win->name) == TRUE) {
fprintf(stderr,"matched name\n");
      merge_styles(styles, nptr);
    }
  }
  return;
}
------------------------------------------------------------

And I have a question refering to the add_style_to_list function,
Dan. There is a comment from you that mentions that older versions
tried to merge multiple style commands and that it was removed -
partially because 'the last match should win'.  I wonder if this is
really the behaviour we want.  One reason against it is memory
consumption, another that is may have subtle effects with certain
config files.  I wonder it is worth the effort to implement
merged styles again and then replace the matching scheme so that
a 'best match' wins.

Bye

Dominik ^_^

---

From: Bob Woodside <[email-masked]>
Date: Wed, 29 Sep 1999 22:41:53 -0400

> > I have a problem letting the Netscape windows start on the right page.

    [I'm copying several people, 'cause I'm not sure who's on the list.]

Tung --

	Do you have anywhere in your fvwm2rc a style like this...?

Style  *  NoPPosition

If not, please add that style somewhere and see if you have any better
luck with Netscape.

	If you do have it, please double check that there is no UsePPosition
style command that might undo it.

Dan --

	Try entering "Style * UsePPosition" from FvwmConsole and then fire the
beastie up (without the -geom), and I'll bet you get the same symptoms
as have been reported, at least for 4.61. I'd be curious to hear what
3.0 does, since one of the reports said 3.x worked fine but 4.61 was
flaky.

Ferg, Nathan --

	Would you mind trying the same experiment, and letting us know what
happens?

Dominik --

	I'm wondering whether maybe we should make NoPPosition the default,
since the documentation has recommended using it for years.

Cheers,
Bob

---

From: Dan Espen <[email-masked]>
Date: Thu, 30 Sep 1999 08:28:00 -0400

> 3.0 does, since one of the reports said 3.x worked fine but 4.61 was

Style "Netscape" NoPPosition

fixes the problem.  It doesn't matter whether I use -geom or not.
It also doesn't matter whether I run Netscape 3.0 or 4.61 or not.

I'll change to:

Style "*" NoPPosition

for  testing, but based on the  man page, I guess I'm  going to have a
problem   with  some applications.  I  guess   thats why  its  not the
default.

---

From: Dan Espen <[email-masked]>
Date: Thu, 30 Sep 1999 09:22:27 -0400

> this code and see if the failing style lines are matched
...

I'm guessing that since Bob identified NoPPosition as the culprit,
you don't need this anymore.

Gee, you had me confused there.  The comment reads like this:

  /* This used to contain logic that returned if the style didn't contain
   * anything.  I don't see why we should bother. dje.
   *
   * used to merge duplicate entries, but that is no longer
   * appropriate since conficting styles are possible, and the
   * last match should win! */

Notice  that  my  initials  follow  the  first paragraph.  The  second
comment was  present in fvwm1.24r.  You  could only merge entries that
matched on style that at  are at the end  of the list.  These could be
merged:

Style "*" NoIcon
Style "*" NoPPositon

These couldn't:

Style "*" NoIcon
Style "Netscape" UsePPosition
Style "*" NoPPosition

This would get trickier:

Style "*" NoIcon
Style "Netscape" Icon x.xpm
Style "*" NoPPosition

---

From: Dominik Vogt <[email-masked]>
Date: Thu, 30 Sep 1999 15:28:45 +0200

> problem   with  some applications.  I  guess   thats why  its  not the

I'm using it for years and never had any problems with it.
Applications that require that the WM honours this hint are
broken.  I see the 'UsePPosition' style as another bug-fix
option.  Shouldn't we give it a try?  I guess we will have
less bug reports in the future about this, not more.

Bye

Dominik ^_^

---

From: Dan Espen <[email-masked]>
Date: Thu, 30 Sep 1999 09:45:47 -0400

> less bug reports in the future about this, not more.

Well, if it makes "startsonpage, skipmapping" work, I think I agree,
its worth a try.  I also needed "ActivePlacementHonorsStartsOnPage".
Shouldn't that be a default also?

---

From: Dominik Vogt <[email-masked]>
Date: Thu, 30 Sep 1999 15:40:30 +0200

> comment was  present in fvwm1.24r.

Duh, I didn't notice this subtle difference.

> You  could only merge entries that
> matched on style that at  are at the end  of the list.

Why? It's easy to find the correct entry in the list. The main problem
I see is that the function merging the styles together would have to
know the individual styles so that it could free allocated memory.
I believe the question is more if we would like the effect.

> Style "Netscape" Icon x.xpm

No. There is nothing much to be merged. Remember that the code to
merge *different* styles is already there. What we need is the code
to merge two instances of the same style without leaking memory.
For use by add_window different styles are already merged, but these
new styles couldn't be used because they would happily leak any allocated
memory that both parent styles are using.

Bye

Dominik ^_^

---

From: TG <[email-masked]>
Date: Thu, 30 Sep 1999 19:07:00 +0200

Bob Woodside wrote:

[ not sure who I am quoting, I hope the author(s) doesn't get mad at
me.. :-]

> If not, please add that style somewhere and see if you have any better

I added the style and Netscape seems te behave like I wanted.

Netscape 4.51, XFree-3.3.3.1, Linux-2.2.5, i386 (all installed from
RedHat 6.0)

No xresources set for Netscape, no startup parameters.

> since the documentation has recommended using it for years.

I looked at the fvwm2 manpage, but I can't figure out what the
"PPosition field" designates, could someone explain it a little?

Thanks,

Tung

---

From: Bob Woodside <[email-masked]>
Date: Thu, 30 Sep 1999 21:33:18 -0400

TG wrote:
> 
> I added the [NoPPosition] style and Netscape seems te behave like
> I wanted.

	Great! I think we've got enough success stories now to be confident
that we've naile this one.

> "PPosition field" designates, could someone explain it a little?

	[sigh]  I'm having to dig into my very fuzzy recollection of FVWM
ancient history on this one (which is why I didn't think of the solution
sooner). If anyone can explain this a little better, please jump in.

	NoPPosition addresses a problem associated with apps that explicitly
set a position of 0,0 when they create a window (by setting the
PPosition hint), and use 0,0 to mean they don't really care where it's
placed. A number of applications do this, though, as I think Dominik
commented, it is technically broken. The canonically correct thing to do
would be not to specify a position.

	NoPPosition, in effect, tells FVWM to assume that the special case of a
program-specified position of 0,0 means "don't care", and not to try to
honor the position request as it does for other values.

	There is a lot of code that tries to deal with honoring the 0,0 case,
and as far as I can tell, it's always tended to produce intermittently
quirky results. Among other things, I think it was prone to off-by-one
errors when adjusting for the window decorations, and falling through
some special code that attempted to reposition the window so that it was
in the visible viewport. Also, a lot of the fancy placement code gets
bypassed, and that's where StartsOnPage does its dirty work.

	I recall that Rob Nation (the original author of FVWM) had recommended
never using UsePPosition unless you have an app that really requires it.
I can't lay my hands on the source of his suggestion at the moment,
however.

	Without digging a little deeper, I'm not sure whether the StartsOnPage
code copuld be easily made to work with UsePPosition - without breaking
something else. But I'm also not so sure that an app that really goes
bonkers if it doesn't get the exact 0,0 positioning it requested would
be very happy with things like StartsOnPage and SkipMapping.

	Does anyone else recall what apps actually required UsePPosition?

Cheers,
Bob

---

From: Bob Woodside <[email-masked]>
Date: Thu, 30 Sep 1999 21:32:39 -0400

> It also doesn't matter whether I run Netscape 3.0 or 4.61 or not.

	I got a little confused following the various threads related to this.
I was thinking that you had said StartsOnPage *was* working properly for
you, so I assumed that you *did* have NoPPosition. That's why my
suggestion was sort of backwards.

> problem   with  some applications.  I  guess   thats why  its  not the

	I've used it as far back as I can remember (back in Version 1 days),
and I can't remember having a problem with any applications.
Nevertheless, I'd like to see how you fare for a few days before making
a change to the default.

	I seem to recall seeing some comments from Rob - maybe in the code,
maybe in the old sample fvwmrc's...I'll have to see if I can find them -
that he knew of only a couple of apps that had a problem with
NoPPosition. I don't recall what they were. I'm betting that you don't
have a problem.

Cheers,
Bob

---

From: Bob Woodside <[email-masked]>
Date: Thu, 30 Sep 1999 22:25:29 -0400

Bob Woodside wrote:
> 
>         I seem to recall seeing some comments from Rob...
> NoPPosition.

	On the other hand, maybe I just dreamed it. I can't find any such
refence in my archives. I also think my foggy brain was merging the man
page comments about Lenience with NoPPosition.

	The man page (Version1 or Version 2) doesn't strongly recommend
NoPPosition - it's more of a gentle hint - so, clearly, my comment that
the documentation has recommended it for years was way off base. Well,
I've recommended it for years...a couple of times, anyway.  :-)

Cheers,
Bob