-
Notifications
You must be signed in to change notification settings - Fork 15k
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
ready-to-show never fires #7779
Comments
Are you able to reproduce this on 1.4.x? |
So it fires in 1.3.6 but not in 1.3.7? |
@kevinsawicki also repros on 1.4.4, 1.3.7. Let me step further back in time. |
@kevinsawicki definitely working in 1.2.7. |
@CharlieHess what about 1.3.6? |
@kevinsawicki works in 1.3.6 (sorry this took so long, had to dig through old releases and get them building). |
Hmm, that is really strange, the only change from 1.3.6 to 1.3.7 was a node upgrade, v1.3.6...v1.3.7 I'm surprised that upgrade would impact this event firing unless something with the event loop integration broke/regressed. |
@CharlieHess any progress on this? |
No, we swapped out the event and moved on to other things. 😞 I'll let you know if / when I get a simpler repro. |
As a work around, I think we can also emit Related: #6898. |
I'm running into the same issue with 1.4.8 (windows x64). The strange thing is that it was working fine and then all of a sudden it just stopped working. No changes were made to the startup script. Had to resort the |
@kevinsawicki I think I've identified the issue. Well sort of. I tried copying the main.js of my application over to an electron-quick-start project and it ran fine. So the only difference would be the index.html content that it was loading. I started stripping out content line by line and found that it was my main application bundle that was blocking the event. Unfortunately, my app is in a giant browserified bundle so I can't tell where the problem is. Also it doesn't throw any errors and using Also, if |
Also hit this issue. It turns out that when Electron was maximized, and it'd restart, maximized, the the window would show, but this event would never fire. Despite having my windows set visibility to false, I'm assuming it doesn't fire because of this: electron/atom/browser/native_window.cc Line 565 in fcc7dc7
If it matters, I'm also using https://github.com/mawie81/electron-window-state which may be triggering something to cause this issue. |
I'm also having issues. Here is an example (I'm using const {app, BrowserWindow} = require('electron');
function createWindow () {
// Create the browser window.
win = new BrowserWindow({width: 800, height: 600});
// Emitted when the window is closed.
win.on('closed', () => {
console.log('closed!');
win = null
})
win.on('ready-to-show', () => console.log("READY TO SHOW!"));
// and load the url of the app.
win.loadURL('https://www.google.com');
}
app.on('ready', createWindow); On this example, |
I am also experiencing this on electron 1.6.2, using the most trivial example code on OSX |
I have the same problem, electron 1.6.2 running on elementary os (ubuntu 16.04) |
I have same problem in electron 1.6.2, windows 7 :( |
Have the same trouble. |
Here is my situation. |
I'm seeing the same behavior as @Zlocoder, Version: |
+1 |
A similar problem with ips, which was not in version 2, but appeared in version 3. Test code
index.js
Version: electron@3.0.7 on Ubuntu 16 |
Same Issue
|
Same Issue. But I realised that if win.maximize() is called, then ready-to-show event does not fire. It worked after having removed the call to maximize(). Hope it helps! Thanks, |
Confirmed to work under Electron 5, 6, 7. Feel free to open a new issue if this problem persists under one of these (currently supported) versions. |
@deermichel This issue still exists in Electron 5.0.6. In the electron quick start example, make main.js:
When you call |
@deermichel Actually, nevermind that's documented behavior. |
Still seeing this issue with v6.1.2. Is there any way I can maximize before I hit "did-finish-load?" |
Also still seeing this in |
For me, |
Note for others. if you load a local html file with |
@devflow, interesting tip! What exactly is the difference between these two methods? Since |
@slapbox I'm pretty sure
vs
also the options objects that you can pass to them are different. |
@slapbox in my case,
|
I seem to still be having a similar problem. Is this a bug or a feature? I used electron-forge to create the project. const {app, BrowserWindow} = require('electron');
const path = require('path');
if (require('electron-squirrel-startup')) { // eslint-disable-line global-require
app.quit();
}
const createWindow = (WindowName,properties) => {
properties = properties || {}
properties.show = properties.show || false
properties.frame = properties.frame || false
if (!properties.webPreferences)
properties.webPreferences= {
nodeIntegration: true
}
var Window = new BrowserWindow(properties);
Window.once('ready-to-show',function(){
console.log('sending window to load')
Window.show();
Window.webContents.send('loadWindow', WindowName)
});
Window.loadFile(path.join(__dirname, '/window.html'));
return Window
};
const createMainWindows = () => {
mainWindow = createWindow('Main')//,{fullscreen:true});
toolbarWindow = createWindow('Tools',{
parent:mainWindow,
width: 200,
height: 400,
fullScreenable: false,
maxWidth: 300,
x: 10,
y: 60
});
};
app.on('ready', createMainWindows);
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit();
}
});
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createMainWindows();
}
}); I removed some comments but you should be able to replicate the issue with this |
@BlessonKu Try deleting the slash( |
…ed state resolves the "randomness" of the `open {filename}` command line syntax discussed in stuffmatic#11 solution came from this thread on the topic. electron/electron#7779
I'm having some trouble creating a minimal repro for this but it seems that the
ready-to-show
event is not firing for us, since ~1.3.7, despite us havingshow: false
in the window options. Filing this in case others are seeing the same behavior.We had to switch to using
browserWindow.webContents.on('dom-ready', ...
).The text was updated successfully, but these errors were encountered: