readium / r2-testapp-js

NodeJS Readium2 "test app"
BSD 3-Clause "New" or "Revised" License
10 stars 1 forks source link

Linux Lubuntu (not Ubuntu, or Kubuntu), Electron BrowserWindow at app startup with empty contents (does not crash, but annoying) #9

Closed danielweck closed 5 years ago

JayPanoz commented 5 years ago

Did you test disabling the GPU? cf. https://github.com/electron/electron/issues/6139#issuecomment-227929646 (cos’ yeah I’ve reinstalled Xubuntu from scratch this weekend and I had GPU issues for something else… and since Lubuntu ships with the minimal config possible…).

That or maybe https://github.com/electron/electron/issues/8505.

danielweck commented 5 years ago

Ah no, the empty BrowserWindow is not really a "bug", it is a "feature" :)

The r2-testapp-js user interface / UX is really basic, there is in fact no initial Electron BrowserWindow for a bookshelf / library view (only a system menu to choose publications from the filesystem). So on MacOS (platform darwin) we display a "welcome" native message box to let the user know about the existence of the top-level system menu, whereas on the other platforms we create a BrowserWindow to hosts the system menu and to display the "welcome" message that explains users what to do. https://github.com/readium/r2-testapp-js/blob/3a3e32548cbadde9e72eaef66f6a983faba8cea2/src/electron/main/index.ts#L682-L720

So, this issue is about the weird empty reader view in Lubuntu's LXDE X11-based window manager ( https://lxde.org ), instead of the "welcome" message.

danielweck commented 5 years ago

Thanks for the Electron GPU heads-up though, good to know.

JayPanoz commented 5 years ago

Ok OK sorry for the noise then.

On a somewhat related note, Lubuntu is currently transitioning to LXQt, see their explainer.

danielweck commented 5 years ago

@JayPanoz I created this r2-navigator-js issue just in case GPU hardware-accelerated webview is problematic in our current Electron v2 implementations: https://github.com/readium/r2-navigator-js/issues/17

Eventually we will migrate to Electron v3+ which will bring its own set of breaking changes / integration challenges: https://github.com/readium/r2-navigator-js/issues/15 ... but hopefully this will fix any potential GPU issues :)

danielweck commented 5 years ago

Ah, my bad, I was trying to use the npm run electron CLI to open a custom root directory, when in fact the command line parameter is meant to be a file! (EPUB to open directly) I added a directory check to the CLI to avoid this silly mistake in the future: https://github.com/readium/r2-testapp-js/commit/e5f23105dcaa57f57157be4fccf64c708b68301b