Subject: FVWM: FvwmCascade

From: Rui Monteiro <[email-masked]>
Date: Mon, 17 Nov 1997 14:10:26 +0000

I've made a simple enhancement to FvwmCascade.
The idea is to have the windows constraints to the screen
without resizing them. So if the window slip out of the screen just
begin again in the top or the left (never tryed with flag -desk).
This should be usefull if you have many (>15) windows in one screen.

we now have two more options:
 -mcols : multiple columns
 -mlins : multiple lines

(maybe the name of the options can be changed)

Hope it's usefull. Hope this is the wright way to do these things.

-- 
Rui Monteiro
####################################################################
--- FvwmCascade.c.orig  Mon Nov 17 13:20:13 1997
+++ FvwmCascade.c       Mon Nov 17 13:25:37 1997
@@ -58,6 +58,7 @@
 int resize = 0, nostretch = 0, sticky = 0;
 int flatx = 0, flaty = 0;
 int incx = 0, incy = 0;
+int mlins = 0, mcols = 0;
 
 void insert_window_list(window_list *wl, window_item *i)
 {
@@ -200,12 +201,23 @@
 {
     char msg[128];
     int cur_x = ofsx, cur_y = ofsy;
+       int maxx = (maxw ? maxw : dwidth);
+       int maxy = (maxh ? maxh : dheight);
     window_item *w = reversed ? wins_tail : wins;
     while (w)
     {
        unsigned long nw = 0, nh = 0;
        if (raise_window)
-           SendInfo(fd,"Raise",w->frame);
+               SendInfo(fd,"Raise",w->frame);
+       if( mcols && 
+               ((cur_y+w->height)>maxy) )
+         {
+               cur_y = ofsy;
+         }
+       if( mlins && ((cur_x+w->width)>maxx) )
+         {
+               cur_x = ofsx;
+         }
        sprintf(msg, "Move %up %up", cur_x, cur_y);
        SendInfo(fd,msg,w->frame);
        if (resize) {
@@ -246,6 +258,12 @@
     {
        if (!strcmp(argv[argi],"-u")) {
            untitled = 1;
+       }
+       else if (!strcmp(argv[argi],"-mlins")) {
+           mlins = 1;
+       }
+       else if (!strcmp(argv[argi],"-mcols")) {
+           mcols = 1;
        }
        else if (!strcmp(argv[argi],"-t")) {
            transients = 1;
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
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].