Skip to content

Commit

Permalink
fix(electron): disable mica for windows for now (#6165)
Browse files Browse the repository at this point in the history
  • Loading branch information
pengx17 committed Mar 18, 2024
1 parent 386bd03 commit e896f19
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/frontend/core/src/commands/affine-settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ export function registerAffineSettingsCommands({
]()}`,
category: 'affine:settings',
icon: <SettingsIcon />,
preconditionStrategy: () => environment.isDesktop,
preconditionStrategy: () => environment.isDesktop && environment.isMacOs,
run() {
store.set(appSettingAtom, prev => ({
...prev,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ export const AppContainer = (props: WorkspaceRootProps) => {
<AppContainerWithoutSettings
useNoisyBackground={appSettings.enableNoisyBackground}
useBlurBackground={
appSettings.enableBlurBackground && environment.isDesktop
appSettings.enableBlurBackground &&
environment.isDesktop &&
environment.isMacOs
}
{...props}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export const AppearanceSettings = () => {
}
/>
</SettingRow>
{
{environment.isMacOs && (
<SettingRow
name={t['com.affine.appearanceSettings.translucentUI.title']()}
desc={t[
Expand All @@ -225,7 +225,7 @@ export const AppearanceSettings = () => {
}
/>
</SettingRow>
}
)}
</SettingWrapper>
) : null}
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,11 @@ export const RootAppSidebar = ({
return (
<AppSidebar
hasBackground={
!(appSettings.enableBlurBackground && environment.isDesktop)
!(
appSettings.enableBlurBackground &&
environment.isDesktop &&
environment.isMacOs
)
}
>
<MoveToTrash.ConfirmModal
Expand Down
5 changes: 4 additions & 1 deletion packages/frontend/electron/src/main/main-window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ async function createWindow(additionalArguments: string[]) {
minHeight: 480,
visualEffectState: 'active',
vibrancy: 'under-window',
backgroundMaterial: 'mica',
// backgroundMaterial: 'mica',
height: mainWindowState.height,
show: false, // Use 'ready-to-show' event to show window
webPreferences: {
Expand Down Expand Up @@ -117,15 +117,18 @@ async function createWindow(additionalArguments: string[]) {

browserWindow.on('maximize', () => {
uiSubjects.onMaximized.next(true);
browserWindow.setBackgroundMaterial('none');
});

// full-screen == maximized in UI on windows
browserWindow.on('enter-full-screen', () => {
uiSubjects.onMaximized.next(true);
browserWindow.setBackgroundMaterial('none');
});

browserWindow.on('unmaximize', () => {
uiSubjects.onMaximized.next(false);
browserWindow.setBackgroundMaterial('none');
});

/**
Expand Down

0 comments on commit e896f19

Please sign in to comment.