Subject: Pixmap Button fix for Large Pixmaps in 2.0.43

From: Andrew Veliath <[email-masked]>
Date: Thu, 25 Jul 1996 12:06:21 -0400

This fixes the problem with pixmaps larger than buttons on pixmaps
under 2.0.4[23].  The fix has been in my pxp patches which among other
things adds some other features, so this only fixes that problem and
is pretty small.  I hope this gets into 2.1.0.

*** ../orig/fvwm-2.0.43/fvwm/borders.c	Thu Apr 11 11:27:10 1996
--- fvwm-2.0.43/fvwm/borders.c	Thu Jul 25 11:54:01 1996
***************
*** 210,217 ****
  	    {
  	      /* button face max width/height */
  	      a = t->title_height;
! 	      x=(a - pbf.width) / 2; if (x < 0) x = 0; 
! 	      y=(a - pbf.height) / 2; if (y < 0) y = 0;
  	      if (pbf.width > a) pbf.width = a; 
  	      if (pbf.height > a) pbf.height = a;
  	      XClearArea(dpy, t->left_w[i], 0, 0, a + 2, a + 2, False);
--- 210,217 ----
  	    {
  	      /* button face max width/height */
  	      a = t->title_height;
! 	      x=(int)(a - pbf.width) / 2; if (x < 0) x = 0; 
! 	      y=(int)(a - pbf.height) / 2; if (y < 0) y = 0;
  	      if (pbf.width > a) pbf.width = a; 
  	      if (pbf.height > a) pbf.height = a;
  	      XClearArea(dpy, t->left_w[i], 0, 0, a + 2, a + 2, False);
***************
*** 220,227 ****
  	    {
  	      /* button face max width/height */
  	      a = t->title_height - 2;
! 	      x=(a - pbf.width) / 2 + 1; if (x < 1) x = 1; 
! 	      y=(a - pbf.height) / 2 + 1; if (y < 1) y = 1;
  	      if (pbf.width >= a) pbf.width = a - 1; 
  	      if (pbf.height >= a) pbf.height = a - 1;
  	      XClearArea(dpy, t->left_w[i], 1, 1, a - 1, a - 1, False);
--- 220,227 ----
  	    {
  	      /* button face max width/height */
  	      a = t->title_height - 2;
! 	      x=(int)(a - pbf.width) / 2 + 1; if (x < 1) x = 1; 
! 	      y=(int)(a - pbf.height) / 2 + 1; if (y < 1) y = 1;
  	      if (pbf.width >= a) pbf.width = a - 1; 
  	      if (pbf.height >= a) pbf.height = a - 1;
  	      XClearArea(dpy, t->left_w[i], 1, 1, a - 1, a - 1, False);
***************
*** 302,309 ****
  	    {
  	      /* button face max width/height */
  	      a = t->title_height;
! 	      x=(a - pbf.width) / 2; if (x < 0) x = 0; 
! 	      y=(a - pbf.height) / 2; if (y < 0) y = 0;
  	      if (pbf.width > a) pbf.width = a; 
  	      if (pbf.height > a) pbf.height = a;
  	      XClearArea(dpy, t->right_w[i], 0, 0, a + 2, a + 2, False);
--- 302,309 ----
  	    {
  	      /* button face max width/height */
  	      a = t->title_height;
! 	      x=(int)(a - pbf.width) / 2; if (x < 0) x = 0; 
! 	      y=(int)(a - pbf.height) / 2; if (y < 0) y = 0;
  	      if (pbf.width > a) pbf.width = a; 
  	      if (pbf.height > a) pbf.height = a;
  	      XClearArea(dpy, t->right_w[i], 0, 0, a + 2, a + 2, False);
***************
*** 312,319 ****
  	    {
  	      /* button face max width/height */
  	      a = t->title_height - 2;
! 	      x=(a - pbf.width) / 2 + 1; if (x < 1) x = 1; 
! 	      y=(a - pbf.height) / 2 + 1; if (y < 1) y = 1;
  	      if (pbf.width >= a) pbf.width = a - 1; 
  	      if (pbf.height >= a) pbf.height = a - 1;
  	      XClearArea(dpy, t->right_w[i], 1, 1, a - 1, a - 1, False);
--- 312,319 ----
  	    {
  	      /* button face max width/height */
  	      a = t->title_height - 2;
! 	      x=(int)(a - pbf.width) / 2 + 1; if (x < 1) x = 1; 
! 	      y=(int)(a - pbf.height) / 2 + 1; if (y < 1) y = 1;
  	      if (pbf.width >= a) pbf.width = a - 1; 
  	      if (pbf.height >= a) pbf.height = a - 1;
  	      XClearArea(dpy, t->right_w[i], 1, 1, a - 1, a - 1, False);

--
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: "Charles Hines" <[email-masked]>
Date: Thu, 25 Jul 1996 12:50:01 -0400

>>>>> "Andrew" == Andrew Veliath <[email-masked]> writes:

Andrew> This fixes the problem with pixmaps larger than buttons on pixmaps
Andrew> under 2.0.4[23].  The fix has been in my pxp patches which among other
Andrew> things adds some other features, so this only fixes that problem and
Andrew> is pretty small.  I hope this gets into 2.1.0.

I just added it right now.

Chuck