Subject: 2.3.16, do_windowList, "Function" ignored except for first window in list

From: [email-masked]
Date: Sat, 22 Apr 2000 10:46:40 -0600

Configuration Information [Automatically generated, do not change]:
uname output: Linux kona 2.2.14 #5 SMP Tue Apr 4 14:42:52 MDT 2000 i686 unknown
Compiler: gcc
Compilation CFLAGS: -g -O2
prefix: /usr/local
sysconfdir: /usr/local/etc
libexecdir: /usr/local/libexec

FVWM Version: 2.3.16
FVWM_CONFIGDIR: unset
FVWM_MODULEDIR: unset
FVWM_USERHOME: unset

Description:
	[Detailed description of the problem, suggestion, or complaint.]

	When creating a WindowList and using the "Function funcname" option,
	the function is only used for the first item in the WindowList. All
	other items use the WindowListFunc function.

	I believe that this is also in the latest snapshot, 20000422.

Repeat-By:
	[Describe the sequence of events that causes the problem
	to occur.]

	In a .fvwm2rc:

	##
	## Make sure the default WindowListFunc be a nop.
	##
	DestroyFunc WindowListFunc

	##
	## This should do what the the default WindowListFunc does.
	##
	AddToFunc TakeMe
	+ I WindowId $0 Iconify off
	+ I WindowId $0 FlipFocus
	+ I WindowId $0 Raise
	+ I WindowId $0 WarpToWindow 5p 5p

	##
	## Create a WindowList
	##
	Mouse 3	R	N	WindowList Function TakeMe

	Start up fvwm2, open some windows, iconify them, and then
	right click on the root window. When the WindowList pops up,
	try selecting different items.

	The function TakeMe will apply only to the first window (item) in
	the list. The other items will do nothing (WindowListFunc).

Fix:
	[Description of how to fix the problem.  If you don't know a
	fix for the problem, don't include this section.]

	It looks like the pointer func is freed and set to null
	inside a for loop in do_windowList. I just removed the
	free and the "func = NULL;" statement and my WindowList's
	*seem* to work ok. It doesn't seem like there's any reason
	to free func inside the for loop. Its value is used in the for loop.
	It's free'd after the for loop anyway and it's not assigned to 
	anywhere in the for loop or before the free after the loop.
	
--
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]

---

From: Mikhael Goikhman <[email-masked]>
Date: Sun, 23 Apr 2000 00:47:01 +0300

> 	inside a for loop in do_windowList.

You are right, thank you. Fixed.

Regards,
Mikhael.