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

Shows old windows style title bar when maximized #37

Open
codeAbinash opened this issue Mar 23, 2024 · 7 comments
Open

Shows old windows style title bar when maximized #37

codeAbinash opened this issue Mar 23, 2024 · 7 comments

Comments

@codeAbinash
Copy link

Shows old windows style title bar when maximized.

Screenshot (111)

But in normal window it works fine.

Screenshot 2024-03-23 134219

mica-electron version 1.5.3

function createWindow(): void {
  const mainWindow = new MicaBrowserWindow({
    width: 1100,
    height: 600,
    show: false,
    titleBarStyle: 'default',
    autoHideMenuBar: true,
    ...(process.platform === 'linux' ? { icon } : {}),
    webPreferences: {
      preload: join(__dirname, '../preload/index.js'),
      sandbox: false
    }
  })

  mainWindow.setDarkTheme()
  mainWindow.setMicaEffect()

  mainWindow.on('ready-to-show', () => {
    mainWindow.show()
  })

  mainWindow.webContents.setWindowOpenHandler((details) => {
    shell.openExternal(details.url)
    return { action: 'deny' }
  })

  // HMR for renderer base on electron-vite cli.
  // Load the remote URL for development or the local html file for production.
  if (is.dev && process.env['ELECTRON_RENDERER_URL']) {
    mainWindow.loadURL(process.env['ELECTRON_RENDERER_URL'])
  } else {
    mainWindow.loadFile(join(__dirname, '../renderer/index.html'))
  }
}


Is there any solution?
@gaetandezeiraud
Copy link

Same problem for me.

@codeAbinash
Copy link
Author

Any solution?

@GregVido
Copy link
Owner

GregVido commented May 8, 2024

Hello, I have been working on the problem for several months, it is quite complicated to solve, I need to understand how the maximize screen is interpreted under Windows (API, C...). This bug only affects Electron v27.0.0 and above.

@GregVido
Copy link
Owner

GregVido commented May 8, 2024

I finally found how to fix this, you can update mica-electron (very good timing though) 🥳🥳

@tiagorangel1
Copy link

tiagorangel1 commented Jul 22, 2024

It's still using the old titlebar for me. I'm using the latest version, 1.5.15

image

@tiagorangel1
Copy link

This is the only thing preventing me from using this

@ilnomR0
Copy link

ilnomR0 commented Aug 15, 2024

it appears to be a bug starting from 1.5.11, when using this version it says "ReferenceError: IS_WINDOWS_11 is not defined", then the following update 1.5.12 goes back to the old windows title bar, downgrading anywhere between and including 1.5.6 to 1.5.10 seems to fix it for me

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

No branches or pull requests

5 participants