Subject: FvwmIconMan next/prev patch

From: Michael M Han <[email-masked]>
Date: Tue, 15 Dec 1998 22:16:27 -0800

As I mentioned, here's a fairly trivial patch to FvwmIconMan to allow
actions defined for the Buttons next or prev to wrap around the end of
the windowlist. I don't believe a manpage patch is required, as the
page is ambiguous on the behavior on this point... I certainly was a
bit surprised that this *didn't* work until I patched it. Anyway, the
patch follows. I produced it with a simple 'cvs diff' in my current
tree:

Index: modules/FvwmIconMan/xmanager.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/modules/FvwmIconMan/xmanager.c,v
retrieving revision 1.5
diff -r1.5 xmanager.c
424c424,429
<     return b;
---
>   {
>     if ( i == man->buttons.num_windows )
>       return man->buttons.buttons[0];
>     else
>       return b;
>   }
434c439,444
<     return b;
---
>   {
>     if ( i == -1 )
>       return man->buttons.buttons[ man->buttons.num_windows - 1 ];
>     else
>       return b;
>   }

_____
Michael Han ([email-masked])                     voice: (415) 502-7542
Interactive Learning Center Consultant                        (415) 476-4309
San Francisco, California 94143-0840                     fax: (415) 476-4653
"I will not be a snickerpuss." - Lisa

--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
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, 16 Dec 1998 11:40:39 +0100

On Tue, Dec 15, 1998 at 10:16:27PM -0800, [email-masked] wrote:
> I produced it with a simple 'cvs diff' in my current tree:

Please use the -c or -u option to diff. Simple diffs
cannot be applied automatically.

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.hpc.uh.edu/fvwm/>.
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: Michael M Han <[email-masked]>
Date: Wed, 16 Dec 1998 23:29:04 -0800

Previously...
>cannot be applied automatically.

Right, sorry. Here's a context diff instead...

Index: modules/FvwmIconMan/xmanager.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/modules/FvwmIconMan/xmanager.c,v
retrieving revision 1.5
diff -c -r1.5 xmanager.c
*** modules/FvwmIconMan/xmanager.c      1998/11/14 04:40:29     1.5
--- modules/FvwmIconMan/xmanager.c      1998/12/17 06:39:42
***************
*** 421,427 ****
    if (i >= 0 && i < man->buttons.num_windows)
      return man->buttons.buttons[i];
    else
!     return b;
  }
  
  Button *button_prev (WinManager *man, Button *b)
--- 421,432 ----
    if (i >= 0 && i < man->buttons.num_windows)
      return man->buttons.buttons[i];
    else
!   {
!     if ( i == man->buttons.num_windows )
!       return man->buttons.buttons[0];
!     else
!       return b;
!   }
  }
  
  Button *button_prev (WinManager *man, Button *b)
***************
*** 431,437 ****
    if (i >= 0 && i < man->buttons.num_windows)
      return man->buttons.buttons[i];
    else
!     return b;
  }
  
  Button *xy_to_button (WinManager *man, int x, int y)
--- 436,447 ----
    if (i >= 0 && i < man->buttons.num_windows)
      return man->buttons.buttons[i];
    else
!   {
!     if ( i == -1 )
!       return man->buttons.buttons[ man->buttons.num_windows - 1 ];
!     else
!       return b;
!   }
  }
  
  Button *xy_to_button (WinManager *man, int x, int y)

_________
mike ([email-masked])
I will not sell land in Florida
 - The collected wisdom of Bart Simpson
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
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: Tim Phipps <[email-masked]>
Date: Thu, 17 Dec 1998 09:55:00 +0000

> Right, sorry. Here's a context diff instead...

Does this patch make the Up, Down, Left & Right actions wrap?  Before this
patch IconMan is at least consistent and it is possible to do wrapping by
using the conditionals.  From the examples section in the man page:

          bif Next 3, gotobutton 0, select, ret, gotobutton Next, select

     If a button is selected, and it's the  last  button,  go  to
     button  0.  If it's not the last button, go to the next but-
     ton. Otherwise, do nothing. Basically,  this  action  cycles
     through all buttons in the current manager.

If we do put this patch in we should change the man page too.

Cheers,
Tim.

PS There's also mention of a wandering bug at the bottom of the IconMan man
page. Is it safe to remove it?

---

From: Brad Giaccio <[email-masked]>
Date: Thu, 17 Dec 1998 07:47:37 -0500 (EST)

> page. Is it safe to remove it?

Assuming none of the pending patches brake it, yes it is safe to remove
it.  I could repeat this particualr bug at will, just start up an app that
opens several windows, then exit it, this would cause it to walk all over
the place.  Now it starys exactlly where I place it.

Brad

-- 
--- There are two kinds of knowledge, you either know the answer or
			you know where to find it
		      -Kane, Johnson, and anonymous

---

From: Michael M Han <[email-masked]>
Date: Thu, 17 Dec 1998 10:07:53 -0800

Previously from Tim Phipps...
>using the conditionals.  From the examples section in the man page:

No, I didn't address Up, Down, Left & Right. 1) It's more complicated
to do, since it's probably appropriate to tune some behaviors
according to the button gravity; 2) I'm not sure what the preferred
behavior should be. An example case:

FvwmIconMan
1    4    7
2    5
3    6

Say that's an IconMan window showing xterms titled 1-7. From 3, should
"down" go to 1 or to 4? This gets slightly more controversial with,
from 6, should "right" go to 7 or to 3?

>If we do put this patch in we should change the man page too.

Erk. Didn't notice that in the manpage... Well, maybe we should leave
the behavior alone and ignore my patch... Or decide how to do the
above to make up,down,left,right consistent with my patched next,prev.
I'd be willing to take a crack at additional patching on
up,down,left,right, if we want to do that, else ignore my patch and
I'll reconfig and unpatch my IconMan.

>page. Is it safe to remove it?

No idea. I typically have my IconMan swallowed in Buttons, so
wandering's a special case for me, I imagine... mine stays quite
firmly fixed. Otherwise I run it transient, so it generally doesn't
budge within the lifetime of the window. And finally, mine grow down,
then right.
_________
mike ([email-masked])
Nerve gas is not a toy
 - The collected wisdom of Bart Simpson
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
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: Tim Phipps <[email-masked]>
Date: Fri, 18 Dec 1998 11:50:30 +0000

> I'll reconfig and unpatch my IconMan.

I think it's best to ignore the patch. We can leave it to the user to decide on
how to do wrapping.

Cheers,
Tim.