On Tue, Mar 11, 2008 at 05:21:27PM +0100, Viktor Griph wrote: > This is something I noticed a while back, but put aside fixing it since > it's not very severe, and I couldn't think of what the solution should > be. > > The issue is that it is possible to create several menus with the same > name, the latest definition being used inplace of earlier definitions, but > the earlier definitions coming back to like when the menu is destroyed. > > This is done by (ab)use of the menu specific sidepic feature: > > AddToMenu looks for an existing menu matching the exact string given for > the menu name, but creates a menu whe the name has had the side pic > component removed. My initial thought of a solution was to just parse the > name, and rid it of the sidepick info when looking for what menu to add > to. But then I thought: "What would the user want by specifying a sidepic > when adding ot an existing menu?" I couls not answer that, and still > can't, that's why I start this thread. What should fvwm do in this case? > > My thoughts were: > A. ignore the sidepic info and add to the original menu as if no sidepic > were specified > B. give an informative error to the user and do nothing > C. Combine A with B as a warning > D. A if the sidepic matches the one in the menu already else B > E. Set/change the sidepic of the menu to the sidepic specified and > continue > F. something else
The menu syntax is flawed. I'd simply document this and leave it for a future cleanup of the syntax. It is definitely not worth the effort to clean up the situation without fixing the syntax. The syntax is the root cause of the problem, not the coding. And as far as I remember, specifying colours and pixmaps in the menu title is obsolete because the same can be done in a clean way using menu styles (teaching the users how to do that is a different story). > I still don't know which of these options that is the "correct" solution. > > Test case: > > AddToMenu TestMenu "Foo" DestroyMenu TestMenu > AddToMenu [EMAIL PROTECTED]@ "Bar" DestroyMenu TestMenu > Menu TestMenu > Menu TestMenu > > And another test case: > > AddToMenu TestMenu@@some_image@@ "Foo" DestroyMenu [EMAIL PROTECTED]@ > AddToMenu [EMAIL PROTECTED]@ "Bar" DestroyMenu [EMAIL PROTECTED]@ > AddToMenu TestMenu@@some_image@@ "Baz" DestroyMenu [EMAIL PROTECTED]@ > Menu [EMAIL PROTECTED]@ > Menu [EMAIL PROTECTED]@ > > > In the above test cases some_image may be replaced with an existing image, > but that is not required for the bug to be reproduced. Ciao Dominik ^_^ ^_^ -- Dominik Vogt
