Subject: Re: Creating iconified windows broken

From: Bob Woodside <[email-masked]>
Date: Sun, 24 Jan 1999 21:55:12 -0500 (EST)

Dan Espen <[email-masked]> wrote:
> I take it that
> 
>  "GlobalOpts ActivePlacementIgnoresStartsOnPage"
> 
> would also cause the undesirable behavior I observed?

	No, prevent it under certain cirsumstances. I made
ActivePlacementHonorsStartsOnPage the default (maybe it should be
the other way around) so that StartsOnDesk + SkipMapping would continue
to interact with ActivePlacement the way it always used to: you would
place on the current desk with the rubber band, release it, and poof! -
the window would be whisked off to the desk you specified in StartsOnDesk,
possibly leaving you scratching your head wondering what happened.

	This feechur, in combination with the fix for StartsOnPage
windows to start iconic on the desired page, would cause the undesirable
behavior you observed with a StartsOnPage window, even with my fix in
place. That's why you'd need ActivePlacementIgnoresStartsOnPage (or
we'd need to change the default - any votes on that one?).

> 
> I  would, of  course, vote  for  inclusion of the fix,

	If I can get it working cleanly in time...it's still doing a
couple of flaky things that I have to track down.

>  since starting windows iconic is something I do frequently.  I think
> I mentioned that the rubberband outline  had a penchant for  appearing
> near the edge of the screen, so that when I hit  return, the icon  and
> its window ended up on the wrong page.  (I find the bug really bad.)

	This is a bug, in the sense that the change unintentionally broke
the way FVWM used to handle starting a window iconic - and also in the
sense that I doubt that anybody in his right mind would really want it
to operate this way. But, technically, the behavior is not a bug: it's the
logical result of all the options you have coming together at the same
time.

	- ActivePlacement implies that you're expected to take some action
to determine where the window will be placed, not just hit enter.

	- The upper left hand corner of the rubber band will appear
wherever your mouse cursor happens to be. Hitting enter (or Button1
clicking) says "this position's just fine with me" - even if the window
is mostly off the screen (I sometimes deliberately position a window this
way).

	- Since the window is mostly off the screen, it is viewed as more
*on* a different page than the one you're viewing, and that's the one
where the icon is getting placed.

	Now I rather doubt that anyone's ever really wanted things to
happen this way. I imagine that's why (or at least one of the reasons why)
FVWM adopted the policy of bypassing all of the fancy placement stuff for
a window that starts iconic, and just dumping the icon on the current
desk/page. Unfortunately, I broke that.

	Now, if I can only figure out what my fix to the fix just
unfixed...

- Bob

--
Visit the official FVWM web page at <URL:http://fvwm.math.uh.edu/>.
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: Sun, 24 Jan 1999 23:50:49 -0500 (EST)

Bob Woodside <[email-masked]> wrote:
> 	...if I can only figure out what my fix to the fix just
> unfixed...

	OK, the fix looks good now. It didn't break something else,
but in testing I stumbled over a condition where StartsOnPage in
conjunction with Dan's setup, would place the window improperly
(usually off the desktop altogether) because of double incrementing
for the page offset.

	So, the proposed code change does the following:

	1. Fixes Dan's problem.
	2. Fixes the double increment bug in StartsOnPage.
	3. Changes the default from ActivePlacementHonorsStartsOnPage
	   to ActivePlacementIgnoresStartsOnPage. I don't think anyone
	   will much like the old behavior if they happen across it.

	If the vote is yea, I'll commit the changes tomorrow evening
(I can't do CVS from the office).

- Bob

---

From: Bob Woodside <[email-masked]>
Date: Mon, 25 Jan 1999 20:48:03 -0500 (EST)

> (I can't do CVS from the office).

	Well, out of a total of 2 precincts reporting (mine and
Dan's), the vote is 100% in favor of committing the fix.

	I'd feel a little more comfortable about it if we had a
couple more votes, though. What do you think, Dan - should we assume
qui tacet consentire? Silence gives consent?

	In case anyone would like to look it over, I'm attaching the
diffs.

- Bob

---

From: Bob Woodside <[email-masked]>
Date: Mon, 25 Jan 1999 20:54:12 -0500 (EST)

> 	In case anyone would like to look it over, I'm attaching the

	Yeah, well, that's what I wrote, all right, but I hit "send"
too soon. Here's the patch this time...(Stop, Bob! Don't hit that
button yet! No.......)

- Bob

--- fvwm.c	Mon Jan 25 19:35:51 1999
+++ fvwm-fixed.c	Mon Jan 25 19:35:23 1999
@@ -1387,7 +1387,7 @@
   Scr.go.ModifyUSP                          =  True;
   Scr.go.CaptureHonorsStartsOnPage          =  True;
   Scr.go.RecaptureHonorsStartsOnPage        =  False;
-  Scr.go.ActivePlacementHonorsStartsOnPage  =  True;
+  Scr.go.ActivePlacementHonorsStartsOnPage  =  False;
 
   Scr.gs.EmulateMWM = False;
   Scr.gs.EmulateWIN = False;
--- placement.c	Mon Jan 25 19:35:51 1999
+++ placement-fixed.c	Mon Jan 25 19:35:23 1999
@@ -431,6 +431,8 @@
 /**/
   extern Boolean PPosOverride;
 
+  yt = 0;
+
   GetGravityOffsets (tmp_win, &gravx, &gravy);

@@ -591,8 +593,12 @@
       !(tmp_win->hints.flags & USPosition) &&
       ((tflag & NO_PPOSITION_FLAG)||
        !(tmp_win->hints.flags & PPosition)) &&
-      !(PPosOverride) )
-/*  RBW - removed check for IconicState hint - it hindered StartsOnPage.  */
+      !(PPosOverride) &&
+      /*  RBW - allow StartsOnPage to go through, even if iconic.  */
+      ( ((!((tmp_win->wmhints)&&
+	    (tmp_win->wmhints->flags & StateHint)&&
+	    (tmp_win->wmhints->initial_state == IconicState))) 
+	 || (HonorStartsOnPage)) ) )
   {
     /* Get user's window placement, unless RandomPlacement is specified */
     if(tflag & RANDOM_PLACE_FLAG)
@@ -681,8 +687,8 @@
           yt = 0;
         }
       }
-      /* RBW - 11/02/1998  */
-      if (HonorStartsOnPage)
+      /* RBW - 11/24/1999  */
+      if (HonorStartsOnPage && ! smartlyplaced)
       {
         xl -= pdeltax;
         yt -= pdeltay;
@@ -709,8 +715,15 @@
            ( !(tmp_win->flags & TRANSIENT) &&
 
              ((tflag & NO_PPOSITION_FLAG) ||
-              !(tmp_win->hints.flags & PPosition)) ) )
-/*  RBW - removed check for IconicState hint - it hindered StartsOnPage.  */
+              !(tmp_win->hints.flags & PPosition)) &&
+
+           /*  RBW - allow StartsOnPage to go through, even if iconic.  */
+           ( ((!((tmp_win->wmhints)&&
+                (tmp_win->wmhints->flags & StateHint)&&
+	        (tmp_win->wmhints->initial_state == IconicState)))
+              || (HonorStartsOnPage)) )
+
+	       ) )
         {
         /*
             We're placing a SkipMapping window - either capturing one that's

---

From: Tim Phipps <[email-masked]>
Date: Tue, 26 Jan 1999 12:15:54 +0000

> qui tacet consentire? Silence gives consent?

Yes from me, not being able to raise windows above icons is bad.

Cheers,
Tim.