GithubHelp home page GithubHelp logo

Comments (8)

mawie81 avatar mawie81 commented on May 25, 2024 6

If you do not mind having multiple files then can currently simply pass different filenames for each windowStateKeeper instance:

let mainWindowState = windowStateKeeper({
    file: 'main.json',
    defaultWidth: 1000,
    defaultHeight: 800
  });

let settingsWindowState = windowStateKeeper({
    file: 'settings.json',
    defaultWidth: 1000,
    defaultHeight: 800
  });

from electron-window-state.

zeke avatar zeke commented on May 25, 2024 1

I haven't done much digging yet, but It might be as simple as adding an optional identifier string, like

let mainWindowState = windowStateKeeper({
  id: 'main',
  defaultWidth: 1000
})

let preferencesWindowState = windowStateKeeper({
  id: 'preferences',
  defaultWidth: 500
})

from electron-window-state.

mawie81 avatar mawie81 commented on May 25, 2024 1

Extended the documentation of the file attribute.

from electron-window-state.

zeke avatar zeke commented on May 25, 2024

Hey @mawie81 thanks for creating this module! It's working great so far.

But I think I just ran into this issue. Is the module designed to only persist the state for a single window?

from electron-window-state.

tim-lynn-clark avatar tim-lynn-clark commented on May 25, 2024

This would be an extremely nice feature to have. I currently have a multi-window application and if I use electron-window-state to manage the state of each window and I resize all the open windows to different sizes and place them in different locations when I restart the application, all of the windows will use the size and location of the last window to be adjusted. This lays all the windows on top of each other and at the same size instead of preserving the state of each individual window.

Any idea of you will be implementing this?

from electron-window-state.

tim-lynn-clark avatar tim-lynn-clark commented on May 25, 2024

Adding the 'file' attribute works beautifully. Thanks!

from electron-window-state.

zeke avatar zeke commented on May 25, 2024

It would be good to document this tip in the README somewhere.

from electron-window-state.

shinde-ha avatar shinde-ha commented on May 25, 2024

I have a trick question:

Is it possible to create one 'application config'.json file to store and manage different browser windows?
Will it have all the properties associated with each browser window and there should be a point of reference provided by the programmer?

Newbie here!

from electron-window-state.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.