FVWM: FvwmIconMan Bug?

From: Bill Rugolsky Jr. <rugolsky_at_ead.dsa.com>
Date: Mon, 23 Dec 1996 15:45:26 -0500 (EST)

I are currently migrating from vtwm to fvwm-2.0.43 on SunOS 4.1.3 and
Solaris 2.5.1. My enviroments are as follows:

 VERSION: fvwm-2.0.43, FvwmIconMan 0.9 (and prior)
COMPILER: gcc-2.7.2
 OPTIONS: -O2 -DSHAPE -DPIXMAP_BUTTONS -DXPM

      OS: SunOS 4.1.4 OS: SunOS 5.5.1
  SERVER: MIT X11R5 SERVER: Sun Microsystems, Inc. 3.51

In the process of migrating, I have uncovered the following problems
with FvwmIconMan:

1. The configuration option:

     *FvwmIconMan*resolution page

causes FvwmIconMan to exhibit buggy behavior when switching pages; in
particular, there appears to be an off-by-one error in the viewport
bounds-checking logic. This bug causes a window that abuts the edge
of the screen to appear in the icon manager on multiple pages. I
traced the bug to the function win_in_viewport() in file
modules/FvwmIconMan/fvwm.c . Rather than attempt to debug the logic,
I just simplified it. The new function definition and context diff are
appended to this message.

2. There appears to be a problem with the "dontshow" configuration
option. We have a misbehaving news application that continuously
updates the icon name and title with progress information. This produces
unpleasant behavior, particularly over ISDN. I tried using the following
lines in my .fvwm2rc to suppress the headline window in the icon manager:

    Style "*Query*Headline*" Icon news.xpm
    Style "*received*of*" Icon news.xpm
    *FvwmIconMan*dontshow *Query*Headline*
    *FvwmIconMan*dontshow *received*of*

This has the desired effect upon starting the application. However, if
I iconify the window, it suddenly appears in the icon manager. Under
FvwmIconMan-0.5, it remained in the icon manager. Using FvwmIconMan-0.9,
the icon is removed from the icon manager when it is de-iconified. I tried
creating separate lines with title= and icon= before the patterns, but
this did not affect the behavior. I have successfully worked around the
problem by using the "WindowListSkip" style for these patterns, in place
of the "dontshow" option to FvwmIconMan.

Many thanks to everyone who has worked to make Fvwm the best window
manager available!

Sincerely,

   Bill Rugolsky
   Daiwa Securities America, Inc.
   rugolsky_at_ead.dsa.com

--------------------------------------------------------------------------------

static int win_in_viewport (WinData *win)
{
  WinManager *manager = win->manager;
  int flag = 0;
  
  assert (manager);

  switch (manager->res) {
  case SHOW_GLOBAL:
    flag = 1;
    break;

  case SHOW_DESKTOP:
    if (win->sticky || win->desknum == globals.desknum)
      flag = 1;
    break;

  case SHOW_PAGE:
    if (win->sticky) {
      flag = 1;
    } else if (win->desknum == globals.desknum) {
      /* win and screen intersect if they are not disjoint in x and y */
      flag = !((win->x+win->width <= 0) || (win->x >= (long)globals.screenx) ||
               (win->y+win->height <= 0) || (win->y >= (long)globals.screeny));
    }
    break;
  }
  return flag;
}


------------------------------ cut here ----------------------------------------
*** fvwm.c.orig Sun Dec 8 16:34:02 1996
--- fvwm.c Mon Dec 23 12:41:07 1996
***************
*** 145,151 ****
  static int win_in_viewport (WinData *win)
  {
    WinManager *manager = win->manager;
- long xmin, xmax, ymin, ymax;
    int flag = 0;
    
    assert (manager);
--- 145,150 ----
***************
*** 161,269 ****
      break;
  
    case SHOW_PAGE:
- #if 0
- if (win->sticky || (win->desknum == globals.desknum &&
- win->x >= 0 && win->x < globals.screenx &&
- win->y >= 0 && win->y < globals.screeny))
- {
- }
- #endif
- xmin = win->x;
- xmax = win->x + win->width;
- ymin = win->y;
- ymax = win->y + win->height;
-
- /* cases: (1) one of the corners is inside screen - handled here
- (2) one of the edges intersects an edge of the screen
- (3) (1) with window and screen reversed
- */
-
- /* case 1:
-
- xmin >= 0 && xmin < screex && ymin >= 0 && ymin <= screeny
- ||
- xmin >= 0 && xmin < screex && ymax >= 0 && ymax <= screeny
- ||
- xmax >= 0 && xmax < screex && ymin >= 0 && ymin <= screeny
- ||
- xmax >= 0 && xmax < screex && ymax >= 0 && ymax <= screeny
-
- goes to:
-
- xmin && (ymin || ymax)
- ||
- xmax && (ymin || ymax)
-
- goes to:
-
- (xmin || xmax) && (ymin || max)
-
- */
-
- /* Case 2:
-
- xmin <= 0 && xmax >= 0 && ymin >= 0 && ymin <= screeny ||
- xmin <= screenx && xman >= screenx && ymin >= 0 && ymin <= screeny ||
- ymin <= 0 && ymax >= 0 && xmin >= 0 && xmax <= screenx ||
- ymin <= screeny && ymax >= screeny && xmin >= 0 && xmax <= screenx
-
- goes to:
-
- (ymin >= 0 && ymin <= screeny) &&
- (xmin <= 0 && xmax >= 0 || xmin <= screenx && xmax >= screenx) ||
- (xmin >= 0 && xmax <= screenx) &&
- (ymin <= 0 && ymax >= 0 || ymin <= screeny && ymax >= screeny)
-
- */
-
- ConsoleDebug ("Screenx = %d, Screeny = %d\n", globals.screenx,
- globals.screeny);
- ConsoleDebug ("Window (%s) coords: (%d, %d), (%d, %d)\n", win->iconname, xmin, ymin, xmax, ymax);
      if (win->sticky) {
- ConsoleDebug ("Sticky\n");
        flag = 1;
      }
! else if (win->desknum == globals.desknum) {
! if (((xmin >= 0 && xmin < globals.screenx) ||
! (xmax >= 0 && xmax < globals.screenx)) &&
! ((ymin >= 0 && ymin < globals.screeny) ||
! (ymax >= 0 && ymax < globals.screeny))) {
! ConsoleDebug ("Window in screen\n");
! flag = 1;
! }
! else if (((ymin >= 0 && ymin < globals.screeny) &&
! ((xmin <= 0 && xmax >= 0) ||
! (xmin < globals.screenx && xmax >= globals.screenx))) ||
! ((xmin >= 0 && xmax <= globals.screenx) &&
! ((ymin <= 0 && ymax >= 0) ||
! (ymin < globals.screeny && ymax >= globals.screeny)))) {
! ConsoleDebug ("Screen - window cross\n");
! flag = 1;
! }
! else if (((0 > xmin && 0 < xmax) ||
! (globals.screenx > xmin && globals.screenx < xmax)) &&
! ((0 > ymin && 0 < ymax) ||
! (globals.screeny > 0 && globals.screeny < ymax))) {
! ConsoleDebug ("Screen in window\n");
! flag = 1;
! }
! else {
! ConsoleDebug ("Not in view\n");
! ConsoleDebug ("xmin = %d\txmax = %d\n", xmin, xmax);
! ConsoleDebug ("ymin = %d\tymax = %d\n", ymin, ymax);
! ConsoleDebug ("screenx = %d\tscreeny = %d\n", globals.screenx,
! globals.screeny);
! ConsoleDebug ("Expr: %d\n",
! ((0 >= xmin && 0) < xmax ||
! (globals.screenx >= xmin && globals.screenx < xmax)) &&
! ((0 >= ymin && 0 < ymax) ||
! (globals.screeny >= 0 && globals.screeny < ymax)));
!
! }
! }
! else {
! ConsoleDebug ("Not on desk\n");
! }
    }
    return flag;
  }
--- 160,173 ----
      break;
  
    case SHOW_PAGE:
      if (win->sticky) {
        flag = 1;
+ } else if (win->desknum == globals.desknum) {
+ /* win and screen intersect if they are not disjoint in x and y */
+ flag = !((win->x+win->width <= 0) || (win->x >= (long)globals.screenx) ||
+ (win->y+win->height <= 0) || (win->y >= (long)globals.screeny));
      }
! break;
    }
    return flag;
  }
--
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 Mon Dec 23 1996 - 15:16:49 GMT

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