speckleworks / SpeckleRhino

Check a brand new Speckle at: https://github.com/specklesystems
https://speckle.works
MIT License
38 stars 16 forks source link

Multiple menus are appearing in Grasshopper #301

Open jjsolly opened 4 years ago

jjsolly commented 4 years ago

Step 0:

Expected Behaviour

How things should actually work! - Probably should only have one menu item. SpeckleSpeckleSpeckle

Actual Behaviour

What's actually going on! - Have multiple menu items (SpeckleSpeckleSpeckle... probably soon to be SpeckleSpeckleSpeckleSpeckle)

Affected Projects

Does this issue propagate to other dependencies or dependants? If so, list them here! - Is just annoying.

Reproduction Steps & System Config (win, osx, web, etc.)

Windows 64 bit, Rhino 6 SR24, latest version Speckle (from 2 days ago)

Proposed Solution (if any)

No idea for proposed solution. But thanks as always for the great work!

2020-04-16 16_19_16-Window

teocomi commented 4 years ago

Hello @jjsolly ! Might have been caused by some old Speckle installations, do you recall installing it previously at all or having IT installing it? Or have you maybe built and debugged it yourself?

I'd suggest trying the following solutions in order:

teocomi commented 4 years ago

Sorry, closed by mistake... 🤦‍♂️

jjsolly commented 4 years ago

Hi @teocomi it's a totally fresh installation from the other day and I did what you said already. So i don't think it should be that. But I can try again and report back. I assumed maybe there was an on-load command that can't see that the menu is already there?

teocomi commented 4 years ago

Quite weird, aside having multiple SpeckleGrasshopper.gha on your machine I can't think on anything causing that...

PaulPoinet commented 4 years ago

FYI @teocomi I have had the same issue quite a few times. E.g. I recently completely reset my computer and installed Speckle once, got two menus on top. For some reasons I have only one now... it's a bit unpredictable... (also not sure what to report more precisely that could help)

didimitrie commented 4 years ago

This issue is so annoying (it's a dupe of #277, but doesn't matter). The code is here: https://github.com/speckleworks/SpeckleRhino/blob/master/SpeckleGrasshopper/Loader.cs

To add a menu to the top bar, we need to run a timer function to see if gh is loaded. For some reason i never got it right, and the AddSpeckleMenu does its job more than once (or the timer elapsed function is called multiple times between when setting the MenuHasBeenAdded semaphore.

I'll try and have a look next week, unless someone else picks it up.

In the meantime, please refer to this issue as the Speckle Ad Project. The faster your machine is, the more speckle menus you get.

teocomi commented 4 years ago

^^ That's why I never had it on my machine... 🐌

daviddekoning commented 4 years ago

the MetaHopper plugin avoids a timer by including this line in PriorityLoad():

Instances.CanvasCreated += new Instances.CanvasCreatedEventHandler(this.RegisterNewMenuItems);