Bug 4578

Summary: The xlock awk script for the desktop menu is incompatible with FvwmForm
Product: [Retired] Red Hat Linux Reporter: David Charlap <shamino>
Component: fvwm2Assignee: Preston Brown <pbrown>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: low Docs Contact:
Priority: medium    
Version: 6.0CC: alfredo.maria.ferrari
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 1999-09-23 20:04:29 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description David Charlap 1999-08-18 01:54:23 UTC
When fvwm2 is used as the desktop, a menu item "Lock Screen
/ Screen Saver" is created.  This menu item pops up a form
using the FvwmForm command.  The form is generated (in
part) by calling xlock and filtering the output through awk.

The problem is the the FvwmForm component of fvwm2 has a
hard-coded limit on the number of items a single form may
have.  The latest xlock (xlockmore-4.13-2) has so many modes
that the resulting form is too big for FvwmForm (as compiled
in fvwm2-2.2-5) to handle, and the dialog doesn't pop up.

If possible, please recompile fvwm2 so that the hard-coded
limit in FvwnForm is large enough to accomodate the form
generated for xlock.  If that is not possible, then perhaps
you can redesign that menu item in a way that will be
compatible.

Thanks in advance.

-- David

Comment 1 David Charlap 1999-08-18 16:14:59 UTC
I was able to work-around this bug by modifying the
/etc/X11/AnotherLevel/fvwm2.xlock.m4 script.  Below is my modified
version:


divert(-1)
# AnotherLevel - A FVWM2 Configuration
# Copyright (C) 1996, 1997 Red Hat Software, Inc
#
#	$Id: fvwm2rc.xlock.m4,v 1.1 1998/04/22 04:22:33 gafton Exp $
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# This work is derived from:
#       TheNextLevel
#       Copyright 1996 By Greg J. Badros <gjb.edu>
# distributed under GNU General Public License.
#
divert

TraceForErrors(`Xlock/Screensaver menus part 1...')

define(`AddXLock1Option',`*XLock1Choice	Option $1 off
"capitalize($1)"')

*XLock1WarpPointer
*XLock1Font 		MEDIUM_FONT
*XLock1ButtonFont 	BASIC_FONT-bold-r-*-120-*
*XLock1InputFont 	MEDIUM_FONT
*XLock1Fore 		WINFORE_COLOR
*XLock1Back 		MENUBACK_COLOR
*XLock1ItemFore 	WINFORE_COLOR
*XLock1ItemBack 	WINBACK_COLOR
*XLock1Line 		center
*XLock1Text 		"Available Xlock modes"
*XLock1Selection	Option single

esyscmd(`xlock -help 2>&1 | awk "BEGIN{item = 0} \
		/^$/ {next} \
		/one of:/ {ok=1; next} \
		/^[ \t]*[a-m]/ && ok==1 \
		{ \
		  if (/random/) { next }; \
		  if (item == 0) { print \"*XLock1Line	expand\" }; \
		  printf(\"AddXLock1Option(%-10s)\\n\", \$1) ; \
		  item = (item+1)%5 ; \
		}"')
# We add the random thing separately, to be sure that we have at least
one
# selected option
*XLock1Choice    Option random 	on 	"Random    "

*XLock1Line	expand
*XLock1Line	expand
*XLock1Line	expand

*XLock1Button	quit "Screen Saver"
*XLock1Command	Exec xlock -nice NICELEVEL -erasemode no_fade -mode
$(Option) -nolock
# somebody is gonna hate me for this one... :-)
*XLock1Button	quit "Background"
*XLock1Command	Exec xlock -nice NICELEVEL -erasemode no_fade -mode
$(Option) -nolock -inroot
*XLock1Button	quit "Lock Screen"
*XLock1Command	Exec xlock -nice NICELEVEL -erasemode no_fade -mode
$(Option)
*XLock1Button	quit "Cancel" ^[
*XLock1Command	Nop

######################################################################
########

TraceForErrors(`Xlock/Screensaver menus part 2...')

define(`AddXLock2Option',`*XLock2Choice	Option $1 off
"capitalize($1)"')

*XLock2WarpPointer
*XLock2Font 		MEDIUM_FONT
*XLock2ButtonFont 	BASIC_FONT-bold-r-*-120-*
*XLock2InputFont 	MEDIUM_FONT
*XLock2Fore 		WINFORE_COLOR
*XLock2Back 		MENUBACK_COLOR
*XLock2ItemFore 	WINFORE_COLOR
*XLock2ItemBack 	WINBACK_COLOR
*XLock2Line 		center
*XLock2Text 		"Available Xlock modes"
*XLock2Selection	Option single

esyscmd(`xlock -help 2>&1 | awk "BEGIN{item = 0} \
		/^$/ {next} \
		/one of:/ {ok=1; next} \
		/^[ \t]*[n-z]/ && ok==1 \
		{ \
		  if (/random/) { next }; \
		  if (item == 0) { print \"*XLock2Line	expand\" }; \
		  printf(\"AddXLock2Option(%-10s)\\n\", \$1) ; \
		  item = (item+1)%5 ; \
		}"')
# We add the random thing separately, to be sure that we have at least
one
# selected option
*XLock2Choice    Option random 	on 	"Random    "

*XLock2Line	expand
*XLock2Line	expand
*XLock2Line	expand

*XLock2Button	quit "Screen Saver"
*XLock2Command	Exec xlock -nice NICELEVEL -erasemode no_fade -mode
$(Option) -nolock
# somebody is gonna hate me for this one... :-)
*XLock2Button	quit "Background"
*XLock2Command	Exec xlock -nice NICELEVEL -erasemode no_fade -mode
$(Option) -nolock -inroot
*XLock2Button	quit "Lock Screen"
*XLock2Command	Exec xlock -nice NICELEVEL -erasemode no_fade -mode
$(Option)
*XLock2Button	quit "Cancel" ^[
*XLock2Command	Nop

######################################################################
########

AddToMenu StartMenu
+ "Lock Screen / Screen Saver (first half) MiniTitleIcon(lock)"
FvwmForm XLock1
+ "Lock Screen / Screen Saver (second half) MiniTitleIcon(lock)"
FvwmForm XLock2
+ "" Nop

Comment 2 Preston Brown 1999-09-23 20:04:59 UTC
thanks for the modified script.  fixed for the next release.