Place Submenu's Title *Above* the Highlighted Menu Item

Place Submenu’s Title Above the Highlighted Menu Item

  • Yes, I like submenu’s title to be Above the highlighted menu item (like in Fluxbox or WindowMaker)
  • No, I’m happy with FVWM’s default behavior

0 voters

In FVWM, when the menu item is selected (highlighted) and the submenu appears, it is placed in a way that the submenu’s title is on the same level with that selected (highlighted) menu item. This is the default behavior for TWM/MWM/CDE/ but it annoys me a lot.

Here’s the example of this behavior in CDE

In other window managers (WindowMaker, PekWM, Fluxbox), the submenu’s title is placed above the level of the highlighted menu item, so that the first entry of that submenu is on the same level with the highlighted menu item. In my opinion, this is a more ergonomic approach.

Here’s the example of this behavior in Fluxbox and WindowMaker

Can somebody please add this feature? As far as I know, there’s no option (Style) to place the submenu’s title above the highlighted menu item.

Thank you for reading my request. If you need further explanations, don’t hesitate to ask me.

Look at the Menu and Popup command in the man page, you can configure where the menu is placed.

Hi somiaj!

Thank you for a reply. Of course, I’ve read the paragraphs on Menu, Popup, and their placement before asking a question here, but the description is still not clear to me.

  1. It implies that I have to add something like "Item " after every single "Popup " statement I have. Is there a way (defining a variable, adding a function… whatever) to write it once and for all the submenus I have (including dynamic menus, too)?

  2. The offset value can be either in percents (which means that the position will always be sort of “unpredictable”), or by specifying “m” for width/height, or “p” for pixels. How do I even calculate these values? The only thing I can think of is making a screenshot and counting the pixels manually. This is a dumb approach.

Maybe there’s something I’m missing? If you or somebody else would want to make the submenus behave as they behave in Fluxbox/PekWM/WindowMaker (see my first post for explanation), how would you do that?

Thanks a million.

You will most likely want to use an offset in pixels, and the number of pixels will depend on the font and the height of the title. But With some trial and error you can offset each menu position by some pixels, pushing up the title so the alignment is similar to fluxbox.

I’m unsure on the details, so I can only point to the man page, and didn’t take time to experiment and try it out. It may take some fiddling with, but I have other menus of mine whose popups all line up with a panel, so I know it can be done, just haven’t tried your use case.

As for a variable, you could use InfoStore and store the offset in a variable if needed. It depends on how often you need to change this. I would just hard code it myself once I got my offset figured out.

Hello again!

That’s what I was thinking at first. Although, it seemed to me there had to be a better solution. Sorry my lame explanation below (I’m not a programmer, just a user):

So there’s no way to figure out the offset value “automatically”? I have to measure the pixels each time I change the font, or change the values of “VerticalMargins”, “VerticalItemSpacing”, and “VerticalTitleSpacing” (or even TitleUnderlines1 or TitleUnderlines2) in MenuStyle? And the overall value (number of pixels the title takes) is not calculated and stored somewhere by FVWM, so that I could get the value somehow and put it into a variable? Not that I change things often, but it just seems a bit silly to do so many manual operations to achieve such a simple effect (of placing the menu’s title above), especially given FVWM’s flexibility and configurability. Nevermind :slight_smile:))

OK, let’s suppose I’ve measured the value. Is there a way to tell FVWM something like “I want all my menus that have a title to be placed above that many pixels”? Is there a way to do this once, for all the submenus I have (writing a wildcard, a function or a set of variables), or do I need to add it to each of the Popup statements I have throughout my config? It’s not that modifying even hundreds of lines is a problem, but this just doesn’t seem flexible in this case.

Yes, I know about InfoStoreAdd: I just define the value, and then it will insert the text whenever I place the variable. Very convenient (and one of the killer features of FVWM).

Thanks! You’ve been very helpful.

The idea of doing this makes sense to me, and I was able to move the submenu title upwards by the right amount after some trial and error, but I found that this broke the “Animated” style if I opened my root menu then submenu close to the right hand side of the screen. Pity. :frowning:

PainlessRob, may I please see the snippet of your config that does it?

The only solution I could think of was adding same instructions to each individual Popup command. I still hope there is (or should be) a better way to do this.

You mean this?

MenuStyle "*" Animation

Then somebody should probably publish an issue about this on GitHub (I don’t have an account, and I never will after it’s been bought by Micro$oft).

If “[t]he idea of doing this makes sense to [you]”, can you please vote for this feature?

I still think this kind of behavior deserves a separate option. It is more ergonomic: the functional elements you are directly interacting with (items) don’t mix with informational element (titles); and most window managers place the submenu’s title above anyway without any need to calculate the pixels or add instructions to any menu line.

But because it is not there yet, I think most users/developers are happy with the default. So the only way to change this - and enable this behavior - is either to do this manually (probably for each individual menu), or by adding a new MenuStyle style.

Sure, but it is as you suspected, the same instruction for each Popup command:

[code]+ %apps/$[MENUICONSIZE]/application-default-icon.png%“Accessories” Popup “xdg_menu-Accessories” Item +99 -111

  • %places/$[MENUICONSIZE]/folder.png%“Archlinux” Popup “xdg_menu-Archlinux” Item +99 -111
  • %apps/$[MENUICONSIZE]/gnome-aisleriot.png%“Games” Popup “xdg_menu-Games” Item +99 -111
  • %apps/$[MENUICONSIZE]/mypaint.png%“Graphics” Popup “xdg_menu-Graphics” Item +99 -111
  • %apps/$[MENUICONSIZE]/browser.png%“Internet” Popup “xdg_menu-Internet” Item +99 -111

I have since backed this out because I prefer the menu animation feature.

Hi, Painless Rob!

It works! Thank you.

You are right, it does break the MenuStyle "*" Animation style. For me, however, ergonomic placement of the menus is more important than animations (I hardly ever open my menus close to the side of the screen).

I also noticed that the values in “Item x y” sort of “conflicts” with the first value of “PopupOffset” MenuStyle, and that it also needs changing if BorderWidth is changed.

But other than that, it worked great for me. :slight_smile: