mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 13:05:32 +09:00
fix(app): make click-through the default and move animation pausing to Accessibility (#1722)
This commit is contained in:
1 parent
9e89539f0a
commit
4bbfee4cec
19 files changed
+96
-248
No files matched your search
@@ -31,7 +31,6 @@ interface PersistedDesktopWindowBehaviorSettings {
|
||||
allowTransparency?: boolean;
|
||||
smoothScrolling?: boolean;
|
||||
middleClickAutoscroll?: boolean;
|
||||
firstClickPassThroughWhenUnfocused?: boolean;
|
||||
}
|
||||
|
||||
interface PersistedDesktopTroubleshootingSettings {
|
||||
@@ -62,7 +61,6 @@ function getDefaultDesktopWindowBehaviorSettings(): DesktopWindowBehaviorSetting
|
||||
activeSmoothScrolling: true,
|
||||
middleClickAutoscroll: false,
|
||||
activeMiddleClickAutoscroll: false,
|
||||
firstClickPassThroughWhenUnfocused: false,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -95,9 +93,6 @@ function sanitizePersistedDesktopWindowBehaviorSettings(
|
||||
if (typeof value.middleClickAutoscroll === 'boolean') {
|
||||
settings.middleClickAutoscroll = value.middleClickAutoscroll;
|
||||
}
|
||||
if (typeof value.firstClickPassThroughWhenUnfocused === 'boolean') {
|
||||
settings.firstClickPassThroughWhenUnfocused = value.firstClickPassThroughWhenUnfocused;
|
||||
}
|
||||
const minimizeToTrayV2 = value[MINIMIZE_TO_TRAY_STORAGE_KEY_V2];
|
||||
if (typeof minimizeToTrayV2 === 'boolean') {
|
||||
settings.minimizeToTrayV2 = minimizeToTrayV2;
|
||||
@@ -238,10 +233,6 @@ function normalizeDesktopWindowBehaviorSettings(
|
||||
: typeof normalizedSettings?.middleClickAutoscroll === 'boolean'
|
||||
? normalizedSettings.middleClickAutoscroll
|
||||
: defaults.middleClickAutoscroll,
|
||||
firstClickPassThroughWhenUnfocused:
|
||||
typeof normalizedSettings?.firstClickPassThroughWhenUnfocused === 'boolean'
|
||||
? normalizedSettings.firstClickPassThroughWhenUnfocused
|
||||
: defaults.firstClickPassThroughWhenUnfocused,
|
||||
};
|
||||
if (!normalized.showTrayIcon) {
|
||||
normalized.minimizeToTray = false;
|
||||
@@ -260,7 +251,6 @@ function serializeDesktopWindowBehaviorSettings(
|
||||
allowTransparency: settings.allowTransparency,
|
||||
smoothScrolling: settings.smoothScrolling,
|
||||
middleClickAutoscroll: settings.middleClickAutoscroll,
|
||||
firstClickPassThroughWhenUnfocused: settings.firstClickPassThroughWhenUnfocused,
|
||||
[MINIMIZE_TO_TRAY_STORAGE_KEY_V2]: settings.minimizeToTray,
|
||||
[CLOSE_TO_TRAY_STORAGE_KEY_V2]: settings.closeToTray,
|
||||
};
|
||||
|
||||
@@ -120,7 +120,6 @@ export interface DesktopWindowBehaviorSettings {
|
||||
activeSmoothScrolling: boolean;
|
||||
middleClickAutoscroll: boolean;
|
||||
activeMiddleClickAutoscroll: boolean;
|
||||
firstClickPassThroughWhenUnfocused: boolean;
|
||||
}
|
||||
|
||||
export interface ThemeLocalFileReference {
|
||||
|
||||
@@ -322,7 +322,6 @@ function formatWindowBehavior(settings: DesktopWindowBehaviorSettings): string {
|
||||
`activeSmoothScrolling=${settings.activeSmoothScrolling}`,
|
||||
`middleClickAutoscroll=${settings.middleClickAutoscroll}`,
|
||||
`activeMiddleClickAutoscroll=${settings.activeMiddleClickAutoscroll}`,
|
||||
`firstClickPassThroughWhenUnfocused=${settings.firstClickPassThroughWhenUnfocused}`,
|
||||
].join(', ');
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,6 @@ import {
|
||||
import {
|
||||
clearSavedWindowBounds,
|
||||
closeThemeStudioPopoutWindow,
|
||||
desktopFirstClickPassThroughPendingRestart,
|
||||
desktopTransparencyPendingRestart,
|
||||
desktopUseNativeTitleBarPendingRestart,
|
||||
focusThemeStudioPopoutWindow,
|
||||
@@ -123,9 +122,6 @@ function normalizeDesktopWindowBehaviorUpdate(value: unknown): Partial<DesktopWi
|
||||
if (typeof value.middleClickAutoscroll === 'boolean') {
|
||||
update.middleClickAutoscroll = value.middleClickAutoscroll;
|
||||
}
|
||||
if (typeof value.firstClickPassThroughWhenUnfocused === 'boolean') {
|
||||
update.firstClickPassThroughWhenUnfocused = value.firstClickPassThroughWhenUnfocused;
|
||||
}
|
||||
return update;
|
||||
}
|
||||
|
||||
@@ -255,7 +251,6 @@ export function registerIpcHandlers(): void {
|
||||
ipcMain.handle('desktop-window-behavior-pending-restart', (): boolean => {
|
||||
return (
|
||||
desktopTrayChangePendingRestart() ||
|
||||
desktopFirstClickPassThroughPendingRestart() ||
|
||||
desktopUseNativeTitleBarPendingRestart() ||
|
||||
desktopTransparencyPendingRestart()
|
||||
);
|
||||
|
||||
@@ -145,7 +145,6 @@ interface CreateWindowOptions {
|
||||
let mainWindow: BrowserWindow | null = null;
|
||||
let windowStateFile: string;
|
||||
let isQuitting = false;
|
||||
let initialAcceptFirstMouseOnFocus: boolean | null = null;
|
||||
let initialUseNativeTitleBar: boolean | null = null;
|
||||
let initialAllowTransparency: boolean | null = null;
|
||||
let themeStudioPopoutWindow: BrowserWindow | null = null;
|
||||
@@ -331,12 +330,6 @@ export function getMainWindow(): BrowserWindow | null {
|
||||
return mainWindow;
|
||||
}
|
||||
|
||||
export function desktopFirstClickPassThroughPendingRestart(): boolean {
|
||||
if (process.platform !== 'darwin') return false;
|
||||
if (initialAcceptFirstMouseOnFocus === null) return false;
|
||||
return getDesktopWindowBehaviorSettings().firstClickPassThroughWhenUnfocused !== initialAcceptFirstMouseOnFocus;
|
||||
}
|
||||
|
||||
export function getActiveUseNativeTitleBar(): boolean {
|
||||
return initialUseNativeTitleBar ?? false;
|
||||
}
|
||||
@@ -730,8 +723,7 @@ export function createWindow(options: CreateWindowOptions = {}): BrowserWindow {
|
||||
const desktopWindowBehavior = getDesktopWindowBehaviorSettings();
|
||||
const allowTransparency = desktopWindowBehavior.allowTransparency;
|
||||
const useNativeTitleBar = getEffectiveUseNativeTitleBar(desktopWindowBehavior);
|
||||
const acceptFirstMouseOnFocus = isMac && desktopWindowBehavior.firstClickPassThroughWhenUnfocused;
|
||||
initialAcceptFirstMouseOnFocus = acceptFirstMouseOnFocus;
|
||||
const acceptFirstMouseOnFocus = isMac;
|
||||
initialUseNativeTitleBar = useNativeTitleBar;
|
||||
initialAllowTransparency = allowTransparency;
|
||||
const appUrl = getAppUrl();
|
||||
|
||||
Reference in new issue
Block a user