Subject: Re: [Fwd: FVWM-2.3.6 patch submissions]

From: Dominik Vogt <[email-masked]>
Date: Thu, 26 Aug 1999 01:12:24 +0200

On Wed, Aug 25, 1999 at 05:28:29PM +0100, Mark Rainford wrote:

Mark,

that patch works only as one would expect if the styles
RaiseTransient and LowerTransient are used. I could imagine
the final behaviour like this:

There are three styles, (Dont)RaiseTransient and
(Dont)LowerTransient plus (Dont)StackTransientParent.

The first should work as the man page says: If they are
set, raising/lowering the parent window raises/lowers
transients too. The StackTransientParent style additionally
says that the parent window is to be raised/lowered together
with its transients whenever a transient is raised/lowered.

At the moment the patch is way too strict. The problems I
see are:

 - You can't lower transients below the parents anymore,
   even with DontLowerTransient and DontRaiseTransient set.
 - If both Dont... styles are set you can't raise transients
   above any other windows.
 - Again with those two styles: When you click on a transient,
   its parent is raised.
 - The LowerTransient/DontLowerTransient style seems to have
   no effect at all.
 - You can't restack transients anymore. If an application has
   two transients, you are unable to raise one transient above
   the other.

We need to clean up these issues before we can apply that
patch.

> -------- Original Message --------
> Subject: FVWM-2.3.6 patch submissions
> Date: Wed, 25 Aug 1999 17:24:34 +0100
> From: Mark Rainford <[email-masked]>
> Organization: JET Joint Undertaking
> To: [email-masked]
> 
> Dominik,
> 
> Attached please find a patch file for fvwm-2.3.6 which does the two
> things I mentioned in my previous mail:
> 
> 1) Keep Transients above Main - i.e.. do not toggle Main above/below
> Transients if Main is repeatedly Raised while they are all at the top of
> their layer.
> 
> I imagine this could be a new sub-style of RaiseTransient (refered to as
> TransientOntop in my patch code) but I've made no attempt to code for
> this in window flags or config file parsing. I'll gladly do that if you
> like the idea.
> 
> 2) Redirect Raise/Lower on a Transient to act as if the Raise/Lower was
> on the
> Main - thereby moving the Main and all the sibling Transients.
> 
> It seems to me that this fits naturally with the already implemented
> RaiseTransient behaviour, and probably would not be a separate style.
> There is a note in the patch code about this applying to only one level
> - as opposed to a whole tree of Main+Transients.
> 
> 
> 
> One problem which we have with fvwm-2.2.2 is cured by this patch (an
> application pops up a dialogue box centred on itself, then raises itself
> - obscuring the pop-up), so I'd like to move our users forward. Is there
> a stable release on the horizon ? I've got a window of about two weeks
> in which I will be allowed to push the change on our users.
> -- 
> 
> Regards,  Mark.
> *** fvwm-2.3.6/fvwm/stack.c_ORIG	Mon Aug  2 04:39:18 1999
> --- fvwm-2.3.6/fvwm/stack.c	Wed Aug 25 16:25:42 1999
> ***************
> *** 82,95 ****
>     return True;
>   }
>   
> ! static Bool must_move_transients(FvwmWindow *t, Bool do_lower)
>   {
>     /* raise */
>     if ((!do_lower && DO_RAISE_TRANSIENT(t)) ||
> !       (do_lower && DO_RAISE_TRANSIENT(t)))
>     {
>       Bool scanning_above_window = True;
> -     Bool found_transient_window = False;
>       FvwmWindow *q;
>   
>       for (q = Scr.FvwmRoot.stack_next; q != &Scr.FvwmRoot; q = q->stack_next)
> --- 82,96 ----
>     return True;
>   }
>   
> ! static Bool must_move_transients(FvwmWindow *t, Bool do_lower, Bool *found_transient)
>   {
> +   *found_transient = False;
> + 
>     /* raise */
>     if ((!do_lower && DO_RAISE_TRANSIENT(t)) ||
> !       (do_lower && DO_LOWER_TRANSIENT(t)))
>     {
>       Bool scanning_above_window = True;
>       FvwmWindow *q;
>   
>       for (q = Scr.FvwmRoot.stack_next; q != &Scr.FvwmRoot; q = q->stack_next)
> ***************
> *** 112,118 ****
>         else if (IS_TRANSIENT(q) && (q->transientfor == t->w))
>         {
>   	/* found a transient */
> ! 	found_transient_window = True;
>   	if (!do_lower && !scanning_above_window)
>   	{
>   	  /* It's below the window, so it must be raised. */
> --- 113,119 ----
>         else if (IS_TRANSIENT(q) && (q->transientfor == t->w))
>         {
>   	/* found a transient */
> ! 	*found_transient = True;
>   	if (!do_lower && !scanning_above_window)
>   	{
>   	  /* It's below the window, so it must be raised. */
> ***************
> *** 120,126 ****
>   	}
>         }
>         else if ((scanning_above_window && !do_lower) ||
> ! 	       (found_transient_window && do_lower))
>         {
>   	/* raise: The window is not raised, so itself and all transients will
>   	 * be raised. */
> --- 121,127 ----
>   	}
>         }
>         else if ((scanning_above_window && !do_lower) ||
> ! 	       (*found_transient && do_lower))
>         {
>   	/* raise: The window is not raised, so itself and all transients will
>   	 * be raised. */
> ***************
> *** 133,139 ****
>     return False;
>   }
>   
> ! static void RaiseOrLowerWindow(FvwmWindow *t, Bool do_lower)
>   {
>     FvwmWindow *s, *r, *t2, *next, tmp_r;
>     unsigned int flags;
> --- 134,140 ----
>     return False;
>   }
>   
> ! static void inner_RaiseOrLowerWindow(FvwmWindow *t, Bool do_lower, Bool allow_recursion)
>   {
>     FvwmWindow *s, *r, *t2, *next, tmp_r;
>     unsigned int flags;
> ***************
> *** 141,150 ****
>     XWindowChanges changes;
>     Window *wins;
>     Bool do_move_transients;
>     int test_layer;
>   
> !   do_move_transients = must_move_transients(t, do_lower);
>   
>     /* detach t, so it doesn't make trouble in the loops */
>     remove_window_from_stack_ring(t);
>   
> --- 142,196 ----
>     XWindowChanges changes;
>     Window *wins;
>     Bool do_move_transients;
> +   Bool found_transient;
> +   Bool no_movement;
>     int test_layer;
>   
> !   if ( allow_recursion )
> !   {
> !     /*
> !     ** This part makes Raise/Lower on a Transient act on its Main and sibling Transients.
> !     **
> !     ** This recursion is limited to one level - which caters for most cases.
> !     ** This code does not handle the case where there are trees of Main+Transient
> !     ** (ie where a Main_window_with_Transients is itself Transient for another window).
> !     ** If such trees are allowed then another strategy is required.
> !     */
> !     if (IS_TRANSIENT(t)) {
> !       for (t2 = Scr.FvwmRoot.stack_next; t2 != &Scr.FvwmRoot; t2 = t2->stack_next) {
> !         if (t2->w == t->transientfor) {
> !             inner_RaiseOrLowerWindow(t2,do_lower,False);
> !             return;
> !         }
> !       }
> !     }
> !   }
>   
> +   do_move_transients = must_move_transients(t, do_lower, &found_transient);
> + 
> +   /*
> +   ** This part implements the TransientOntop style.
> +   **
> +   ** There is no need to move the main window when
> +   ** (1) Window has style TransientsOntop
> +   ** (2) We are Raising
> +   ** (3) We will not move any transients
> +   ** (4) We found transients belonging to this Main
> +   **
> +   ** This basically means that Main and its superior Transients
> +   ** are already correctly positioned at the top of the layer.
> +   ** To move Main now would place it above its transients - contra
> +   ** to the TransientsOntop style.
> +   */
> + #define TRANSIENTS_ALWAYS_ONTOP(t) (True) /* some window style flag ... yet to be implemented */
> + 
> +   no_movement = TRANSIENTS_ALWAYS_ONTOP(t)
> + 				&& !do_lower
> + 				&& !do_move_transients
> + 				&& found_transient;
> + 
> +   if ( ! no_movement ) {
> + 
>       /* detach t, so it doesn't make trouble in the loops */
>       remove_window_from_stack_ring(t);
>   
> ***************
> *** 248,253 ****
> --- 294,301 ----
>   
>       free (wins);
>   
> +   }
> + 
>     if (!do_lower)
>     {
>       raisePanFrames();
> ***************
> *** 279,284 ****
> --- 327,336 ----
>       }
>     }
>   }
> + static void RaiseOrLowerWindow(FvwmWindow *t, Bool do_lower)
> + {
> +   inner_RaiseOrLowerWindow(t, do_lower, True);
> + }
>   /*
>      Raise t and its transients to the top of its layer.
>      For the pager to work properly it is necessary that

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]