Subject: rectangle positioning menus

From: Michael Han <[email-masked]>
Date: Thu, 17 Jun 1999 11:12:48 -0700

I was trying to use the "rectangle" context for positioning a menu, as
in:

Key     Escape  A       C       PopUp StartMenu Rectangle 1x20+0-0 \
+0m -0m Fixed

and discovered that the geometry I specify always gives me trouble...
fvwm2 always returns an error citing "invalid rectangle geometry".
Looking at menus.c (I get this for all kinds of geometries that should
be parse-able), I see that the token is being passed to
XParseGeoemtry.

I cracked out gdb, and here's what I saw:

Breakpoint 4, GetMenuOptions (
    action=0x8098680 "Rectangle =1x20+0-0 +0m -0m Fixed", w=8388698, 
    tmp_win=0x8096fb8, mr=0x0, mi=0x0, pops=0xbffff45c) at menus.c:6115
6115          flags = XParseGeometry(tok, &x, &y, &width, &height);
(gdb) print naction
$6 = 0x809868a "=1x20+0-0 +0m -0m Fixed"
(gdb) print tok
$7 = 0x80985a0 "Rectangle"
(gdb) print taction
$8 = 0x8098680 "Rectangle =1x20+0-0 +0m -0m Fixed"

Without spending a lot of time here I'm not exactly sure what's
supposed to happen here. Should tok be free()'d before a GetNextToken
is called? Whatever the case, I think this is also a problem in the
2.2 branch, because I had the same problem back with 2.1.x in February
or March and just assumed I didn't understand the Menu positioning
hints syntax.
-- 
[email-masked]                         http://www.best.com/~mikehan/
coffee achiever                              San Francisco, California
"Compulsory education is inconstitutional" - graffitti I saw in the subway
--
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: Dominik Vogt <[email-masked]>
Date: Fri, 18 Jun 1999 01:45:48 +0200

> Key     Escape  A       C       PopUp StartMenu Rectangle 1x20+0-0 \

If you're trying to position you start menu the position hints are
not correct. Use '+0m -100m'. '+0m' is the same as '-0m'.

> fvwm2 always returns an error citing "invalid rectangle geometry".

Right. There were two bugs that caused even correct rectangles to fail.

> $8 = 0x8098680 "Rectangle =1x20+0-0 +0m -0m Fixed"

Fixed.

> is called?

Yes. GetNextToken mallocs the string. Perhaps I'll rewrite most parsing
to use PeekToken instead (just copies the string into a static memory area).

> Whatever the case, I think this is also a problem in the

Bye

Dominik ^_^

--
Dominik Vogt, [email-masked]
Reply-To: [email-masked]
--
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]