Repository navigation
🏁 Show/hide Atom shell context menu from settings - #8780
BrainCrumbz wants to merge 16 commits into
Conversation
This is a work-in-progress: apm test still returns errors.
|
Travis is reporting some lint errors (https://travis-ci.org/atom/atom/jobs/80203864#L287-L290) - it would be great if you could fix those so that the build can continue. |
|
Thanks for notifying that, we'll have a look at it! |
|
@mnquintana @paulcbetts some people mentioned that after an Atom update, the context menu would be there again, even if they manually removed by editing the registry. Looking at code, even the one from our PR, it seems that nothing will change on that side: when '--squirrel-updated'
updateShortcuts ->
# installContextMenu will run anyway!
WinRegistry.installContextMenu ->
addCommandsToPath ->
app.quit()the context menu will be installed again no matter what's configured in settings. Should this behaviour change as well, and take into account current settings? |
There was a problem hiding this comment.
@mnquintana @paulcbetts some people mentioned that after an Atom update, the context menu would be there again, even if they manually removed by editing the registry.
Looking at code, even in this PR it seems that nothing will change on that side: the context menu will be installed again no matter what's configured in settings. Should this behaviour change as well, and take into account current settings?
|
IMHO context menu after an update should respect current/existing settings. |
|
Hello all. Does this PR still require-changes? |
|
/cc @kevinsawicki for review |
There was a problem hiding this comment.
I don't think atom.config is available in the browser process where this code runs. Did this work for you? I would have guessed this line would throw have thrown an error.
There was a problem hiding this comment.
It worked during tests. We don't yet have a Windows machine at hand, so we did not actually run the build script (or whatever is needed) on Windows.
BTW, why did nobody mention this until now? 😬
There was a problem hiding this comment.
Tests run inside the render process where globals like this one are available. In the main browser process though where this will run, atom.config is not available.
There was a problem hiding this comment.
Is there a way to "inject" or include or whatever the atom.config in the main browser process? I mean, is there something preventing the access to configuration from within the browser process?
If this cannot be done, or cannot be done easily, at least I'd go for removing the second feature described (update does not add context menu if it was disabled), keeping the first one (allow to show/hide context menu from settings) and review this PR
There was a problem hiding this comment.
Hello all. Any thoughts on this roadblock? TA
There was a problem hiding this comment.
If this cannot be done, or cannot be done easily
Loading and accessing atom.config from the browser process cannot be done easily at this time. src/config.coffee would need to be adjusted to work in the browser process where packages (and other things) are unavailable.
There was a problem hiding this comment.
Ok, got that. You know what, maybe we don't necessarily need the atom.config to detect if user had disabled Atom context menu, at least as long as accessing that module is not easy.
During update, so in browser process, we already access the Windows Registry to read/write keys.
We could just define a way to detect - by reading the registry - whether the context menu is enabled or not. A new method would be added to WinRegistry to this purpose. Then, during update, SquirrellUpdate would acces such method, instead of atom.config.
What do you think about that?
There was a problem hiding this comment.
Hello there. Any thoughts on this? Does it make sense to remove access atom.config and implement it this way?
|
This pull request is pretty large and there is no description currently provided. Would you mind writing up a bit about what this changes in detail? Thanks. |
|
Added some information. Please do let me know if more is needed, there are things not clear or what else. Cheers |
|
Could anyone tell if this PR is still of interest for project owners? So that we can invest some more time in updating code and fix build fails. Otherwise we can happily close it. |
Yeah, it would be nice to have this as an option. It looks like the build is failing legitimately because the the windows context menu file added in this pull request is using the The |
|
Thanks for feedback. Yes I'm on that already. Now we've just being struggling for the last hours both on Windows 10 and Mac OS X to land on a successful build :-\ On Windows we incurred in a number of issues, among which the dreaded On Mac OS X, we usually had much more luck when building as well as running tests. Now we also have problems with If we call it a day on those issues, we will probably resort to just force push the updated PR and hope for the best, i.e. either Travis or someone will be so nice to try build it. |
|
Sorry for late update: in the past weeks we tried without luck to get a working build on Windows, or at least passing tests on Mac. None of them was possible, sadly. Quite some time has been spent in those days, in order to overcome issues that seemed more related to other players (e.g. npm on windows and long paths, etc.) than to Atom itself. But still, it was not possible to get feedback from tests before submitting PR again. |
|
What's the news? |
|
Last time tried, still had problems with build environment (e.g. npm downloading & installing modules), so no chance to even get to the actual merging issues. |
|
We decided to split this PR (and eventually close it) in a refactoring part (please see #11639) and then in a coming part strictly dedicated to this feature improvement. |
|
Going to close this one - the core part is in on the other PR which is now merged. We should discuss the shell integration settings for Windows - I have a few ideas. |
|
Is there already an open issue where to discuss about shell integration settings for Windows? A couple of points from this PR could be useful to talk about, like having a checkbox in preferences and like checking context menu enabled state while re-installing. EDIT |
Features
This PR aims at addressing some issues (see e.g. #5901 ) about Atom integration in Windows shell context menu (i.e., the right click menu in Explorer). In particular, with those changes:
Implementation
squirrel-update.coffeeand moved to a newWinRegistrymodule inwin-registry.coffee.squirrel-update.coffeeas well and moved to a newSpawnerinspawner.coffee.config-schema.coffee.WinContextMenuSettingsinwin-context-menu-settings.coffee. When setting changes, that is responsible for updating the registry by invokingWinRegistryatom.coffeecreates an instance of that monitor, and dispose that when it's time toWinContextMenuSettingsmonitor got its own specssquirrel-update-spec.coffeespecs, related to ignoring errors, where actually a test on spawning functionality, so they have been moved to a newspawner-spec.coffeesquirrel-update-spec.coffeesquirrel-update-spec.coffeethen there was a repetition on how to invoke a callback, and that has been factored