Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Suggestion for improving the menu speed #2597
Comments
Garibaldo
commented
Nov 3, 2013
|
Interestingly, similar issue happens with the panel pop-ups. When we right-click on the panel, the pop-up menus only open after we release the mouse right-button. But when we right-click on the Desktop, the context menu opens instantaneously. Can you see the difference? |
|
Yes, I see the difference, and now you mention it I see it. |
ManIVIctorious
commented
Nov 3, 2013
|
I just tried it out, i don't think that it gets faster only because i set it on mouse hover. More it seems to me that the speedup is caused because it is still cached. You can try to open one or two files and then try to hover over the menu applet and it will take as long as it did on mouse click. |
Garibaldo
commented
Nov 3, 2013
|
I've tested it again and the menu opens almost instantaneously when I use the option of opening the menu on hover. I had even opened other files and did other things on the computer before trying again. But I need to point out that:
There is some discussion about this subject in this topic: http://forums.linuxmint.com/viewtopic.php?f=208&t=116702 |
Garibaldo
commented
Nov 3, 2013
|
I've set POPUP_ANIMATION_TIME (in /usr/share/cinnamon/js/ui/boxpointer.js) to 0. It appears that it only has some effect on the pop-up menus. |
VolMi
commented
Nov 3, 2013
|
Now with Cinnamon 2.0.10, the menu opening time after startup has decreased from >6s to <1s, here. That is fantastic, obviously. I support to change the activation trigger for menu and other Cinnamon-elements to "button pressed" rather than "button released". |
|
It's very interesting. |
|
For the replace, in gedit use menu search and replace and replace all. |
|
If you like to change this in a reaction of all applet, make de same in a file applet.js. and also in the file panelMenu.js All files it's in /usr/share/cinnamon/js/ui/ I tested all, don't have any problem. |
Garibaldo
commented
Nov 3, 2013
|
@lestcape , I must have done something wrong because I followed all the steps and haven't noticed any difference. |
|
If you change popupMenu.js then when you clicked the item in the menu without release the mouse the app launched. Without a change, you need to release the mouse. If you change panelMenu.js occurs the same but with right click in the panel. If you change applet.js occurs the same but when you clicked some applet, like the menu. |
|
@Garibaldo remember that you need restart Cinnamon for the change take effect. |
Garibaldo
commented
Nov 3, 2013
|
@lestcape, I did exactly that. I've only changed popupMenu.js. I replaced all the occurrences of "button-release-event" with "button-press-event". I saved the file and I did restarted Cinnamon, but the menu didn't open without releasing the button. |
|
@Garibaldo that you want require that you change applet.js not the panelMenu.js |
|
@Garibaldo make this: |
Garibaldo
commented
Nov 3, 2013
|
Very interesting. Indeed that made my menu opening apparently much faster. Thanks for the tip. It is working well so far. I hope there is no negative consequence with this change. |
|
With the change in popupMenu.js i notice that if you have preview windows(more than one) and you change this file, you can make trouble when select a windows. This change it's only for test, another extention can use this for any other things and you can broken this mechanism. When a new release of Cinnamon come, this change will be reverted. |
Garibaldo
commented
Nov 5, 2013
|
Just some updates. |
|
I just tried this... unfortunately it interferes with the ability to drag and rearrange applets, so more rework would be required to implement this. We will definitely look into it for the next release though, we've already had some discussion on irc over it. |
Garibaldo
commented
Nov 5, 2013
|
You're right mtwebster, I've just noticed that. Anyway, thank you very much for considering it for the next release. And thanks for the feedback too. |
|
@mtwebster your CPU frecuency applet don't have response to the change in applet.js, maybe you handle the event directly. At less Cinnamon Menu can handle the even directly and check if state of drag it's active. In the other hand, popup menu for the Cinnamon Menu can handle the mouse press event, to avoid the slowly app's start(it's not a menu reaction). This last change can contribute to make a sensation that all system reacted more speed. |
|
The mouse event(BUTTON_PRESS) can be capture using global, to avoid the overriding. global.stage.connect('captured-event', Lang.bind(this, this._onCapturedEvent));
_onCapturedEvent: function(actor, event) {
try {
let source = event.get_source();
if(!this.actor.contains(source)) {
if(event.type() == Clutter.EventType.BUTTON_PRESS) {
//if(!Main.layoutManager.keyboardBox.contains(source)) {
//this.newNote(this.entry.text);
//this.showErrorMessage("me fui");
//}
} else
this.unlock();
}// else
//this.showErrorMessage("Sirve");
} catch(e) {
this.showErrorMessage(e.message);
}
}, |
Redsandro
commented
Nov 15, 2013
Wow, that's a huge difference. But any delay, even up to 1 second, is unacceptable. It's just crazy. Why are we sitting around with the most powerful computers ever and gigabytes of (often unused) memory and not have the contents instantly available? Like Synapse? Like Gnome-do? This onMouseDown vs onMouseUp is trivial compared to that. |
|
Couldn't you just click quicker ? :-) |
KDB2
commented
Nov 19, 2013
|
The menu cannot be dragged if the edition mode is not started. So basically, when the edition mode is on, the "open menu when a click is started" should be off. And if edition mode is off, then "open menu when a click is started" should be on. Just a though. Maybe a bad one ;) |
ManIVIctorious
commented
Nov 19, 2013
|
I don't think that this would make anything better as it is now. |
Garibaldo
commented
Nov 20, 2013
|
@ManIVIctorious, are you referring to my original suggestion or just the last comment? I've already test my suggestion and trust me, there is an actual improvement. I'm not saying that the change will make the menu completely instantaneous, but it will certainly be much better, especially with the recent speed improvements already implemented. So, in this case, each millisecond matters. Moreover, there is no reason not to make this change, and every single other DE that I know work this way. In fact I'm surprised with your opposition to the suggestion. |
ManIVIctorious
commented
Nov 20, 2013
|
Sorry, i was referring to the original comment. I don't think that it makes anything faster only because it is on button-click. The button release is very fast on all mouses i have ever used. Additionally i sometimes click on applets and decide that i am not really interested in the popup and then i move the mouse away after i have clicked and nothing happens. That is exactly the behavior i would expect. IMO it would be strange when all applets work on button release and the menu applet on button press. If this gets implemented i would expect to have a settings entry in which i can configure that all applets should work on button click or all should work on button release, but don't make the menu-applet any special. |
|
A solution to satisfy all people maybe it's put a option in global settings of Cinnamon for applets reaction(all applets) with two state, "On Mouse Pressed" or "On Mouse Release". Personally for me this issue was no longer significant, once the developers improved the code and reduced the reaction from the menu. But you must always think about the interests of others, and if we give them options, I think it will always be better. |
Redsandro
commented
Nov 20, 2013
I do this too! Never seen someone else do this. But there seems to be a trend that this is true (onMouseUp) for buttons, but not for menu's (try Nemo/Nautilus) where it is onMouseDown. However, as long as we agree that this is a silly 'solution' for the real problem. |
|
For the people that can not wait or don't can wait a milliseconds to open a Menu: https://github.com/lestcape/Menu-Cinnamon-Child/archive/master.zip |
Garibaldo
commented
Nov 21, 2013
|
Nice! You should upload it to the Spices website, as an applet. |
|
@Garibaldo @mtwebster said: "I just tried this... unfortunately it interferes with the ability to drag and rearrange applets, so more rework would be required to implement this. We will definitely look into it for the next release though, we've already had some discussion on irc over it." That you can see this can be done as well(my applet it's only an example). I don't know the Cinnamon final position about this. It makes no sense to go against the current, we need wait for officially Cinnamon developers speak out about this. Then if Cinnamon developers decided not change the current mechanims, then i can upload this menu, how alternative of Cinnamon Menu to Spices website. |
|
Note that my menu don't displayed when you drag and drop are enabled, and note that it's only an extention of Cinnamon Menu. The latter means if Cinnamon Menu have an internal update to work more fast my menu also update this ability automatically, because i use the code of cinnamon Menu, whatever it was that. |
Garibaldo
commented
Nov 21, 2013
|
@lestcape, I'm sure the devs will consider it for Cinnamon 2.2, after the Mint 16 release. But I can't see why not upload it to Spices now, since there will be no interference with the other applets, as you've implemented it as an applet itself, as far as I understand. So I see no reason to put it on hold. As an applet, people will have a chance to test it. |
|
@Garibaldo I don't know realy why(maybe because i don't speak English good), but my comments are interpreted as fighting or impositions. It is not my intention and I do not want give more reasons to continue tumbling evil needlessly. My applet it's a free software, you can redistribute it and/or modify it under the terms of the GNU General Public License. |
|
@Garibaldo you can see this: |
Garibaldo
commented
Nov 23, 2013
|
@lestcape , Excellent! Have you seen this applet http://cinnamon-spices.linuxmint.com/applets/view/129 yet? It is very interesting. Maybe you can get some ideas from it. By the way, I just don't understand the clock thing. Why would anyone want a clock on the menu? Anyway, very nice applet. I look forward to the final version. |
Garibaldo
commented
Nov 23, 2013
|
@lestcape , now I've tested a bit more your menu applet and I have to say, it is pretty great! Thank you very much. Sorry for asking again, but are you going to upload it to Spices? More people should know about it. |
|
@Garibaldo upload to Spices it's the final idea, i can no upload the other because the developers of Cinnamon told me that he don't want to share the code of applet menu. Well, this menu use a copy of cinnamon menu, not the original. The case it's that i try to be compatible with Cinnamon menu. Because if internal api changed, all menu become broken. That happen now with others menu. I try to write a better menu but with the greatest possible use of code cinnamon. That will help me to be able to update my code as soon as possible. By datetime do not worry, it's just that I'm starting. Only been two days of work, eventually it will not be I guess. The point is that I have spare space. You are invited to think too and I think you could help. My principal problem with Cinnamon menu is the height and i resolved it. |
Garibaldo
commented
Nov 23, 2013
|
@lestcape , I have a suggestion for you: after you've finished your amazing menu applet, I think you should open separated pull requests here in Cinnamon github with some of your menu improvements, so that the default menu could use at least some of them. I know that the devs are very busy right now fixing the bugs for the final release of Mint 16, but I'm sure they would consider your contributions after the release, so there is no hurry for now. I know that Clem is a little conservative with some design changes, that's probably why he rejected this http://cinnamon-spices.linuxmint.com/applets/view/129 , but I think he might bring to Cinnamon at least some of your ideas. Meanwhile, keep adding cool features to your applet. :-) |
Garibaldo commentedNov 3, 2013
I was testing the main menu of some Desktop Environments (Mate and Xfce) to find out why their menus are so much faster than Cinnamon's menu. Well, I think I found one of the possible reasons for it. Under Mater or Xfce the menu opens just by a mouse button press, I mean, the menu opens even before the user releases the mouse button. Under Cinnamon the menu only opens after the user releases the mouse button. In my opinion, this contributes substantially to the overall sensation of slowness. I know this may appear to be a negligible detail, but trust me, it makes a huge difference.
So my suggestion:
Make the menu open immediately when the user presses the mouse button. Don't wait for it to open only when the user releases the pressed button .