Re: FVWM: RaiseWindow bug fix

From: Austin Donnelly <and1000_at_cam.ac.uk>
Date: Thu, 13 Jun 96 12:43 BST

On Thu, 13 Jun 1996, Richard Lister wrote:

> Aha! I should have checked the archive first :-). Strange that I missed
> your fix when it was first posted ... I must have read that message
> before my first coffee of the day!

I posted it on 19th April. I still have my original emails, which I
include below.

> Incidentally, I note Chuck said this doesn't happen under AIX. Is it
> a bug in some implementations of XRestackWindows(), not treating the
> array index i as authoritative and stopping at NULL array members?
> Or a feature :-) I'm on Irix 6.2 (X11R6).

Yes, I think it's due to some X servers attempting to protect
themselves from poorly written programs :)

Austin
------------------------------------------------------------
On Fri, 19 Apr 1996, Austin Donnelly wrote:

> In fvwm-2.0.42, if you deiconify a window without an icon associated
> with it, it appeared behind all other windows, but is entered in
> fvwm's idea of things as the top-most window.
>
> This can be demostrated by 'raise-or-lower'ing it.
>
> To see this:
>
> 1) Iconify a window that doesn't have an icon specified.
> -> iconised window is now just a small recangle of text
> 2) deiconify it.
> -> window comes back, but displayed at the bottom stacking order
> on screen
> 3) raise-or-lower the window.
> -> nothing happens, since fvwm thinks the window is at the top,
> so it sends it to the bottom (it's already at the bottom).
> 4) raise-or-lower the window again.
> -> now comes to the front for the first time.
>

Ok, I've got a fix for it:

------------------------------------------------------------
--- misc.c~ Mon Mar 11 18:27:35 1996
+++ misc.c Fri Apr 19 18:05:15 1996
_at_@ -686,8 +686,10 @@
 #endif
   if ((t->flags & ICONIFIED)&&(!(t->flags & SUPPRESSICON)))
     {
- if(!(t->flags & NOICON_TITLE))wins[i++] = t->icon_w;
- wins[i++] = t->icon_pixmap_w;
+ if(!(t->flags & NOICON_TITLE))
+ wins[i++] = t->icon_w;
+ if (t->icon_pixmap_w)
+ wins[i++] = t->icon_pixmap_w;
     }
   if(!(t->flags & ONTOP))
     wins[i++] = t->frame;
------------------------------------------------------------

Basically, what was happening was that when building a list of windows
to be raised, it would include icon_pixmap_w, which was a NULL (since
the window had no icon).

The list of windows to be raised was passed to the X server in the
  XRestackWindows(dpy,wins,i);
call. In this call, X was taking the NULL in wins to mean the end of
the list, rather than relying on i. Since the main window is in wins[]
after the NULL, it never got re-stacked.

Austin
--
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 Thu Jun 13 1996 - 06:47:02 BST

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