feat: add dont_switch_primary

This commit is contained in:
2025-04-08 21:49:15 +00:00
parent 41fbef0260
commit 4e795257ad
6 changed files with 62 additions and 6 deletions

View File

@ -8,6 +8,7 @@ const category = getCurrentInstance()?.parent?.parent?.parent?.parent; // yes in
const props = defineProps({
title: String,
tooltip: String,
dangerousTooltip: String,
});
const searched = computed(() => {
@ -32,6 +33,11 @@ const searched = computed(() => {
class="pi pi-question-circle ml-2"
v-tooltip="tooltip"
></span>
<span
v-if="dangerousTooltip"
class="pi pi-exclamation-circle ml-2 text-red-500"
v-tooltip="dangerousTooltip"
></span>
</div>
<slot />

View File

@ -157,5 +157,40 @@ loadDisplays();
v-model="prf.current!.data.display.borderless_fullscreen"
/>
</OptionRow>
<OptionRow
title="Skip switching primary display"
v-if="
capabilities.includes('display') &&
prf.current?.data.display.target !== 'default' &&
(prf.current!.data.display.dont_switch_primary ||
displayList.length > 2)
"
dangerous-tooltip="Only enable this option if switching the primary display causes issues. The monitors must have a matching refresh rate."
>
<ToggleSwitch
:disabled="extraDisplayOptionsDisabled"
v-model="prf.current!.data.display.dont_switch_primary"
/>
</OptionRow>
<OptionRow
title="Unity display index"
class="number-input"
v-if="
capabilities.includes('display') &&
prf.current?.data.display.target !== 'default' &&
prf.current!.data.display.dont_switch_primary
"
>
<InputNumber
class="shrink"
size="small"
:min="1"
:max="32"
:use-grouping="false"
v-model="prf.current!.data.display.monitor_index_override"
:disabled="extraDisplayOptionsDisabled"
:allow-empty="true"
/>
</OptionRow>
</OptionCategory>
</template>

View File

@ -78,6 +78,8 @@ export interface DisplayConfig {
rotation: number;
frequency: number;
borderless_fullscreen: boolean;
dont_switch_primary: boolean;
monitor_index_override: number | null;
}
export interface NetworkConfig {