Subject: Patch: 2.2.0/FvwmIconBox with Icon forced to zero height

From: Andreas Karrer <[email-masked]>
Date: Thu, 1 Apr 1999 22:34:24 +0200 (MET DST)

I use fvwm-2.2 with the FvwmIconBox module. I only want icon labels, not
  the real icons, thus I set

     *FvwmIconBoxMaxIconSize 63x0

  in .fvwm2rc.

  This causes a third-party Java program to display a stack trace before
  even drawing a window:

        Exception in thread "main" java.lang.IllegalArgumentException: \
                    Width (73) and height (0) must be > 0
        at java.awt.image.Raster.createInterleavedRaster(Compiled Code)
        ...

  The problem goes away if I set MaxIconSize to something nice like 48x48.

  I don't pretend to understand the FvwmIconBox module in its entirety,
  but I played around with the `max_icon_height' variable, and the
  patch below fixes the problem and hopefully doesn't create new ones.

  - Andi Karrer

*** modules/ChangeLog.orig	Tue Feb 16 17:11:45 1999
--- modules/ChangeLog	Thu Apr  1 22:15:07 1999
***************
*** 1,3 ****
--- 1,8 ----
+ 1999-04-01  Andi Karrer <[email-masked]>
+ 
+ 	* FvwmIconBox/FvwmIconBox.c (main):
+ 	XSetIconSizes() should not be called with a height of 0.
+ 	
  1999-02-14  Dominik Vogt  <[email-masked]>
  
  	* FvwmIconBox/FvwmIconBox.c (RelieveWindow):
*** modules/FvwmIconBox/FvwmIconBox.c.orig	Tue Feb 16 17:11:48 1999
--- modules/FvwmIconBox/FvwmIconBox.c	Thu Apr  1 22:05:00 1999
***************
*** 223,229 ****
  
    if ((local_flags & SETWMICONSIZE) && (size = XAllocIconSize()) != NULL){
      size->max_width  = size->min_width  = max_icon_width + icon_relief;
!     size->max_height = size->min_height = max_icon_height + icon_relief;
      size->width_inc  = size->height_inc = 0;
      XSetIconSizes(dpy, Root, size, 1);
      XFree(size);
--- 223,230 ----
  
    if ((local_flags & SETWMICONSIZE) && (size = XAllocIconSize()) != NULL){
      size->max_width  = size->min_width  = max_icon_width + icon_relief;
!     /* max_height should be >0 */
!     size->max_height = size->min_height = max(1, max_icon_height) + icon_relief;
      size->width_inc  = size->height_inc = 0;
      XSetIconSizes(dpy, Root, size, 1);
      XFree(size);

-- 
"With DIGITAL UNIX Version 4.0D, the maximum number of UIDs and GIDs allowed
increases from 65,535 (16 bits) to 2,147,483,647 (31 bits). Note that this
increase does not mean that 2.14 million [sic] users can simultaneously log
into a system"                 -- Release Notes for Digital UNIX Version 4.0D
--
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]