FVWM: Fix for SmartPlacement.

From: Anthony Martin <amartin_at_engr.csulb.edu>
Date: Mon, 21 Oct 1996 22:29:13 -0700 (PDT)

SmartPlacement leaves a 1 pixel gap around every window when it places
them, so you get a 2 pixel gap between any 2 windows and a 1 pixel gap
between any window and the edge of the screen. I find this irritating and
the following patch fixes it. If you prefer, you can also get the entire
placement.c file from http://www.engr.csulb.edu/~amartin/placement.c
This should work with any fairly recent version of fvwm or fvwm95, as the
placement.c file hasn't changed for a long time. This has been well
tested by me (it's a fairly simple change). Let me know if anyone has any
problems.

--- placement.c.orig Mon Apr 24 11:14:08 1995
+++ placement.c Mon Oct 21 22:19:54 1996
_at_@ -31,10 +31,10 @@
   temp_h = height;
   temp_w = width;
       
- while(((test_y + temp_h) < (Scr.MyDisplayHeight))&&(!loc_ok))
+ while(((test_y + temp_h) <= (Scr.MyDisplayHeight))&&(!loc_ok))
     {
       test_x = 0;
- while(((test_x + temp_w) < (Scr.MyDisplayWidth))&&(!loc_ok))
+ while(((test_x + temp_w) <= (Scr.MyDisplayWidth))&&(!loc_ok))
         {
           loc_ok = True;
           test_window = Scr.FvwmRoot.next;
_at_@ -48,19 +48,19 @@
                       th=test_window->frame_height+2*test_window->bw;
                       tx = test_window->frame_x;
                       ty = test_window->frame_y;
- if((tx <= (test_x+width))&&((tx + tw) >= test_x)&&
- (ty <= (test_y+height))&&((ty + th)>= test_y))
+ if((tx < (test_x+width))&&((tx + tw) > test_x)&&
+ (ty < (test_y+height))&&((ty + th)> test_y))
                         {
                           loc_ok = False;
- test_x = tx + tw;
+ test_x = tx + tw - 1;
                         }
                     }
                 }
               test_window = test_window->next;
             }
- test_x +=1;
+ if(!loc_ok) test_x +=1;
         }
- test_y +=1;
+ if(!loc_ok) test_y +=1;
     }
   if(loc_ok == False)
     {




--
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 majordomo_at_hpc.uh.edu.
To report problems, send mail to fvwm-owner_at_hpc.uh.edu.
Received on Tue Oct 22 1996 - 00:29:29 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:59 BST