Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Several shortcuts (reload, toggle full screen, toggle dev tools) stop working in packaged binary #75

Closed
holandes22 opened this issue Jun 25, 2016 · 6 comments

Comments

@holandes22
Copy link
Contributor

Hi

I noticed that shortcuts work on dev but stop working on prod. Shortcuts like ctrl+R (reload) and F11 (toggle full screen) and Ctrl+shift+I (toggle dev tools ).

I thought maybe the problem was on electron-packager so I cloned electron-quick-start and package it but all works as expected there, that is shortcuts continue working in the package.

To reproduce:

  1. ember new myapp
  2. cd myapp
  3. ember install ember-electron
  4. ember electron -> verify F11, Ctrl+R, Ctrl+Shift+I work
  5. ember electron:package -> run the executable, shortcuts stop working

I tested with version 1.7.1 and ember-cli 2.6.2.

I'm on Arch Linux 64 bit, but also built package for Mac on travis and for Windows on appveyor and the problem still occurs on those platforms.

Not sure, but this might be related to the other ticket I opened #71

@felixrieseberg
Copy link
Collaborator

Quick question: Are you adding the shortcuts yourself (via menu)? Electron adds some default shortcuts in development mode, but doesn't in production mode. To be clear, that's an electron thing, not an ember-electron thing.

For more info, check out the docs over at electron/electron: https://github.com/electron/electron/blob/master/docs/api/menu.md

@holandes22
Copy link
Contributor Author

holandes22 commented Jun 26, 2016

No, didn't add any menu code at all to reproduce this, I'm referring to shortcuts that work out of the box in electron (chromium really, as these shortcuts are the same in standalone chromium)

For example if you clone the electron-quick-start repo and run npm start you get F11 working. This keeps working after packaging it with electron-packager. But with ember-electron shortcuts only work when running ember electron but not after running ember electron:package. Again, talking about fresh projects in both cases

Sorry if I wasn't clear, and I apologize if this is to be expected, but I didn't find any docs on this and it is weird that ember-electron behaves differently than a regular electron app in this regard

@felixrieseberg
Copy link
Collaborator

Hey, apologies that this is so confusing (we in the Electron team should probably do something about that), but as soon as you package your application, there is no standard menu. The menu is the source for all keyboard shortcuts. Unless you add a menu yourself, no shortcuts (not even Copy/Paste) will work. F11 is probably activated from the dev tools, which open automatically in the quick-start.

Ember-Electron isn't different, it's just wrapping electron-packager. There are no docs (yet), but this is exactly how it's supposed to work (even if that's weird).

I'll make sure to add that information to the docs over at Electron.

@holandes22
Copy link
Contributor Author

Thank you! I couldn't understand why it was working on quick-start. As you say, once I remove from quick-start the line to open the devtools, F11 et al stopped working.

Thanks again for pointing me in the right direction!

@weedgrease
Copy link

I'm experiencing issues of even setting the application menu in my app after packaging. Everything works as expected running ember electron but after packaging, the menu items with base roles like edit or copy are blank and return nothing in the menus. Might be related?

@felixrieseberg
Copy link
Collaborator

Do you have a repro? This is likely an issue with your code (or a bug in Electron), since ember-electron doesn't touch any of that stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants