hql287 / Manta

🎉 Flexible invoicing desktop app with beautiful & customizable templates.
https://www.getmanta.app
GNU Lesser General Public License v3.0
5.28k stars 476 forks source link

Added Commandline Options #235

Closed ghost closed 6 years ago

ghost commented 6 years ago

Added Commandline Options "--disable-hardware-acceleration" & "--force-devtools".

With this commit, hardware acceleration would be on as default. Linux User with problems can use the option "--disable-hardware-acceleration" forr the workaround mentioned in #128.

I also added the "--force-devtools" option, so you dont have to build a special version for debugging the production packages.

I think these should be documented in the readme, any suggestions where?

hql287 commented 6 years ago

@jens-t Thanks for the PR. 👍

Quick question: How do you know the exported app will take these argument (--force-devtools and --disable-hardware-acceleration)?

ghost commented 6 years ago

Quick question: How do you know the exported app will take these argument (--force-devtools and --disable-hardware-acceleration)?

I tested this with a special version, which logged some debug information to the devtools console. but you can test this in the following ways:

hql287 commented 6 years ago

Ok, then I think we should update the README as well. Maybe somewhere in the Development section. Also, if we disable the Hardware Acceleration, will the black box show up again?

ghost commented 6 years ago

Ok, then I think we should update the README as well. Maybe somewhere in the Development section.

ok. but i think it doesn't fit in the development section. it's more a user feature, and maybe more flags are following, so it maybe deserves its own section. i make a suggestion with a commit.

Also, if we enable the Hardware Acceleration, will the black box show up again?

well, this pull request is referenced in the old pull request of the user having the problem. so the user should know, that there is a flag for this now. i searched the issues and found no one else having this problem, but i can add a short info to the readme ... linking to https://github.com/electron/electron/issues/4322, but i think that is to niche and specific for the readme. other users that eventually will have the problem will also find the pull request of @c0b41. and it is a bug from februar 2016, so it is possible that the black box might not show at all, not even for @c0b41.

hql287 commented 6 years ago

@jens-t You're on Linux, right? Does the black box show up on your screen if you enable hardware acceleration?

ghost commented 6 years ago

Yes, thats right. And no, i dont have any problems with hwa on, but the app is broken for me with hwa off. The "black box problem" is an edge case, not a general problem for all linux users.

hql287 commented 6 years ago

Installed App (.deb): manta --force-devtools (works in the same way for macOS & win ...)

I just tested it out on my Mac but this didn't work.

open -a /Applications/Manta.app --force-devtools

Received this message instead:

open: unrecognized option `--force-devtools'

Dev-Server: electron . --force-devtools

Also, the devtools don't need to be forced to open in development mode, the conditional isDev would open them automatically.

ghost commented 6 years ago

I just tested it out on my Mac but this didn't work.

Mac has it's own non standard way, as always :) Try:

open -a /Applications/Manta.app --args --force-devtools

Also, the devtools don't need to be forced to open in development mode, the conditional isDev would open them automatically.

Yes and No. isDev detects the development env, forceDevtools is to open them in production mode. So forceDevtools has nothing to do with the development mode ...

But yeah, following example is misleading somehow:

Dev-Server: electron . --force-devtools

this command with the "--force-devtools" makes no sense, it was just an example how these params work in general.

Dev-Server: electron . --disable-hardware-acceleration

Would be a better example :)

hql287 commented 6 years ago

@jens-t Hm, I tried this and it opened the app but the devtools didn't show up.

open -a /Applications/Manta.app --args --force-devtools
ghost commented 6 years ago

Maybe you should take a look here: https://superuser.com/questions/180995/passing-command-line-args-to-open-on-mac

the --args option exists since osx version 10.6 , maybe that's the problem?

hql287 commented 6 years ago

@jens-t Sorry my bad, I ran this command with the current version of Manta which didn't have the code presented in this PR 😆. Will export a new app and try again.

ghost commented 6 years ago

Tested with macOS 10.13.2 open -a /Applications/Manta.app --args --force-devtools works! :)

ghost commented 6 years ago

Changed the readme, better?

hql287 commented 6 years ago

@jens-t: I just added a Wiki page for this. Please double check if I got the Linux commands right and also provide the command for Windows user if you have it.

ghost commented 6 years ago

I like that page! :) I test it on windows later and add that to the wiki page.

do i have to fork the wiki, or just clone and push to origin?

ghost commented 6 years ago

I also like your readme changes/additions!

hql287 commented 6 years ago

I think you can edit it directly. There should be an "Edit" button next to the green "New Page" button.

ghost commented 6 years ago

Ah yes, found it, thanks!

hql287 commented 6 years ago

I also like your readme changes/additions!

Okay, I'll go ahead and merge this first. Feel free to update that Wiki page whenever you have the time.

ghost commented 6 years ago

Will do!

ghost commented 6 years ago

Just for your information, no need to change anything: Just found out, you don't have to use the open command on macOS, you can also type the path to the executable located in the program folder and use it the same way as in linux.

hql287 commented 6 years ago

Just found out, you don't have to use the open command on macOS, you can also type the path to the executable located in the program folder and use it the same way as in linux.

Not sure about this, because on my system, typing any path into the terminal would result in the cd command.

Update: Yup, I'm now in the /Application/Manta.app folder 😄

ghost commented 6 years ago

Read it somewhere, maybe the person used a custom shell. Good to know :)