PopupMenu in Linux with many entrys will display many blank lines at top

In my app, I have a popup menu with dozens of entries. Linux is always displaying the clicked popup using the entire height of the monitor. If I click on the menu that is set to an entry that is near the beginning, Linux displays many blank entries at the top. Clicking on the an entry set near the end, Linux displays many blank entries on the bottom.

Below is an image of what I am seeing on Linux. Sorry for using my phone to take the photo. I can’t figure out how to get Linux to take a screen shot while the popup is expanded using MouseDown.

In all other respects, the popup is working as it should. Linux will not let me click on any of the blank entries. On my Mac or Windows app, the menu always starts at the location of the control and goes down.

Am I missing some property in the DesktopPopupMenu that would affect this? Or is the normal behavior for popup menus with many rows in Linux? Other popup menus in my app with just a few entries do not have this problem.

I’m using Linux Mint Cinnamon and Xojo2025r2.1

Can you select one of these “blank lines”?

How does it look if you select entry no. 20 for example and open the popup again?

It would be helpful to see the code you’re using to populate that menu.

1 Like

Looks the same on Ubuntu. Since you have so many rows, the popupmenu uses the whole vertical space your screen offers, to make selection for the user easier. macOS does the same, but intelligently expands only down to the screen, if one of the first rows is selected. May a cosmetic glitch that can be fixed?

If I select a blank line, the popup menu restores itself to the item already selected when the MouseDown event that expanded the menu occurred.

Here is the code used to load the menu:

Var theList() As String = Array("Piccolo", "Flute", "Alto Flute", "Bass Flute", "Oboe", "English Horn", _ 
"Argol", "Shawm", "Shenai", "Musette", "Bassoon", "Contrabassoon", _ 
"Woodwinds", "Shakuhachi Flute", "Bansuri Flute", "Pan Flute", "Wood Flute", _
"Recorder", "Soprano Recorder", "Alto Recorder", "Tenor Recorder", "Bass Recorder", _
"Sopranino Clarinet", "Alto Clarinet", "Bassett Horn", "Bass Clarinet", _ 
"Harmonica", "Bass Harmonica", "Melodica")

pmMenu.RemoveAllRows
Var theRow As Integer = 0
For Each ax As String In theList
  pmMenu.AddRow ax
  pmMenu.RowTagAt(pmMenu.LastAddedRowIndex) = theRow
  theRow = theRow + 1
Next

pmMenu.SelectedRowIndex = 0

Here is the simple project I’m using.

Popup Menu Playground.zip (8.5 KB)

Just to update those that care, my one and only Linux user tells me this regarding the issue with the blank lines in the popup menu:

Actually, it’s just a Cinnamon thing. This is just a “bug” 
of the specific desktop environment I’m using, and it 
doesn’t happen in KDE or Gnome, etc. I’m not worried 
about it, and it doesn’t require a fix.

So far, this is the biggest lesson I’ve learned regarding Linux. :joy: