Created attachment 6874 Something like that is the proposal ... Hi, Love xfce4-whiskermenu-plugin, but is a bit annoying the delay to open the menu while garcon load the menu. My propoce is collect the menu model on a thread to no freeze the menu.. And While loading show the menu with a spinner indicating process.. I think it is important for user experience.. =) You can take some ideas here: https://github.com/xfce-mirror/xfce4-appfinder/blob/master/src/appfinder-model.c p.s: This is especially slow on older hard disks and on SSDs probably be instantaneous and therefore not notice.. :(
I used to do that (with a spinner and everything), but that caused a bunch of issues with the menu completely freezing up at launch and just being a gray rectangle so I had to remove it. Basically--as far as I could figure out--it just isn't safe to add a thread to a panel plugin (unlike a regular application, such as the app finder). I do not have an SSD and I have a pretty old hard disk. I don't know why everybody assumes developers have fast machines; I certainly don't. It takes the menu a couple of seconds to open the first time I use it each day...
Hi Graeme, > I do not have an SSD and I have a pretty old hard disk. I don't know why everybody assumes developers have fast machines; I certainly don't. It takes the menu a couple of seconds to open the first time I use it each day... Sorry if you feel offended, on the contrary, it is a work experience. We usually work with new machines and then distribute more moderate computers. :S I work on "Conectar Igualdad" for the Education Ministry of Argentina Republic developing Huayra GNU/Linux.. I try to include Xfce some time ago, but these small details that do not convince to people who then take decisions. :( > I used to do that (with a spinner and everything), but that caused a bunch of issues with the menu completely freezing up at launch and just being a gray rectangle so I had to remove it. Basically--as far as I could figure out--it just isn't safe to add a thread to a panel plugin (unlike a regular application, such as the app finder). I understand why you made the decision not to show anything until you have all the data, but in the final experience seems that the menu is freeze.. Maybe add the spinner on the same button?. But perhaps the result is the same as it is a single process and maybe a single line of code is slower stopping the process. Sorry again, I hope you reconsider it.. Regards, Matias.
(In reply to Matias De lellis from comment #2) > > I do not have an SSD and I have a pretty old hard disk. I don't know why everybody assumes developers have fast machines; I certainly don't. It takes the menu a couple of seconds to open the first time I use it each day... > > Sorry if you feel offended, on the contrary, it is a work experience. We > usually work with new machines and then distribute more moderate computers. > :S > > I work on "Conectar Igualdad" for the Education Ministry of Argentina > Republic developing Huayra GNU/Linux.. > > I try to include Xfce some time ago, but these small details that do not > convince to people who then take decisions. :( Not offended at all, I was just trying to explain that it is slow for me as well. > > I used to do that (with a spinner and everything), but that caused a bunch of issues with the menu completely freezing up at launch and just being a gray rectangle so I had to remove it. Basically--as far as I could figure out--it just isn't safe to add a thread to a panel plugin (unlike a regular application, such as the app finder). > > I understand why you made the decision not to show anything until you have > all the data, but in the final experience seems that the menu is freeze.. > > Maybe add the spinner on the same button?. > But perhaps the result is the same as it is a single process and maybe a > single line of code is slower stopping the process. > > Sorry again, > I hope you reconsider it.. Well, since it is a single process, there is no way to make the spinner move. The garcon function call to load the menu doesn't return until it is loaded, which is where the bulk of the time is spent (it is a single line of code from the perspective of Whisker Menu). It would end up just being a static image of a spinner... I will look into adding back the threaded loading, but I doubt I will be able to get it working. I didn't rip out the code from before on a whim, after all. ;)
Hi > Not offended at all, I was just trying to explain that it is slow for me as well. Anecdotally, when I start developing Pragha was an old computer and then of buy a newer.. Suddenly I found abusing resources unnecessarily.. Today I think it works adequately.. :) > I will look into adding back the threaded loading, but I doubt I will be able to get it working. I didn't rip out the code from before on a whim, after all. ;) You do not need a thread with pooling as implements xfce4-appfinder. With launching just a single thread to perform the initial load is sufficient. Then as the inodes of desktop files are in cache their access to update the menu is much faster. I'm trying to make a patch, but glibmm not I upgrade to support g_task_new() which simplifies the background task usage.. and I'm not very good with c ++ to write the binding .. :( Regards,
(In reply to Matias De lellis from comment #4) > You do not need a thread with pooling as implements xfce4-appfinder. With > launching just a single thread to perform the initial load is sufficient. > Then as the inodes of desktop files are in cache their access to update the > menu is much faster. My thread code was much simpler than the app finder. All I did was put the single function call to garcon_menu_load() in a separate thread, since that is where the bulk of the time is spent. I don't see why using a GTask instead of GThread would make it not lock up, but I will try that. Garcon already caches the files for future access, so it is only the first time that garcon_menu_load() is called that it is slow. > I'm trying to make a patch, but glibmm not I upgrade to support g_task_new() > which simplifies the background task usage.. and I'm not very good with c ++ > to write the binding .. :( I don't use glibmm, so I'm not sure why you would be looking at that...
Graeme Gott referenced this bugreport in commit 5c285dc7de12df8ae9ea7e13ac3f339952506161 Load applications in a thread. (bug #12903) https://git.xfce.org/panel-plugins/xfce4-whiskermenu-plugin/commit?id=5c285dc7de12df8ae9ea7e13ac3f339952506161
Wow.. Thank you so much Graeme. ;)