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

NW2 issue : (Linux) NW.js crashes when an opened window has attached the 'move' event #7359

Closed
DimPaDev opened this issue Feb 6, 2020 · 4 comments

Comments

@DimPaDev
Copy link

DimPaDev commented Feb 6, 2020

NWJS Version : 0.44.0
Operating System : Linux (Reproduced on Fedora 31, gnome and kde)

Expected behavior

When you open a new window and you attach events to it from the Window api, the application shouldn't crash even if you try to open the devtools window to inspect it.

Actual behavior

When you open a new window and this window has attached in particular the 'move' event and you try to open the devtools window to inspect, the entire application crashes, if you don't attach the move event to the new window (or you add --disable-features=nw2 to chromium args) everything is fine.

Finally, I tested this on Windows 10 too and this problem doesn't exist either.

How to reproduce

DEMO:
nw-test-crash-bug.zip

@DimPaDev
Copy link
Author

DimPaDev commented Feb 6, 2020

#7230

@DimPaDev
Copy link
Author

DimPaDev commented Feb 8, 2020

I found out that if you open the dev tools window programmatically BEFORE attaching the 'move' event to the window, the application will NOT crash and the dev tools window will be opened. For example :


        function openNewWindow() {
          console.log('ok open new window..');
          nw.Window.open('./new_win.html', {
            title: 'App Title',
            show: true,
            show_in_taskbar: true,
            position: 'center',
            width: 400,
            height: 400,
            fullscreen: false,
            frame: true,
            transparent: false,
            resizable: true,
            always_on_top: false,
            kiosk: false
          }, newWin => {

            newWin.showDevTools();

            newWin.on('loaded', () => {
              newWin.on('move', (x, y) => {
                console.log(`ok move event triggered`);
              });
            });
          });
   }

But, if you try to open the DevTools for a window when the 'move' event is already attached (in nw2 mode) the application will crash altogether.

@rogerwang
Copy link
Member

This is fixed in git and will be available in the next nightly build.

@DimPaDev
Copy link
Author

DimPaDev commented Feb 9, 2020

I tested it using the nightly build and it's fixed! Thank you!

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

No branches or pull requests

2 participants