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]: The title bar overlay is not updated to fit the settings of the window #32285

Closed
3 tasks done
0xENDER opened this issue Dec 25, 2021 · 7 comments · Fixed by #34677
Closed
3 tasks done

[Bug]: The title bar overlay is not updated to fit the settings of the window #32285

0xENDER opened this issue Dec 25, 2021 · 7 comments · Fixed by #34677

Comments

@0xENDER
Copy link

0xENDER commented Dec 25, 2021

Preflight Checklist

Electron Version

16.0.5

What operating system are you using?

Windows

Operating System Version

Windows 11 21H2

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

If a window has the maximizable property set to false, the built-in title bar overlay should be updated and the maximise button should be disabled. And if a window has the minimizable property set to false, the built-in title bar overlay should be updated and the minimise button should be disabled.

Actual Behavior

These buttons are still active on the windows that have these properties set to false.
image

Main Window (the first one):
maximizable -> true
minimizable -> true

Editor Window (the second one):
maximizable -> true
minimizable -> true

Custom Alert Window (the third one):
maximizable -> false
minimizable -> true

About Window (the fourth one):
maximizable -> false
minimizable -> false

Testcase Gist URL

No response

Additional Information

No response

@ahmadjubair33
Copy link

can i contribute to this
?

@codebytere
Copy link
Member

Thanks for reporting this and helping to make Electron better!

Because of time constraints, triaging code with third-party dependencies is usually not feasible for a small team like Electron's.

Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, Electron Fiddle is a great tool for making small test cases and makes it easy to publish your test case to a gist that Electron maintainers can use.

Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests.

I'm adding the blocked/need-repro label for this reason. After you make a test case, please link to it in a followup comment. This issue will be closed in 10 days if the above is not addressed.

@limacheb
Copy link

I'd very much appreciate a fix of this bug as well.
I am adding a Gist URL here to reproduce the issue.
I hope this is fine.
https://gist.github.com/b678be9ee0717d20e946bfaef0f9b8d0

@limacheb
Copy link

Still happening in Electron 19.
This makes the WCO unusable for us.
I would appreciate a statement from the electron team in respect to the timeline by when this could be fixed. Otherwise planning is difficult.

@codebytere
Any update?
Any simple workaround? Unfortunately there is no event such as 'will-maximize' in order to cancel maximizing the window

@limacheb
Copy link

Possible (ugly) workaround:

  window.on('minimize', (event) => {
      setTimeout(() => window.restore(), 0)
  });

@codebytere codebytere self-assigned this Jun 21, 2022
@codebytere codebytere added component/wco and removed blocked/need-repro Needs a test case to reproduce the bug labels Jun 21, 2022
@codebytere
Copy link
Member

hey folks - got around to this, PR is up at #34677

@limacheb
Copy link

limacheb commented Jul 2, 2022

@codebytere
Thanks a lot! Works fine.

Still, I do see a related issue:

  • I start my window in maximzed state (calling method maximize() immediate after the BrowserWindow creation.
  • The window gets maximized, the 'minimize' caption button is disabled => This is all fine.
  • The 'unmaximize' button is enabled though => One could consider this button to be disabled as well, like the 'maximize' button is when the window is in 'unmaximize' state

@codebytere What do you think?

function createWindow () {
  // Create the browser window.
  const mainWindow = new BrowserWindow({
    width: 800,
    height: 600,
    minimizable: false,
    maximizable: false,
    resizable: false,
    // closable: false,
    movable: false,
    titleBarStyle: 'hidden',
    titleBarOverlay: {
      color: '#ffffff'
    },
    frame: false,
    webPreferences: {
      preload: path.join(__dirname, 'preload.js')
    }
  })
  mainWindow.maximize()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants