Skip to content

Commit

Permalink
Made both hardware event types togglable in debug settings
Browse files Browse the repository at this point in the history
  • Loading branch information
xanderfrangos committed Jan 18, 2024
1 parent 91f4e13 commit 729a2b0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/components/SettingsWindow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1374,6 +1374,8 @@ export default class SettingsWindow extends PureComponent {
<SettingsOption title="VCP read delay" description="How long (in miliseconds) to delay returning a VCP code value. This can help some displays not return random errors." input={<input type="number" min="0" max="200" value={this.state.rawSettings.checkVCPWaitMS * 1} onChange={(e) => this.setSetting("checkVCPWaitMS", e.target.value)} /> } />

<SettingsOption title="Disable Auto Refresh" description="Prevent last known brightness from read after certain hardware/user events." input={this.renderToggle("disableAutoRefresh")} />
<SettingsOption title="Use Win32 hardware events" input={this.renderToggle("useWin32Event")} />
<SettingsOption title="Use Electron hardware events" input={this.renderToggle("useElectronEvents")} />
<SettingsOption title="Show console window (requires restart)" input={this.renderToggle("showConsole")} />
<SettingsOption title="Use Taskbar Registry" input={this.renderToggle("useTaskbarRegistry")} />
<SettingsOption title="Disable Mouse Events (requires restart)" input={this.renderToggle("disableMouseEvents")} />
Expand Down
10 changes: 6 additions & 4 deletions src/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,8 @@ const defaultSettings = {
disableWMI: false,
disableWin32: false,
autoDisabledWMI: false,
useWin32Event: true,
useElectronEvents: true,
defaultOverlayType: "safe",
disableMouseEvents: false,
disableThrottling: false,
Expand Down Expand Up @@ -3469,10 +3471,10 @@ function addEventListeners() {
systemPreferences.on('color-changed', handleAccentChange)
nativeTheme.on('updated', handleAccentChange)

addDisplayChangeListener(() => handleMonitorChange("win32"))
screen.addListener("display-added", () => handleMonitorChange("display-added"))
screen.addListener("display-removed", () => handleMonitorChange("display-removed"))
screen.addListener("display-metrics-changed", () => handleMonitorChange("display-metrics-changed"))
addDisplayChangeListener(() => { if(settings.useWin32Event) handleMonitorChange("win32") })
screen.addListener("display-added", () => { if(settings.useElectronEvents) handleMonitorChange("display-added") })
screen.addListener("display-removed", () => { if(settings.useElectronEvents) handleMonitorChange("display-removed") })
screen.addListener("display-metrics-changed", () => { if(settings.useElectronEvents) handleMonitorChange("display-metrics-changed") })

enableMouseEvents()

Expand Down

0 comments on commit 729a2b0

Please sign in to comment.