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

[Bug]: TypeError: win.setTitleBarOverlay is not a function #41938

Closed
3 tasks done
imp-oh opened this issue Apr 23, 2024 · 1 comment · Fixed by #41960
Closed
3 tasks done

[Bug]: TypeError: win.setTitleBarOverlay is not a function #41938

imp-oh opened this issue Apr 23, 2024 · 1 comment · Fixed by #41960
Assignees
Labels
30-x-y bug 🪲 platform/windows status/confirmed A maintainer reproduced the bug or agreed with the feature

Comments

@imp-oh
Copy link

imp-oh commented Apr 23, 2024

Preflight Checklist

Electron Version

30.0.0

What operating system are you using?

Windows

Operating System Version

win10

What arch are you using?

x64

Last Known Working Electron version

30.0.1

Expected Behavior

// In the main process.
const { BaseWindow, WebContentsView, app } = require('electron')

app.whenReady().then(() => {
  const win = new BaseWindow({ width: 800, height: 600 ,  titleBarStyle: 'hidden',})

  win.setTitleBarOverlay({
    color: '#DEE1E6',
    symbolColor: 'black',
    height: 30
  })

  const leftView = new WebContentsView()
  leftView.webContents.loadURL('https://electronjs.org')
  win.contentView.addChildView(leftView)

  // const rightView = new WebContentsView()
  // rightView.webContents.loadURL('https://github.com/electron/electron')
  // win.contentView.addChildView(rightView)

  leftView.setBounds({ x: 0, y: 0, width: 400, height: 600 })
  // rightView.setBounds({ x: 400, y: 0, width: 400, height: 600 })
})

Actual Behavior

Want to support setTitleBarOverlay api

Testcase Gist URL

No response

Additional Information

(node:20488) UnhandledPromiseRejectionWarning: TypeError: win.setTitleBarOverlay is not a function
at E:\Hui\Github\ce-hub\cehub-browser-window\out\main\index.js:18:9
(Use electron --trace-warnings ... to show where the warning was created)
(node:20488) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)

@AliasT
Copy link

AliasT commented Apr 23, 2024

seems only works with BrowserWindow.

@codebytere codebytere self-assigned this Apr 24, 2024
@codebytere codebytere added platform/windows 30-x-y status/confirmed A maintainer reproduced the bug or agreed with the feature labels Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
30-x-y bug 🪲 platform/windows status/confirmed A maintainer reproduced the bug or agreed with the feature
Projects
Status: 🛑 Blocks Stable
Development

Successfully merging a pull request may close this issue.

3 participants