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

Error "Mica-Electron work only on Windows 11." #38

Open
gaetandezeiraud opened this issue May 18, 2024 · 5 comments
Open

Error "Mica-Electron work only on Windows 11." #38

gaetandezeiraud opened this issue May 18, 2024 · 5 comments

Comments

@gaetandezeiraud
Copy link

gaetandezeiraud commented May 18, 2024

I got "Mica-Electron work only on Windows 11." when running on Windows 10.
But at the same time, the Github Readme say "Mica electron is now compatible with windows 10".
What is true?

I use it like so:

  // Enable mica or acrylic
  if (IS_WINDOWS_11) {
    mainWindow.setMicaEffect();
  } else {
    mainWindow.setAcrylic();
  }

Thanks.

@gaetandezeiraud
Copy link
Author

Same as #31
I am on the version 1.5.9. It is a regression?

@GregVido
Copy link
Owner

Hi, yes it's true, can I see all of your code to understand where the problem is?

@gaetandezeiraud
Copy link
Author

Thank you for the answer.
Nothing more, the code I quoted. And the use of MicaBrowserWindow.

import { app } from 'electron';
const { MicaBrowserWindow, IS_WINDOWS_11 } = require('mica-electron');

...

// Create the browser window.
  mainWindow = new MicaBrowserWindow({
    autoHideMenuBar: true,
    minHeight: 500,
    minWidth: 980,
    width: 1070,
    height: 650,
    show: false,
    webPreferences: {
      preload: path.join(__dirname, 'preload.js'),
    },
  });

  // Enable mica or acrylic
  if (IS_WINDOWS_11) {
    mainWindow.setMicaEffect();
  } else {
    mainWindow.setAcrylic();
  }

  // Dark or Light theme
  const currTheme = store.get('theme', 'system');
  if (currTheme == 'dark') {
    mainWindow.setDarkTheme();
  } else if (currTheme == 'light') {
    mainWindow.setLightTheme();
  } else {
    mainWindow.setAutoTheme();
  }

@gaetandezeiraud
Copy link
Author

Okay, after more investigation, seems related to setAutoTheme / setDarkTheme / setLightTheme who are only for Windows 11.

@gaetandezeiraud
Copy link
Author

Not fixed finally.
The error is trigger here

napi_throw_error(env, nullptr, "Mica-Electron work only on Windows 11.");

This was referenced Jul 9, 2024
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

2 participants