0

so im trying to implement transparent window with Electron, which should be un-interactable, except of one item, it can be some input or button etc...

So currently, im disabling frame and saying that setIgnoreMouseEvents should be true.

app.disableHardwareAcceleration();    
function createWindow() {
  mainWindow = new BrowserWindow({
    transparent: true,   //<- makes the window transparent
    frame: false,        //<- removes the window frame that i can interact with background
    alwaysOnTop: true,  //<- keeps the window always on top
    resizable: false,
    webPreferences: {
      preload: path.join(__dirname, 'preload.js'),
    }
  mainWindow.setIgnoreMouseEvents(true, { forward: true }); //<- ignores mouse to pass clicks through
  });

With code above i can access background, but not the Electron window and its element, all elements that are provided in it, are also transparent. Does someone have some ideas?

3
  • line end comment must start with // characters... Commented Apr 10 at 13:17
  • i know, just for visitors, so they'll understand it easily Commented Apr 10 at 14:03
  • I almost closed your question for typo error because of this ambiguity. Please take the tour to learn how Stack Overflow works and read How to Ask on how to improve the quality of your question. Then check the help center to see which questions are on-topic on this site. Commented Apr 10 at 14:35

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.