-
Notifications
You must be signed in to change notification settings - Fork 17.3k
Fix context menu right click not working ( alternative fix ) #22050
Conversation
@sadick254 you have any idea what we do with that command detail there? |
hi @darangi, i see we have a fix and we can close this PR now. |
Doesn't this fix #22024 by coincidence? |
Not sure. If some of those issue are stopping Atom to complete the tests, yes this pr ( and the merged one ) could have already fixed it. My solution was to remove it, since everything was working without it. |
Still interested in the topic :D anyone available? |
Is |
That is what i was trying to look into. Is not used in atom codebase at all, not with a full text search at least. But i m not sure how that value is used since the atomWindow is serialized and not more a reference to the original window. I compiled the version with this commit 5 days ago and i m using it waiting for the fixed nightly to come out. @sadick254 or @darangi do you have any insight? |
@asturur Since the context menu has already been fixed can we safely close this? |
i know is passed down, but if you look at the command, those are just strings and do not seems to use the reference to a copied version of the atomWindow anywhere.
If we can ditch the property and not add a dependency, isn't better? |
I have done a little bit of digging into the source code. I can't see anywhere where we use the passed Right now we have a failing CI due to the first context menu fix. Could you include a revert commit of that change on this branch? |
Sure i think i can. I got a failing build too and i fixed with the second commit. I ll update it tomorrow early for me |
Seems like now this PR is affected by timeouts in windows |
|
Thanks for the contribution 🙇🏾 @asturur |
@asturur Thanks for your perseverance on the topic. This kind of non-trivial contribution is very interesting and valuable! |
i stubbornly use atom while evetyone tells me to switch to vscode. I m happy to help and to learn electron.js |
Identify the Bug
The upgrade to electron 9.4.4. broke the context menu click.
The issue is tracked in #22018
The stack trace point to the fact that they payload for the message is no more serializable
The change in the api that broke the code should be this:
https://www.electronjs.org/docs/breaking-changes#behavior-changed-values-sent-over-ipc-are-now-serialized-with-structured-clone-algorithm
Description of the Change
My fix was to remove the reference to atomWindow from the payload, the part that is not serializable.
Alternate Designs
There is also this other fix here that i noticed after making this one:
#22046
Possible Drawbacks
Well a value removed from the payload can of course have drawbacks.
I have no understanding why we are sending a reference to the window in the payload if we are sending the message to that exact same window.
Does anyone knows why that is needed?
The window is probably a large object and serializing it won't let the instance itself travel with the message, but it should become just a bunch of data.
Verification Process
The only verification process is me trying the right click menu on my local build on macosx and the PR tests
Release Notes