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

Added Commandline Options #235

Merged
merged 17 commits into from Mar 7, 2018
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ Windows 7 and later are supported

[More information](https://github.com/electron/electron/blob/master/docs/tutorial/supported-platforms.md).

### App Start-Options
Copy link
Owner

@hql287 hql287 Mar 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better if we could add some kind of explanation for why it's here and what it does. Or better yet, reference the issue(s) that led to this change. I think Linux users will appreciate it. 👍

Also, it seems a little too short to has its own section, maybe move it under Development?

Copy link
Author

@ghost ghost Mar 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better if we could add some kind of explanation for why it's here and what it does. Or better yet, reference the issue(s) that led to this change. I think Linux users will appreciate it.

Yes, thats a good idea. I make a proposal.

Also, it seems a little too short to has its own section, maybe move it under Development?

Is it really related to development? I also thought about adding a start option for a path to a custom theme, so maybe the section gets bigger in the future :) If it shouldn't be part of the readme, maybe it should get an own wiki page?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think it's related to Development because you'll only use those options for development purpose. But I think it deserves its own Wiki page as well. Maybe we can title the page as "Debug in Production" or "Debug Exported App"?

I just updated the Wiki setting so everyone can contribute now, and I think the page should include this:

Dev-Server: electron . --force-devtools
Linux AppImage: ./Manta-1.1.2-x86_64.AppImage --force-devtools
Installed App (.deb): manta --force-devtools

Copy link
Author

@ghost ghost Mar 6, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the (1) "--force-devtools" option is really related to development & bug reporting, but (2) "--disable-hardware-acceleration" is a user setting for the app. So we should split the documentation of these two params to 2 different places. For (1) a "Debug Exported App" wiki page would fit. I would leave infos about (2) in the main readme.

I proposed this, cause i thought it's good to have all app start options documented in the same place. we can place all options in the wiki under the development section, but you wont find it there if you search for regular user app options.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better if we could add some kind of explanation for why it's here and what it does.

I don't know what to explain. The title of the section and the paramname explain everything there is to explain, or?
Maybe: To give the user the possiblity to easily set some options for the app ...

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just added a short description to the README. Please have a look and let me know what you think. If it's ok then this PR is ready to be merged.

* Disable Hardware-Acceleration: `manta --disable-hardware-acceleration`
* Force Devtools: `manta --force-devtools`

### Technologies
* [Electron](https://github.com/electron/electron)
* [React](https://github.com/facebook/react)
Expand Down
18 changes: 9 additions & 9 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ const { autoUpdater } = require('electron-updater');
// Place a BrowserWindow in center of primary display
const centerOnPrimaryDisplay = require('./helpers/center-on-primary-display');

// Prevent Linux GPU Bug
// https://github.com/electron/electron/issues/4322
if (process.platform == 'linux') {
// commmandline arguments
const forceDevtools = process.argv.includes('--force-devtools');
if (process.argv.includes('--disable-hardware-acceleration')) {
app.disableHardwareAcceleration();
}

Expand Down Expand Up @@ -62,11 +62,11 @@ function createTourWindow() {
);
// Add Event Listeners
tourWindow.on('show', event => {
if (isDev) tourWindow.webContents.openDevTools({ mode: 'detach' });
if (isDev || forceDevtools) tourWindow.webContents.openDevTools({ mode: 'detach' });
});
tourWindow.on('close', event => {
event.preventDefault();
if (isDev) tourWindow.webContents.closeDevTools();
if (isDev || forceDevtools) tourWindow.webContents.closeDevTools();
tourWindow.hide();
});
}
Expand Down Expand Up @@ -101,12 +101,12 @@ function createMainWindow() {
);
// Add Event Listeners
mainWindow.on('show', event => {
if (isDev) mainWindow.webContents.openDevTools({ mode: 'detach' });
if (isDev || forceDevtools) mainWindow.webContents.openDevTools({ mode: 'detach' });
});
mainWindow.on('close', event => {
if (process.platform === 'darwin') {
event.preventDefault();
if (isDev) mainWindow.webContents.closeDevTools();
if (isDev || forceDevtools) mainWindow.webContents.closeDevTools();
mainWindow.hide();
} else {
app.quit();
Expand Down Expand Up @@ -144,11 +144,11 @@ function createPreviewWindow() {
);
// Add Event Listener
previewWindow.on('show', event => {
if (isDev) previewWindow.webContents.openDevTools({ mode: 'detach' });
if (isDev || forceDevtools) previewWindow.webContents.openDevTools({ mode: 'detach' });
});
previewWindow.on('close', event => {
event.preventDefault();
if (isDev) previewWindow.webContents.closeDevTools();
if (isDev || forceDevtools) previewWindow.webContents.closeDevTools();
previewWindow.hide();
});
}
Expand Down