atlas-engineer / cl-electron

Lisp Interface to Electron.
BSD 3-Clause "New" or "Revised" License
16 stars 1 forks source link

Properly handle the initialization of windows #16

Closed aadcg closed 7 months ago

aadcg commented 1 year ago

Instead of relying on this workaround, which has serious consequences, I suggest checking whether app.isReady() returns true.

From the docs:

[BrowserWindow] This module cannot be used until the ready event of the app module is emitted.

More info about the ready app event.


@jmercouris I'm just wondering: (1) were you unaware of this or (2) did you assume that the app would be ready?

jmercouris commented 1 year ago

I think you can wait indefinitely and it will never emit the "ready" signal. That is what I experienced on Qt. Not sure if it is different here. If you think this signal will work, perhaps it is the way.

aadcg commented 1 year ago

When you mention Qt, do you mean Nyxt's support for QtWebEngine or that Electron's binary relies on Qt for Linux?

jmercouris commented 1 year ago

I mean when in the past I was using QtWebEngine

aadcg commented 1 year ago

The signal works properly on Electron.

jmercouris commented 1 year ago

OK then :-)

jmercouris commented 1 year ago

Well, I've waited, and waited... and I've never seen this signal emitted. If we add a "isReady" listener, will it magically start being emitted? This by the way has led to bugs of javascript not being evaluated in the message buffer.

aadcg commented 1 year ago

One thing at a time @jmercouris. No information is better than bad information. This is not related to JS evaluation in the message buffer.

jmercouris commented 1 year ago

Except... it is! You shall see later today.

aadcg commented 1 year ago

If it would be, then I wouldn't be able to accomplish what you see below.

2023-09-20_17:50:37

jmercouris commented 1 year ago

I DON'T BELIEVE I CANNOT BELIEVE

aadcg commented 7 months ago

Commit 372d81f0daccc2a207d257680c15ff63263375dd solved this issue.

We may have to return to this topic, but the issue needs to be re-framed.