>> However, this approach doesn’t work if you install an application not from the Ubuntu repository.
> If that's the case and if the fix given works, then even if it's not a Lazarus problem it's something we need to be aware of.
I don't have time to fire up one of my Ubuntu Gnome VMs right now but I am absolutely sure that method does work for an app with a desktop file, in fact, I have in the past recommend that process for Gnome users as part of a workaround for Gnome's reluctance to show a SysTray icon, something I have a better solution for now. But I frequently tested the process using a Lazarus app.
There is nothing in a standard binary that is necessary for doing something like adding to favourites, thats a process a lot closer to the user than what goes on in a binary. So desktops do require an assigned icon to display as a menu at all and most "add to favorites" is a "manipulate the menu" process. Except, of course Gnome, the dock is not a menu but does use some menu infrastructure.
Some time ago I added a section about making a desktop file in the "Installing Lazarus on Linux" wiki page, its generally applicable. And, as Mark noted, quite easy.
Davo