Subject: FVWM: SmartPlacement ignores FvwmIconMan

From: "Jakob Ess" <[email-masked]>
Date: Tue, 02 Dec 1997 02:23:35 PST

Hi FVWM-list!

I think I have found a bug:  I use SmartPlacement (and 
SmartPlacementIsReallySmart), and at the same time I have a FvwmIconMan 
and a FvwmButtons module, both are StaysOnTop.  When placing new 
windows, Fvwm should avoid overlap with StaysOnTop windows, this works 
fine with FvwmButtons, but apparently the smartplacement algorithm 
cannot see the FvwmIconMan window, it is not even avoided as a normal 
window would be.

Below I have attached a rather minimal .fvwmrc that shows the problemm 
it is too minimal to be of any other use :-)

[Brady Montz: I reported this earlier to the list, and promised you to 
send a minimal .fvwm2rc if I could reproduce it with 2.0.46 and 
FvwmIconMan 1.0.  Well after upgrading I must say that I can, and that I 
have not been able to modify my config so that I do not see it, although 
I didn't try very hard.]

Best regards, and thanks for any help.

Jakob

--------------------- .fvwm2rc ------------------------
PixmapPath 
/home/schiotz/pixmaps:/usr/include/X11/pixmaps:/usr/local/include/X11/pixmaps
IconPath   /home/schiotz/bitmaps:/usr/include/X11/bitmaps

HilightColor		#fff0dc \#904048
Style "*" Color #fff0dc/#407080

MenuStyle black grey slategrey 7x13bold fvwm

WindowFont              9x15
IconFont                9x15

Style "*" SloppyFocus

EdgeScroll 0 0
EdgeResistance 500 20

DeskTopSize 2 2

Style "*" SmartPlacement
GlobalOpts SmartPlacementIsReallySmart

Style "*" BorderWidth 5, HandleWidth 5

Style "Fvwm*"		NoTitle, Sticky, WindowListSkip, HandleWidth 0, 
StaysOnTop

AddToFunc "InitFunction"
+		"I" Module FvwmButtons
+		"I" Wait FvwmButtons
+		"I" Exec xterm
+		"I" Module FvwmIconMan
+		"I" Wait FvwmIconMan

AddToFunc "RestartFunction"
+		"I" Module FvwmButtons
+		"I" Module FvwmIconMan
+		"I" Next [!iconic CurrentScreen] Focus

## Buttons actually being used (duplicated below)
# Large up Triangle
ButtonStyle 2 4 50x25@1 75x75@0 25x75@0 50x25@1
# Large down Triangle
ButtonStyle 4 4 50x75@1 25x25@1 75x25@1 50x75@0
# Stylized X
ButtonStyle 3 16 20x20@1 30x20@1 50x40@1 70x20@1 80x20@1 80x30@0 60x50@0 
80x80@0 70x80@0 50x60@0 30x80@0 20x80@0 20x70@0 40x50@1 20x30@0 20x20@1

############################################################################
# FvwmButtons
#
# Colors
*FvwmButtonsFore Black
*FvwmButtonsBack grey75

# Font 
*FvwmButtonsFont	7x13

# Geometry-- really likes to pick its own size, but giving a position is 
OK
*FvwmButtonsGeometry -2+0

# Layout: specify rows or columns, not both
*FvwmButtonsColumns 1

# Define the buttons to use.....
*FvwmButtons(Swallow "FvwmPager" "FvwmPager 0 0")
*FvwmButtons(Size 0 55, Swallow "xclock" "Exec xclock -padding 1 -bg 
grey75 -fg black -hd Blue -hl black -geometry -1500-1500 &") 
*FvwmButtons xterm xterm_sm.xpm	Exec "xterm" xterm -sb -sl 500 -j &

############################################################################
# FvwmPager
#
*FvwmPagerBack grey75
*FvwmPagerHilight grey50
*FvwmPagerFore black
*FvwmPagerFont -adobe-helvetica-bold-r-*-*-10-*-*-*-*-*-*-*
*FvwmPagerGeometry +1500+1500

# Setting the font to 0x0 or nil2 results in no text
*FvwmPagerFont none

*FvwmIconMan*nummanagers		1
*FvwmIconMan*background		#c0c0c0
*FvwmIconMan*foreground		black
*FvwmIconMan*format			"%i (%c)"
*FvwmIconMan*buttongeometry		320x0
*FvwmIconMan*managergeometry	3x1+0-0
*FvwmIconMan*drawicons		false
*FvwmIconMan*resolution		page
*FvwmIconMan*followfocus		true
*FvwmIconMan*focusbutton		down black #c0c0c0
*FvwmIconMan*focusandselectbutton	down black #e0e0e0
*FvwmIconMan*selectbutton		up black #e0e0e0

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
--
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 [email-masked].
To report problems, send mail to [email-masked].

---

From: Anthony Martin <[email-masked]>
Date: Tue, 2 Dec 1997 13:42:24 -0800 (PST)

> cannot see the FvwmIconMan window, it is not even avoided as a normal 

I think this is a bug with FvwmIconMan rather than with CleverPlacement
(SmartPlacementIsReallySmart).  There are some flags which must be set on
windows so that their state is known.  i.e. are they visible, iconified,
unmapped, etc.  CleverPlacement must know if a window is iconified or
unmapped so it knows how to handle it.  I believe that FvwmIconMan is
setting the ICONIFIED and/or ICON_UNMAPPED flags wrong, so
CleverPlacement believes that the window isn't actually there.

I may be wrong, but perhaps the maintainer of FvwmIconMan can take a look
at this?

Tony.

---

From: Brady Montz <[email-masked]>
Date: 03 Dec 1997 09:22:52 -0700

> I may be wrong, but perhaps the maintainer of FvwmIconMan can take a look

Where are these flags? All FvwmIconMan does is call XMapWindow. Fvwm should be 
able to figure out the iconified status of the FvwmIconMan windows without any 
more than that.

-- 
 Brady Montz
 [email-masked]

---

From: Anthony Martin <[email-masked]>
Date: Wed, 3 Dec 1997 22:21:12 -0800 (PST)

> able to figure out the iconified status of the FvwmIconMan windows without any 

I'm not sure who is responsible for setting these flags, but when
CleverPlacement is trying to figure out the state of I window, I have
tests such as if(window->flags & ICONIFIED) and if(!(window->flags &
ICON_UNMAPPED)) to determine the status of the window.  For some reason, I
think the FvwmIconMan window has bogus values for these flags.
It has been a few months since I looked at this code, and perhaps it is
something else, but if I remember correctly this is what is confusing
CleverPlacement.

Tony.

---

From: Brady Montz <[email-masked]>
Date: 04 Dec 1997 15:21:33 -0700

Anthony Martin <[email-masked]> writes:

> > Where are these flags? All FvwmIconMan does is call XMapWindow. Fvwm
> > should be able to figure out the iconified status of the FvwmIconMan
> > windows without any more than that.
> 

Well, those are just internal flags in fvwm. It's responsible for making sure
they are correct.