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

screen.highlight closes Electron window #505

Closed
1 of 3 tasks
s1hofmann opened this issue Apr 18, 2023 · 1 comment
Closed
1 of 3 tasks

screen.highlight closes Electron window #505

s1hofmann opened this issue Apr 18, 2023 · 1 comment
Labels
bug Something isn't working DONE Implementation is done, but not yet merged into master
Milestone

Comments

@s1hofmann
Copy link
Member

Version
3.1.1

Short overview
When calling screen.highlight in an Electron application quits the Electron application

Issue occurs on

  • Virtual machine
  • Docker container
  • Dev/Host system

macOS Ventura, 13.3.1

Steps to reproduce error
A simple Electron application with something like

const { app, BrowserWindow } = require('electron')
const {screen, Region} = require("@nut-tree/nut-js");

const path = require('path')

// modify your existing createWindow() function
const createWindow = () => {
  const win = new BrowserWindow({
    width: 800,
    height: 600,
    webPreferences: {
      preload: path.join(__dirname, 'preload.js')
    }
  })

  win.loadFile('index.html')
}

app.on('window-all-closed', () => {
  if (process.platform !== 'darwin') app.quit()
})

app.whenReady().then(() => {
  createWindow()
  screen.highlight(new Region(0, 0, 100, 100));

  app.on('activate', () => {
    if (BrowserWindow.getAllWindows().length === 0) createWindow()
  })
})
@s1hofmann s1hofmann added the bug Something isn't working label Apr 18, 2023
@s1hofmann s1hofmann added this to the v3.1.2 milestone Apr 28, 2023
s1hofmann added a commit to nut-tree/libnut-core that referenced this issue Jun 5, 2023
s1hofmann added a commit to nut-tree/libnut-core that referenced this issue Jun 5, 2023
@s1hofmann s1hofmann added the DONE Implementation is done, but not yet merged into master label Jun 5, 2023
@s1hofmann
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working DONE Implementation is done, but not yet merged into master
Projects
None yet
Development

No branches or pull requests

1 participant