[SOLVED]I need help or explaination about BeOS code

I try to recreate on linux our excellent BeOS/Haiku popup menu on desktop who show all folders and files.
If i understand correctly, BeOS list folders and file on first level.
If I move mouse on one folder listed, a submenu open with content of this folder very fast (depend of number of files)

On linux, in gtk, when i click on popup menu, computer freeze a long moment and after show me all folders and files in all /home/user.

Is there here any developper to explain me this part of code in tracker to have so fast speed to show popup on Haiku?
Thanks for your support.
I will try to apply this method on linux if it’s posible.

Here demo of this popup menu on beos max:

There is really nothing special, it goes through a few abstraction layers but basically in the end it calls opendir() and readdir() to enumerate the files.

The question is more: how does Linux manage to make something as simple as reading the list of files in a directory so slow? It’s a mistery. Probably they do a lot of additional useless work?

1 Like

Thanks for your answer.
I will try to see what part of code on opentracker about opendir and readdir code.

For linux, you are right, gtk should be faster but, i don’t know why.
One solution is to work with terminal command and get result in one array variable.

Or maybe review what you are doing? Maybe you are getting a recursive list of all files in that folder, prebuilding all the hierarchy even if it is hidden or something like that? When I change to a tree view list in Nautilus, Files or whatever the default file browser is now called in GNOME, I can traverse directories without a noticeable lag, so general file access does not seem to be the problem.

You are right, i prebuild all files, folders and sub folder and recursive.
Simple because i can’t create new submenu ‘dynamicly’ when i move mouse on main menu.
I need to create all files and folders and submenu and after this popupmenu will be displayed.
On gtk it wors like this. Or maybe you have another solution?

I don’t know GTK. Maybe just do one layer and connect the activation or hover signal of each directory item to the creation, population and show of that submenu? Don’t know if it’s possible. I’m sorry I can’t be of more help, but at least you now know what the real issue is.

That would indeed be a difference. In Haiku the menus are created on-demand when they are opened.

Linux is only free, if your time is worthless, best thing I ever read about desktop linux, I was roflmao