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

package as native desktop app #2

Open
JonET opened this issue Feb 24, 2016 · 11 comments
Open

package as native desktop app #2

JonET opened this issue Feb 24, 2016 · 11 comments

Comments

@JonET
Copy link

JonET commented Feb 24, 2016

This is really cool, but the limitations on copy and paste limit it's usefulness.

Ever thought of packaging it with one of the web -> desktop frameworks out there?
http://electron.atom.io/

There are APIs for clipboard access and you could get access to the file system proper. (I miss the old paint).

@1j01
Copy link
Owner

1j01 commented Mar 1, 2016

Yes, this is something I want to do. You can already run it with nw.js (clone repo, npm i, npm start) but I don't think it has any benefits, i.e. I haven't yet implemented proper clipboard support or a dialogue when closing or subwindows that can actually go outside the main window or anything. Also, jspaint tries to be always saved, and if you close a tab you can reopen it to get the session back, but on desktop this will need some other kind of handling.

@1j01 1j01 added the packaging label Oct 17, 2017
@1j01 1j01 mentioned this issue Oct 24, 2017
@devxpy
Copy link

devxpy commented Jun 24, 2018

+1 This would be really nice to have.
JS paint is definitely better than the over cluttered desktop apps we have on linux.

Its so simple that 5 year old can use it, and I mean literally, because I am using Paint since i was 5.

Having this as the default desktop image editing tool would be sick.

Thanks for making this project, really appreciate it!

@1j01
Copy link
Owner

1j01 commented Jul 7, 2019

I've made a lot of progress on this, now merged into master.

Things that are done:

  • Lots and lots of boilerplate, like handling clicking links to open your default browser
  • File > Set as Wallpaper (could use testing on different operating systems)
  • Clipboard support
  • Opening and saving files, including saving over opened files with Save (vs Save As), and saving as PNG, JPEG, or WebP
  • I generate a .reg file that you can use to set up a right click > Edit option for images in Windows Explorer - but this isn't exposed to the UI currently; you just have to find it and double click on it - and there's no undo FYI

I'm not interested in pursuing this, but if someone wants to help, the next step is to find someone with experience releasing electron apps (specifically with electron forge) to help set up autoupdating.


To try out the desktop app so far, see Development Setup on the readme.

@abdatta
Copy link

abdatta commented Nov 19, 2019

Maybe we can make it into an installable PWA instead. Desktops are supporting PWAs as well now irrespective of OS (as long as you have chrome). Would probably be easier.

@1j01
Copy link
Owner

1j01 commented Dec 1, 2019

@abdatta Yeah that's definitely more of a priority. So far jspaint is installable (as a PWA), but doesn't work offline (no service worker). See #109

@HKalbasi
Copy link

@1j01 It is not installable (At least on chromium desktop). It need a service worker (even an empty one). #144 will solve it.

@o0101
Copy link

o0101 commented Nov 7, 2020

I think this problem is solved.

https://github.com/c9fe/jspaint.exe

@HKalbasi

This comment has been minimized.

@1j01 1j01 closed this as completed Jan 11, 2022
@1j01 1j01 reopened this Jan 11, 2022
Repository owner deleted a comment from o0101 Jan 11, 2022
Repository owner deleted a comment from o0101 Jan 11, 2022
@1j01
Copy link
Owner

1j01 commented Jan 11, 2022

The electron app is essentially done, just needs autoupdating set up and to be published (plus a few fixes — I may have broken file saving in recent changes?)

@1j01
Copy link
Owner

1j01 commented Mar 9, 2024

I just pushed a bunch of improvements to the Electron app to master if anyone wants to give it a test:

  • Merged fix blurriness when display scale factor is > 100% #315
  • Improved macOS integration:
    • The titlebar shows an icon representing the open file, which can be dragged into other apps, and it becomes grayed/faded to indicate when there are unsaved changes.
    • Handled dragging files onto the dock icon to open. (This only works in the packaged version, using a generated Info.plist file that tells macOS what file types it accepts. All files, for now.)
    • Created a new ICNS file with higher resolutions.
  • Added a command-line interface, with --help and --version flags. Other than that it just takes a file path.
  • App is now single-instance; second instances exit and open a file in the first instance.
    • Dealt with insane electron bugs.
  • Packaging:
    • Configured packaging for macOS (zip), Windows (installer), and Linux (deb, rpm).
      • Icons, descriptions, categories, executable names, even an animated GIF for the Windows installer!
    • Configured publishing to GitHub Releases.
    • Handled Squirrel.Windows events.
  • Fixed error re-registering events when closing and re-opening the window on macOS.
  • Fixed bringing the window to front on macOS, and then fixed it on Windows by conditionally using old way.
    • Everything in Electron is harder than they let on in the docs, if you want to get it right. It's like a fractal of footguns.
  • Fixed unnecessary save prompts when closing the app.
  • Fixed "Open" links in File > Manage Storage dialog. Mostly.
    • It still shows a confusing inapplicable message if you have unsaved changes.
  • Fixed File > Exit.
  • Allowed write access to dropped files.
  • Reworded dialog messages to avoid terminology like "your browser"

I might publish a prerelease version soon to make testing easier.

@1j01
Copy link
Owner

1j01 commented Mar 11, 2024

I published Windows/Mac/Linux builds for testing: https://github.com/1j01/jspaint/releases/tag/v1.0.0-beta.1
Please try it out!

Note that Windows and Mac will likely block running it by default, since it's not code-signed.
On Windows you have to say "More info", then "Run anyway", and on Mac you have to hold Control while clicking the file and then select "Open" in the menu and then "Open" in the dialog.

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

No branches or pull requests

6 participants