fix(electron): disable mica for windows for now (#6165)
Upstream https://github.com/electron/electron/issues/41073
This commit is contained in:
@@ -252,7 +252,7 @@ export function registerAffineSettingsCommands({
|
|||||||
]()}`,
|
]()}`,
|
||||||
category: 'affine:settings',
|
category: 'affine:settings',
|
||||||
icon: <SettingsIcon />,
|
icon: <SettingsIcon />,
|
||||||
preconditionStrategy: () => environment.isDesktop,
|
preconditionStrategy: () => environment.isDesktop && environment.isMacOs,
|
||||||
run() {
|
run() {
|
||||||
store.set(appSettingAtom, prev => ({
|
store.set(appSettingAtom, prev => ({
|
||||||
...prev,
|
...prev,
|
||||||
|
|||||||
@@ -11,7 +11,9 @@ export const AppContainer = (props: WorkspaceRootProps) => {
|
|||||||
<AppContainerWithoutSettings
|
<AppContainerWithoutSettings
|
||||||
useNoisyBackground={appSettings.enableNoisyBackground}
|
useNoisyBackground={appSettings.enableNoisyBackground}
|
||||||
useBlurBackground={
|
useBlurBackground={
|
||||||
appSettings.enableBlurBackground && environment.isDesktop
|
appSettings.enableBlurBackground &&
|
||||||
|
environment.isDesktop &&
|
||||||
|
environment.isMacOs
|
||||||
}
|
}
|
||||||
{...props}
|
{...props}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ export const AppearanceSettings = () => {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</SettingRow>
|
</SettingRow>
|
||||||
{
|
{environment.isMacOs && (
|
||||||
<SettingRow
|
<SettingRow
|
||||||
name={t['com.affine.appearanceSettings.translucentUI.title']()}
|
name={t['com.affine.appearanceSettings.translucentUI.title']()}
|
||||||
desc={t[
|
desc={t[
|
||||||
@@ -225,7 +225,7 @@ export const AppearanceSettings = () => {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</SettingRow>
|
</SettingRow>
|
||||||
}
|
)}
|
||||||
</SettingWrapper>
|
</SettingWrapper>
|
||||||
) : null}
|
) : null}
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -169,7 +169,11 @@ export const RootAppSidebar = ({
|
|||||||
return (
|
return (
|
||||||
<AppSidebar
|
<AppSidebar
|
||||||
hasBackground={
|
hasBackground={
|
||||||
!(appSettings.enableBlurBackground && environment.isDesktop)
|
!(
|
||||||
|
appSettings.enableBlurBackground &&
|
||||||
|
environment.isDesktop &&
|
||||||
|
environment.isMacOs
|
||||||
|
)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<MoveToTrash.ConfirmModal
|
<MoveToTrash.ConfirmModal
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ async function createWindow(additionalArguments: string[]) {
|
|||||||
minHeight: 480,
|
minHeight: 480,
|
||||||
visualEffectState: 'active',
|
visualEffectState: 'active',
|
||||||
vibrancy: 'under-window',
|
vibrancy: 'under-window',
|
||||||
backgroundMaterial: 'mica',
|
// backgroundMaterial: 'mica',
|
||||||
height: mainWindowState.height,
|
height: mainWindowState.height,
|
||||||
show: false, // Use 'ready-to-show' event to show window
|
show: false, // Use 'ready-to-show' event to show window
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
@@ -117,15 +117,18 @@ async function createWindow(additionalArguments: string[]) {
|
|||||||
|
|
||||||
browserWindow.on('maximize', () => {
|
browserWindow.on('maximize', () => {
|
||||||
uiSubjects.onMaximized.next(true);
|
uiSubjects.onMaximized.next(true);
|
||||||
|
browserWindow.setBackgroundMaterial('none');
|
||||||
});
|
});
|
||||||
|
|
||||||
// full-screen == maximized in UI on windows
|
// full-screen == maximized in UI on windows
|
||||||
browserWindow.on('enter-full-screen', () => {
|
browserWindow.on('enter-full-screen', () => {
|
||||||
uiSubjects.onMaximized.next(true);
|
uiSubjects.onMaximized.next(true);
|
||||||
|
browserWindow.setBackgroundMaterial('none');
|
||||||
});
|
});
|
||||||
|
|
||||||
browserWindow.on('unmaximize', () => {
|
browserWindow.on('unmaximize', () => {
|
||||||
uiSubjects.onMaximized.next(false);
|
uiSubjects.onMaximized.next(false);
|
||||||
|
browserWindow.setBackgroundMaterial('none');
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user