sentialx / node-window-manager

Manage windows in Windows, macOS and Linux using Node.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

setBounds not working on macos using Window class

KASOGIT opened this issue · comments

My use-case: i have an integer representing the id of the window i wanna share then i use directly new Window(id) and getInfo give me exactly the right window but setBounds not working with this method.

My work around: loop over getWindows and use the window matching the id.

Expected behavior: first method should work directly.

Some code illustrating what i'm saying:

    // first not working method
    const selectedWin = new Window(parsedId);

    // second working workaround
    const selectedWin = windowManager.getWindows().find(window => {
      return window.id === parsedId;
    });

    selectedWin.setBounds({
      x: screenBounds.x + sideBarWidth + 15,
      y: screenBounds.y,
      width: screenBounds.width - sideBarWidth - 15,
      height: screenBounds.height,
    });

Best regards

Fixed in 57821c3

Thanks <3