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

win_options will not work from second time #33

Closed
ghost opened this issue Nov 6, 2018 · 6 comments
Closed

win_options will not work from second time #33

ghost opened this issue Nov 6, 2018 · 6 comments

Comments

@ghost
Copy link

ghost commented Nov 6, 2018

About-window version: ^1.12.1(install from npmjs.com)
ElectronJS Version: ^3.0.7
OS: macOS Mojave 10.14.2

Details in Codes

const aboutWindowInfo = {
  icon_path: path.join(__dirname, '/assets/icon.png'),
  open_devtools: false,
  use_version_info: false,
  win_options: {titleBarStyle: 'hidden', minimizable: false, movable: false, resizable: false,maximizable: false}
}
{
    label: `About this app`,
    click: () => openAboutWindow(aboutWindowInfo)
}

When run this app and click the menu About this app for first time, the win_options will work well

screen shot 2018-11-06 at 3 05 36 pm

But from the second, each time I click the menu About this app, the win_options will not work

screen shot 2018-11-06 at 3 05 49 pm

This window has titleBar, and it can be moved, resized and more.

@tsvetilian-ty
Copy link
Contributor

tsvetilian-ty commented Nov 7, 2018

@H9 I was not able to reproduce the problem in Windows, can you try to clone this repo > run npm install > change main.js in example directory (win_options) > run npm start debug

@ghost
Copy link
Author

ghost commented Nov 8, 2018

@tsvetilian-ty thanks for the reply, I did as you asked on Mac, it works well, but in my project that uses this package, still can show that bug. Please look at following link that I take a record for you.

https://www.dropbox.com/s/00jxqqkqc5rcldk/Screen%20Recording%202018-11-08%20at%209.09.31%20PM.mov?dl=0

It's so strange.

@tsvetilian-ty
Copy link
Contributor

tsvetilian-ty commented Nov 8, 2018

@H9 it looks like the about window is going to it's default state. Can you try to pass the AboutWindowInfo object directly ?

{
    label: `About this app`,
    click: () => openAboutWindow({
                     icon_path: path.join(__dirname, '/assets/icon.png'),
                     open_devtools: false,
                     use_version_info: false,
                     win_options: {titleBarStyle: 'hidden', minimizable: false, movable: false, resizable: false,maximizable: false}
    })
}

@ghost
Copy link
Author

ghost commented Nov 8, 2018

@tsvetilian-ty I tried, but still the same.

@bampakoa
Copy link
Contributor

I have the same exact problem in Windows 10. Here is a gist, to use with Electron Fiddle, that showcases the actual problem. Thanks!

@bampakoa
Copy link
Contributor

bampakoa commented Oct 30, 2019

Until the #49 is merged you can try to pass a clone of your options object such as:


const options = {
 ....
}
openAboutWindow({...options});

@rhysd rhysd closed this as completed in 1224501 Nov 3, 2019
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