Scenario:
Scenario:
– shortcut to llx action lightning menu
– shortcut is launched by a script
– nothing happens
I think this shouldn’t be as it is…
]]>
< ![CDATA[
is the shortcut set to do nothing? :-/
]]>
< ![CDATA[
Well, the truth is that it is launched, but from where the script was executed. Which action are you using?
]]>
< ![CDATA[
The action “lightning menu” as I said above
]]>
< ![CDATA[
But the menu doesn’t show up, neither on the shortcut nor on current position
]]>
< ![CDATA[
No, sorry. I mean which action is executing the script you are using to launch the item (onload? Onpositionchange? …)
]]>
< ![CDATA[
The custom script menu
]]>
< ![CDATA[
And the custom script menu is launched from? (Yes, I need this information)
]]>
< ![CDATA[
Long tap on empty space
]]>
< ![CDATA[
BTW: if I set the shortcut action to “add item” the item is added at the place where I tapped.
Also “edit layout” works correctly, but the lightning menu doesn’t want to show up
]]>
< ![CDATA[
Hmm, it works for me :/
]]>
< ![CDATA[
I’ll try again…
]]>
< ![CDATA[
What script code do you use? Mine is:
LL.getCurrentDesktop().getItemByLabel(“Lightning Menu”).launch();
]]>
< ![CDATA[
I use get item by id…
]]>
< ![CDATA[
It also works with label
]]>
< ![CDATA[
It also doesn’t work with id…
]]>
< ![CDATA[
Maybe I’m missing something. This is what I tested:
Place a shortcut to lightning menu.
Change the long click to custom script menu
Long click, run the script. The menu is shown.
Note: I used my fast run script, theoretically is the same (just an eval)
]]>
< ![CDATA[
I did more or less the same, but the menu doesn’t show up. The icon gets “focused” shortly (white shadow appears)
]]>
< ![CDATA[
It’s weird. If I launch the script directly from an event like swipe it works, bit not from the menu.
]]>
< ![CDATA[
Something like this can sometimes be caused buy an error that is handled well enough to keep the app from crashing, but not well enough to give any feedback or to solve the problem.
For instance there’s some sort of bug in the latest llx update. On the first try entering the configure desktops menu, the screen flashes, then goes back to the main menu. On the second try, the app crashes and Pierre Hébert gets another crash report email.
Obviously I can’t say if that might be what’s happening, but its worth looking into.
]]>
< ![CDATA[
What happens here is that the menu is open and immediately closed: there is a single instance of the menu, if you launch the script from the menu, LL will attempt to close the current menu, but will in fact close the lightning menu which has just been opened.
]]>
< ![CDATA[
Well I think this should be fixed… It is not an unsolvable problem, just one or two more check(s) in code I think
]]>
< ![CDATA[
Actually that’s a bit more than just one or two more checks, but it’s in v10 anyway 😉
]]>
< ![CDATA[
Pierre Hébert OK, I think your launcher is far more complex than I can imagine 😉
]]>
< ![CDATA[
It is too much complex, but the problem here is simple: clicks on menu items are handled by a single function, this function closes the bubble according to a number of conditions (one obvious is if there is a sub menu, don’t close the bubble), other conditions are less easy to take into account and the script is one of them: it is not really possible to predict what will happens in the script, adding a global flag is not a solution due to the border effect it would cause, so I had to select another more subtle mechanism.
]]>