Snap!Desktop - Snap for Desktop, but with titlebar integration

I know we have Snaptop - Snap! for Desktop, but that’s simply just snap.html in a basic Electron window. This still uses Electron, sure, but it integrates the window controls into the Snap! window, and makes the control bar draggable - so its like its own title bar. Here’s a screenshot:

It doesn’t work on MacOS, but it at least works on Windows 10. It works on Linux, but the controls are off. Of course, I still built for Linux and MacOS (github actions!), however I would need people with those systems to test. Here’s the repo for it, and enjoy!

It might not work on MacOS

There’s no Mac app in the release…

I said that as if I did build for MacOS (which I don’t think I CAN, I don’t have a MacOS system - maybe you don’t need it, I don’t know) it wouldn’t work (or atleast look well), as I didn’t add support for the traffic lighrs.

I have a Mac… But it is okay!

what are the benefits of using this vs. typing ‘snap.berkeley.edu’ at the browser url field?is there potential for incompatible libraries between the webapp version and the desktop version? when/why should i use the desktop instead of webapp?

The desktop version is the same between the web version. All it is the HTML and JS files from Snap!, packaged using Electron - with extra support code for the title bar. So all the stuff that works on the web, should work on desktop. Now on to the benefits part. First, if you have a bad internet connection, the desktop will be faster (as it already has all the Snap! source code downloaded). Also, it gives you more space (no tabs, no URL bar, or bookmarks bar if you have it). Note that there is ONE downside, you can’t load projects from the cloud. You have to download it on the website and open it up as a local file. I will, if someone FROM the Snap! dev team allows it, hook it up to the Snap! servers. Not right now, however.

does it work in bright theme?

Yeah, I made it update the button colors on theme changes

Confirmed to work on KDE Wayland with Ubuntu under Distrobox, it seems to use titlebar icons native to Chromium, which gives me an idea of maybe attempting to recreate this app with Qt or GTK

I was able to just use the AppImage

@codingisfun2831t I found a bug: I cannot close the window unless there are no pending changes that need to be saved.

Snap!Desktop on Fedora Linux 43 (Workstation Edition) using AppImage with Gnome DE

When I get back home I’ll make sure to add a dialog (in Snap!) on close with unsaved changes to fix

offtopic

The AppImage exists, but I use Alpine Linux as host OS (which uses musl libc) so I can’t open it.

$ ./snap-desktop-linux-amd64-v1.0.1.AppImage  
Error relocating /tmp/.mount_snap-dcAcIko/snap-desktop: posix_fallocate64: symbol not found

How is this offtopic?
It’s about Snap!Desktop

It’s more of a problem with my machine than the application itself

try using this


    window.cachedOnbeforeunload = window.onbeforeunload;
    this.onbeforeunloadListener = (e) => {
            if (this.hasUnsavedEdits()){
                this.childThatIsA(IDE_Morph).confirm(
                    'Quit Snap!?',
                    'Unsaved Changes!',
                    () => {
                        window.onbeforeunload=null;
                        window.removeEventListener("beforeunload", this.onbeforeunloadListener);
                        
                        this.isReadyToUnload = true
                        close()
                    }
                );
                e.preventDefault();
            }
            e.stopImmediatePropagation()
            return true
        }
     window.addEventListener("beforeunload", this.onbeforeunloadListener);

Well, I don’t think that’s really my bug to fix, all I handle is the JS making up the electron main.js and patching Snap’s code.

I will implement that - thank you!

Okay, fixed up, just let me publish the release (I’m still downloading from GitHub actions), and 1.1 will be released!

The v1.1 release is here! Cloud support, closing handling, and a Snap!Desktop version in the about screen (with Snap!, of course.)

I tried to use the MicroBlocks library. USB and BLE are both not working with the Electron app.