From 27294a27dcfcfd3258e233bf297909d0d194d25e Mon Sep 17 00:00:00 2001 From: Nocccer Date: Wed, 27 Sep 2023 18:56:40 +0200 Subject: [PATCH 1/9] First gamescope draft --- public/locales/en/translation.json | 20 ++ src/backend/launcher.ts | 110 ++++++-- src/backend/storeManagers/gog/games.ts | 2 + src/backend/storeManagers/legendary/games.ts | 2 + src/backend/storeManagers/nile/games.ts | 2 + .../storeManagers/storeManagerCommon/games.ts | 2 + src/common/types.ts | 14 + .../screens/Settings/components/Gamescope.tsx | 239 ++++++++++++++++++ .../screens/Settings/components/index.ts | 1 + .../Settings/sections/GamesSettings/index.tsx | 13 +- 10 files changed, 385 insertions(+), 20 deletions(-) create mode 100644 src/frontend/screens/Settings/components/Gamescope.tsx diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index 866e161081..280f34173b 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -267,6 +267,13 @@ "valid_codes": "Valid language codes are game-dependant." }, "gamemode": "Feral GameMode applies automatic and temporary tweaks to the system when running games. Enabling may improve performance.", + "gamescope": { + "enable": "Enable Gamescope", + "fpsLimiter": "The amount of frames gamescope should limit to. E.g. 60", + "gameResolution": "The native resolution the game can run on. E.g. your monitor pixel width and height.", + "integerScaling": "Use integer scaling", + "upscaleResolution": "The resolution gamescope should upscale to." + }, "general": "Sync with EGL if you have a working installation of the Epic Games Launcher elsewhere and want to import your games to avoid downloading them again.", "mangohud": "MangoHUD is an overlay that displays and monitors FPS, temperatures, CPU/GPU load and other system resources.", "other": { @@ -426,6 +433,14 @@ "placeholder": "Put here the Launcher Arguments", "title": "Game Arguments (To run after the command):" }, + "gamescope": { + "fpsLimiter": "FPS Limiter", + "fpsLimiterNoFocus": "FPS Limiter (No Focus)", + "gameHeight": "Game Height", + "gameWidth": "Game Width", + "upscaleHeight": "Upscale Height", + "upscaleWidth": "Upscale Width" + }, "quote-args-with-spaces": "Warning: Make sure to quote args with spaces! E.g.: \"path/with spaces/\"", "wrapper": { "args": "Arguments", @@ -533,6 +548,10 @@ "FsrSharpnessStrenght": "FSR Sharpness Strength", "fsync": "Enable Fsync", "gamemode": "Use GameMode (Feral Game Mode needs to be installed)", + "gamescope": { + "enable": "Enable", + "integerScaling": "Use integer scaling" + }, "hideChangelogsOnStartup": "Don't show changelogs on Startup", "ignoreGameUpdates": "Ignore game updates", "language": "Choose App Language", @@ -625,6 +644,7 @@ "navbar": { "advanced": "Advanced", "games_settings_defaults": "Game Defaults", + "gamescope": "Gamescope", "general": "General", "log": "Log", "other": "Other", diff --git a/src/backend/launcher.ts b/src/backend/launcher.ts index 287309ad37..1b59928559 100644 --- a/src/backend/launcher.ts +++ b/src/backend/launcher.ts @@ -1,3 +1,18 @@ +import { + CallRunnerOptions, + GameInfo, + Runner, + EnviromentVariable, + WrapperEnv, + WrapperVariable, + ExecResult, + LaunchPreperationResult, + RpcClient, + WineInstallation, + WineCommandArgs, + SteamRuntime, + GameSettings +} from 'common/types' // This handles launching games, prefix creation etc.. import i18next from 'i18next' @@ -14,6 +29,7 @@ import { flatPakHome, isLinux, isMac, + isSteamDeckGameMode, runtimePath, userHome } from './constants' @@ -39,22 +55,7 @@ import { GameConfig } from './game_config' import { DXVK } from './tools' import setup from './storeManagers/gog/setup' import nileSetup from './storeManagers/nile/setup' -import { - CallRunnerOptions, - GameInfo, - Runner, - EnviromentVariable, - WrapperEnv, - WrapperVariable, - ExecResult, - GameSettings, - LaunchPreperationResult, - RpcClient, - WineInstallation, - WineCommandArgs, - SteamRuntime -} from 'common/types' -import { spawn } from 'child_process' +import { spawn, spawnSync } from 'child_process' import shlex from 'shlex' import { isOnline } from './online_monitor' import { showDialogBoxModalAuto } from './dialog/dialog' @@ -95,9 +96,10 @@ async function prepareLaunch( return { success: true, rpcClient } } - // Figure out where MangoHud/GameMode are located, if they're enabled + // Figure out where MangoHud/GameMode/Gamescope are located, if they're enabled let mangoHudCommand: string[] = [] let gameModeBin: string | null = null + const gameScopeCommand: string[] = [] if (gameSettings.showMangohud) { const mangoHudBin = await searchForExecutableOnPath('mangohud') if (!mangoHudBin) { @@ -106,10 +108,11 @@ async function prepareLaunch( failureReason: 'Mangohud is enabled, but `mangohud` executable could not be found on $PATH' } - } else { - mangoHudCommand = [mangoHudBin, '--dlsym'] } + + mangoHudCommand = [mangoHudBin, '--dlsym'] } + if (gameSettings.useGameMode) { gameModeBin = await searchForExecutableOnPath('gamemoderun') if (!gameModeBin) { @@ -121,6 +124,70 @@ async function prepareLaunch( } } + if (gameSettings.gamescope.enabled && !isSteamDeckGameMode) { + const gameScopeBin = await searchForExecutableOnPath('gamescope') + if (!gameScopeBin) { + return { + success: false, + failureReason: + 'Gamescope is enabled, but `gamescope` executable could not be found on $PATH' + } + } + + // Gamescope does not provide a version option and they changed + // cli options on version 3.12. So we do what lutris does. + let oldVersion = true // < 3.12 + const { stderr } = spawnSync(`${gameScopeBin} --help`) + if (stderr && stderr.toString().includes('-F, --filter')) { + oldVersion = false + } + + gameScopeCommand.push(gameScopeBin) + if (gameSettings.gamescope.gameWidth) { + gameScopeCommand.push('-w', gameSettings.gamescope.gameWidth) + } + if (gameSettings.gamescope.gameHeight) { + gameScopeCommand.push('-h', gameSettings.gamescope.gameHeight) + } + if (gameSettings.gamescope.upscaleWidth) { + gameScopeCommand.push('-W', gameSettings.gamescope.upscaleWidth) + } + if (gameSettings.gamescope.upscaleHeight) { + gameScopeCommand.push('-H', gameSettings.gamescope.upscaleHeight) + } + if (gameSettings.gamescope.fpsLimiter) { + gameScopeCommand.push('-r', gameSettings.gamescope.fpsLimiter) + } + if (gameSettings.gamescope.fpsLimiterNoFocus) { + gameScopeCommand.push('-o', gameSettings.gamescope.fpsLimiterNoFocus) + } + if (gameSettings.gamescope.integerScaling) { + oldVersion + ? gameScopeCommand.push('-i') + : gameScopeCommand.push('-S', 'integer') + } + if (gameSettings.gamescope.windowType === 'fullscreen') { + gameScopeCommand.push('-f') + } + if (gameSettings.gamescope.windowType === 'borderless') { + gameScopeCommand.push('-b') + } + + // How we can detect nvidia card here ? + // if (nvidia) { + oldVersion + ? gameScopeCommand.push('-Y') + : gameScopeCommand.push('-F', 'nis') + // } else { + // oldVersion + // ? gameScopeCommand.push('-U') + // : gameScopeCommand.push('-F', 'fsr') + // } + + // Note: needs to be the last option + gameScopeCommand.push('--') + } + // If the Steam Runtime is enabled, find a valid one let steamRuntime: string[] = [] const shouldUseRuntime = @@ -175,6 +242,7 @@ async function prepareLaunch( rpcClient, mangoHudCommand, gameModeBin: gameModeBin ?? undefined, + gameScopeCommand, steamRuntime, offlineMode } @@ -503,6 +571,7 @@ function setupWrappers( gameSettings: GameSettings, mangoHudCommand?: string[], gameModeBin?: string, + gameScopeCommand?: string[], steamRuntime?: string[] ): Array { const wrappers: string[] = [] @@ -521,6 +590,9 @@ function setupWrappers( if (steamRuntime) { wrappers.push(...steamRuntime) } + if (gameScopeCommand) { + wrappers.push(...gameScopeCommand) + } return wrappers.filter((n) => n) } diff --git a/src/backend/storeManagers/gog/games.ts b/src/backend/storeManagers/gog/games.ts index 802c3c312a..a980807a7f 100644 --- a/src/backend/storeManagers/gog/games.ts +++ b/src/backend/storeManagers/gog/games.ts @@ -445,6 +445,7 @@ export async function launch( failureReason: launchPrepFailReason, rpcClient, mangoHudCommand, + gameScopeCommand, gameModeBin, steamRuntime } = await prepareLaunch(gameSettings, gameInfo, isNative(appName)) @@ -475,6 +476,7 @@ export async function launch( gameSettings, mangoHudCommand, gameModeBin, + gameScopeCommand, steamRuntime?.length ? [...steamRuntime] : undefined ) diff --git a/src/backend/storeManagers/legendary/games.ts b/src/backend/storeManagers/legendary/games.ts index 80d878cb54..8b7dd95c7a 100644 --- a/src/backend/storeManagers/legendary/games.ts +++ b/src/backend/storeManagers/legendary/games.ts @@ -811,6 +811,7 @@ export async function launch( rpcClient, mangoHudCommand, gameModeBin, + gameScopeCommand, steamRuntime, offlineMode } = await prepareLaunch(gameSettings, gameInfo, isNative(appName)) @@ -839,6 +840,7 @@ export async function launch( gameSettings, mangoHudCommand, gameModeBin, + gameScopeCommand, steamRuntime?.length ? [...steamRuntime] : undefined ) diff --git a/src/backend/storeManagers/nile/games.ts b/src/backend/storeManagers/nile/games.ts index be90a1a1ba..3e448a657c 100644 --- a/src/backend/storeManagers/nile/games.ts +++ b/src/backend/storeManagers/nile/games.ts @@ -326,6 +326,7 @@ export async function launch( rpcClient, mangoHudCommand, gameModeBin, + gameScopeCommand, steamRuntime } = await prepareLaunch(gameSettings, gameInfo, isNative()) @@ -355,6 +356,7 @@ export async function launch( gameSettings, mangoHudCommand, gameModeBin, + gameScopeCommand, steamRuntime?.length ? [...steamRuntime] : undefined ) diff --git a/src/backend/storeManagers/storeManagerCommon/games.ts b/src/backend/storeManagers/storeManagerCommon/games.ts index 6197f7a547..cf99b134d0 100644 --- a/src/backend/storeManagers/storeManagerCommon/games.ts +++ b/src/backend/storeManagers/storeManagerCommon/games.ts @@ -131,6 +131,7 @@ export async function launchGame( failureReason: launchPrepFailReason, rpcClient, mangoHudCommand, + gameScopeCommand, gameModeBin, steamRuntime } = await prepareLaunch(gameSettings, gameInfo, isNative) @@ -141,6 +142,7 @@ export async function launchGame( gameSettings, mangoHudCommand, gameModeBin, + gameScopeCommand, steamRuntime?.length ? [...steamRuntime] : undefined ) diff --git a/src/common/types.ts b/src/common/types.ts index 7b6035dfe1..8cfec4e481 100644 --- a/src/common/types.ts +++ b/src/common/types.ts @@ -146,6 +146,7 @@ export interface GameSettings { enableEsync: boolean enableFSR: boolean enableFsync: boolean + gamescope: GameScopeSettings enviromentOptions: EnviromentVariable[] ignoreGameUpdates: boolean language: string @@ -328,6 +329,7 @@ export interface LaunchPreperationResult { rpcClient?: RpcClient mangoHudCommand?: string[] gameModeBin?: string + gameScopeCommand?: string[] steamRuntime?: string[] offlineMode?: boolean } @@ -705,3 +707,15 @@ export type DownloadManagerState = 'idle' | 'running' | 'paused' | 'stopped' export interface WindowProps extends Electron.Rectangle { maximized: boolean } + +export interface GameScopeSettings { + enabled: boolean + integerScaling: boolean + windowType: string + gameWidth: string + gameHeight: string + upscaleWidth: string + upscaleHeight: string + fpsLimiter: string + fpsLimiterNoFocus: string +} diff --git a/src/frontend/screens/Settings/components/Gamescope.tsx b/src/frontend/screens/Settings/components/Gamescope.tsx new file mode 100644 index 0000000000..b515f285f6 --- /dev/null +++ b/src/frontend/screens/Settings/components/Gamescope.tsx @@ -0,0 +1,239 @@ +import React, { ChangeEvent, useContext } from 'react' +import { useTranslation } from 'react-i18next' +import { + SelectField, + TextInputField, + ToggleSwitch +} from 'frontend/components/UI' +import useSetting from 'frontend/hooks/useSetting' +import ContextProvider from 'frontend/state/ContextProvider' +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' +import { faCircleInfo } from '@fortawesome/free-solid-svg-icons' + +const Gamescope = () => { + const { t } = useTranslation() + const { platform } = useContext(ContextProvider) + const isLinux = platform === 'linux' + const [gamescope, setGamescope] = useSetting('gamescope', { + enabled: false, + integerScaling: false, + windowType: 'fullscreen', + gameWidth: '', + gameHeight: '', + upscaleHeight: '', + upscaleWidth: '', + fpsLimiter: '', + fpsLimiterNoFocus: '' + }) + + function setResolution(value: string): string | undefined { + const re = /^[0-9\b]+$/ + + if (value === '' || re.test(value)) { + return value + } + + return undefined + } + + if (!isLinux) { + return <> + } + + return ( +
+ {/* Enable*/} +
+ + setGamescope({ ...gamescope, enabled: !gamescope.enabled }) + } + title={t('setting.gamescope.enable', 'Enable')} + /> + + +
+ {/* Integer Scaling*/} +
+ + setGamescope({ + ...gamescope, + integerScaling: !gamescope.integerScaling + }) + } + title={t('setting.gamescope.integerScaling', 'Use integer scaling')} + /> + + +
+ {/* Window Type*/} + ) => + setGamescope({ ...gamescope, windowType: event.currentTarget.value }) + } + value={gamescope.windowType} + > + {['fullscreen', 'borderless'].map((opt, i) => ( + + ))} + + {/* Game Res*/} +
+ ) => { + setGamescope({ + ...gamescope, + gameWidth: + setResolution(event.currentTarget.value) ?? gamescope.gameWidth + }) + }} + /> +
+ + ) => { + setGamescope({ + ...gamescope, + gameHeight: + setResolution(event.currentTarget.value) ?? gamescope.gameHeight + }) + }} + /> + + +
+ {/* Upscale Res*/} +
+ ) => { + setGamescope({ + ...gamescope, + upscaleWidth: + setResolution(event.currentTarget.value) ?? + gamescope.upscaleWidth + }) + }} + /> +
+ + ) => { + setGamescope({ + ...gamescope, + upscaleHeight: + setResolution(event.currentTarget.value) ?? + gamescope.upscaleHeight + }) + }} + /> + + +
+ {/* FPS Limiters*/} +
+ ) => { + setGamescope({ + ...gamescope, + fpsLimiter: + setResolution(event.currentTarget.value) ?? gamescope.fpsLimiter + }) + }} + /> +
+ + ) => { + setGamescope({ + ...gamescope, + fpsLimiterNoFocus: + setResolution(event.currentTarget.value) ?? + gamescope.fpsLimiterNoFocus + }) + }} + /> + + +
+
+ ) +} + +export default Gamescope diff --git a/src/frontend/screens/Settings/components/index.ts b/src/frontend/screens/Settings/components/index.ts index 2716a3966c..eefb5e3b88 100644 --- a/src/frontend/screens/Settings/components/index.ts +++ b/src/frontend/screens/Settings/components/index.ts @@ -21,6 +21,7 @@ export { default as EgsSettings } from './EgsSettings' export { default as EnableEsync } from './EnableEsync' export { default as EnableFSR } from './EnableFSR' export { default as EnableFsync } from './EnableFsync' +export { default as Gamescope } from './Gamescope' export { default as EnvVariablesTable } from './EnvVariablesTable' export { default as ExperimentalFeatures } from './ExperimentalFeatures' export { default as GameMode } from './GameMode' diff --git a/src/frontend/screens/Settings/sections/GamesSettings/index.tsx b/src/frontend/screens/Settings/sections/GamesSettings/index.tsx index 1b2e44f396..cfaa13445b 100644 --- a/src/frontend/screens/Settings/sections/GamesSettings/index.tsx +++ b/src/frontend/screens/Settings/sections/GamesSettings/index.tsx @@ -28,7 +28,8 @@ import { WineVersionSelector, WrappersTable, EnableDXVKFpsLimit, - IgnoreGameUpdates + IgnoreGameUpdates, + Gamescope } from '../../components' import ContextProvider from 'frontend/state/ContextProvider' import Tools from '../../components/Tools' @@ -114,6 +115,16 @@ export default function GamesSettings({ useDetails = true }: Props) { )} + {isLinux && ( + + + + )} + Date: Wed, 27 Sep 2023 19:18:30 +0200 Subject: [PATCH 2/9] Detect nvidia cards --- src/backend/launcher.ts | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/backend/launcher.ts b/src/backend/launcher.ts index 1b59928559..0951cf901c 100644 --- a/src/backend/launcher.ts +++ b/src/backend/launcher.ts @@ -66,6 +66,7 @@ import { readFileSync } from 'fs' import { LegendaryCommand } from './storeManagers/legendary/commands' import { commandToArgsArray } from './storeManagers/legendary/library' import { searchForExecutableOnPath } from './utils/os/path' +import { getSystemInfo, GPUInfo } from './utils/systeminfo' async function prepareLaunch( gameSettings: GameSettings, @@ -173,16 +174,18 @@ async function prepareLaunch( gameScopeCommand.push('-b') } - // How we can detect nvidia card here ? - // if (nvidia) { - oldVersion - ? gameScopeCommand.push('-Y') - : gameScopeCommand.push('-F', 'nis') - // } else { - // oldVersion - // ? gameScopeCommand.push('-U') - // : gameScopeCommand.push('-F', 'fsr') - // } + const { GPUs } = await getSystemInfo() + if ( + GPUs.some((value: GPUInfo) => value.driverVersion?.includes('nvidia')) + ) { + oldVersion + ? gameScopeCommand.push('-Y') + : gameScopeCommand.push('-F', 'nis') + } else { + oldVersion + ? gameScopeCommand.push('-U') + : gameScopeCommand.push('-F', 'fsr') + } // Note: needs to be the last option gameScopeCommand.push('--') From 247dd62cc4ca60dbe5821a35ce51c49029c7a378 Mon Sep 17 00:00:00 2001 From: Nocccer Date: Wed, 27 Sep 2023 21:05:47 +0200 Subject: [PATCH 3/9] Clean up and fixes --- src/backend/launcher.ts | 20 ++++++------- src/common/types.ts | 1 + .../screens/Settings/components/Gamescope.tsx | 30 +++++++++++++++---- 3 files changed, 34 insertions(+), 17 deletions(-) diff --git a/src/backend/launcher.ts b/src/backend/launcher.ts index 0951cf901c..793ade5783 100644 --- a/src/backend/launcher.ts +++ b/src/backend/launcher.ts @@ -66,7 +66,6 @@ import { readFileSync } from 'fs' import { LegendaryCommand } from './storeManagers/legendary/commands' import { commandToArgsArray } from './storeManagers/legendary/library' import { searchForExecutableOnPath } from './utils/os/path' -import { getSystemInfo, GPUInfo } from './utils/systeminfo' async function prepareLaunch( gameSettings: GameSettings, @@ -138,8 +137,10 @@ async function prepareLaunch( // Gamescope does not provide a version option and they changed // cli options on version 3.12. So we do what lutris does. let oldVersion = true // < 3.12 - const { stderr } = spawnSync(`${gameScopeBin} --help`) - if (stderr && stderr.toString().includes('-F, --filter')) { + const { stderr } = spawnSync(gameScopeBin, ['--help'], { + encoding: 'utf-8' + }) + if (stderr && stderr.includes('-F, --filter')) { oldVersion = false } @@ -174,17 +175,14 @@ async function prepareLaunch( gameScopeCommand.push('-b') } - const { GPUs } = await getSystemInfo() - if ( - GPUs.some((value: GPUInfo) => value.driverVersion?.includes('nvidia')) - ) { - oldVersion - ? gameScopeCommand.push('-Y') - : gameScopeCommand.push('-F', 'nis') - } else { + if (gameSettings.gamescope.upscaleMethod === 'fsr') { oldVersion ? gameScopeCommand.push('-U') : gameScopeCommand.push('-F', 'fsr') + } else { + oldVersion + ? gameScopeCommand.push('-Y') + : gameScopeCommand.push('-F', 'nis') } // Note: needs to be the last option diff --git a/src/common/types.ts b/src/common/types.ts index 8cfec4e481..b6a88158fd 100644 --- a/src/common/types.ts +++ b/src/common/types.ts @@ -716,6 +716,7 @@ export interface GameScopeSettings { gameHeight: string upscaleWidth: string upscaleHeight: string + upscaleMethod: string fpsLimiter: string fpsLimiterNoFocus: string } diff --git a/src/frontend/screens/Settings/components/Gamescope.tsx b/src/frontend/screens/Settings/components/Gamescope.tsx index b515f285f6..db4325157a 100644 --- a/src/frontend/screens/Settings/components/Gamescope.tsx +++ b/src/frontend/screens/Settings/components/Gamescope.tsx @@ -22,6 +22,7 @@ const Gamescope = () => { gameHeight: '', upscaleHeight: '', upscaleWidth: '', + upscaleMethod: 'fsr', fpsLimiter: '', fpsLimiterNoFocus: '' }) @@ -42,7 +43,7 @@ const Gamescope = () => { return (
- {/* Enable*/} + {/* Enable */}
{ title={t('help.gamescope.enable', 'Enable Gamescope')} />
- {/* Integer Scaling*/} + {/* Integer Scaling */}
{ title={t('help.gamescope.integerScaling', 'Use integer scaling')} />
- {/* Window Type*/} + {/* Window Type */} { ))} - {/* Game Res*/} + {/* Game Res */}
{ )} />
- {/* Upscale Res*/} + {/* Upscale Method */} + ) => + setGamescope({ + ...gamescope, + upscaleMethod: event.currentTarget.value + }) + } + value={gamescope.upscaleMethod} + > + {['fsr', 'nis'].map((opt, i) => ( + + ))} + + {/* Upscale Res */}
{ )} />
- {/* FPS Limiters*/} + {/* FPS Limiters */}
Date: Wed, 27 Sep 2023 21:08:46 +0200 Subject: [PATCH 4/9] Update flatpak templates --- ...oicgameslauncher.hgl.metainfo.xml.template | 26 ++++++++-------- .../com.heroicgameslauncher.hgl.yml.template | 30 +++++++++++-------- 2 files changed, 29 insertions(+), 27 deletions(-) diff --git a/flatpak/templates/com.heroicgameslauncher.hgl.metainfo.xml.template b/flatpak/templates/com.heroicgameslauncher.hgl.metainfo.xml.template index d1592ebc4e..69ce03c262 100644 --- a/flatpak/templates/com.heroicgameslauncher.hgl.metainfo.xml.template +++ b/flatpak/templates/com.heroicgameslauncher.hgl.metainfo.xml.template @@ -233,42 +233,40 @@

  • - Auto Install UbisoftConnect when running UbisoftConnect games + Added a new System Information Tab to the Heroic Settings
  • - UI improvements on the GamePage to make it cleaner and organized + Added support for installing and enabling DXVK-NVAPI
  • - Library render improvements and download GOG game images in the background + Added user feedback when copying log to clipboard
  • - Improvements on Epic Login + Added ExperimentalFeatures feature setting support +
  • -
  • - Show game logs from the card's context menu -
  • -
+

BugFixes

  • - Fix Discord RPC for flatpak heroic + Fixed installation of EOS Overlay
  • - Fix auto-enabling of anti-cheat runtimes + Fixed some issues for Amazon Games
  • - Fix non-available status for games just installed + Fixed issues with missing games metadata for GOG
  • - Kill leftover wine processes after the stop button is pressed + Fixed issue with egl-sync
  • - Fix not being possible to change the default installation path + Fixed installing all DLCs not adding them to the queue
  • - Inaccuracy of disk and down speed + Make sure the game is available before auto-updating
  • Several other fixes and improvements diff --git a/flatpak/templates/com.heroicgameslauncher.hgl.yml.template b/flatpak/templates/com.heroicgameslauncher.hgl.yml.template index c872f36a7c..b24f5bc434 100644 --- a/flatpak/templates/com.heroicgameslauncher.hgl.yml.template +++ b/flatpak/templates/com.heroicgameslauncher.hgl.yml.template @@ -19,7 +19,7 @@ finish-args: - --allow=devel - --allow=multiarch - --device=all - - --env=PATH=/app/bin:/app/utils/bin:/usr/bin:/usr/lib/extensions/vulkan/MangoHud/bin:/usr/lib/extensions/vulkan/OBSVkCapture/bin:/app/bin/heroic/resources/app.asar.unpacked/build/bin/linux + - --env=PATH=/app/bin:/app/utils/bin:/usr/bin:/usr/lib/extensions/vulkan/MangoHud/bin:/usr/lib/extensions/vulkan/gamescope/bin:/usr/lib/extensions/vulkan/OBSVkCapture/bin:/app/bin/heroic/resources/app.asar.unpacked/build/bin/linux - --filesystem=xdg-data/lutris:rw - --filesystem=xdg-data/Steam:rw - --filesystem=xdg-data/applications:rw @@ -30,17 +30,20 @@ finish-args: - --filesystem=xdg-desktop # should fix access to SD card on the deck - --filesystem=/run/media + # There are still quite a few users using /mnt/ for external drives + - --filesystem=/mnt # should fix steamdeck controler navigation - --filesystem=/run/udev:ro # should fix discord rich presence - --filesystem=xdg-run/app/com.discordapp.Discord:create + - --persist=. - --share=ipc - --share=network - --socket=x11 - --socket=wayland - --socket=pulseaudio - --talk-name=org.freedesktop.Notifications - - --own-name=org.kde.* + - --talk-name=org.kde.StatusNotifierWatcher add-extensions: org.freedesktop.Platform.Compat.i386: @@ -165,8 +168,9 @@ modules: dest-filename: heroic-run commands: - for i in {0..9}; do - - test -S $XDG_RUNTIME_DIR/discord-ipc-$i || ln -sf {app/com.discordapp.Discord,$XDG_RUNTIME_DIR}/discord-ipc-$i; + - test -S $XDG_RUNTIME_DIR/discord-ipc-$i || ln -sf {app/com.discordapp.Discord,$XDG_RUNTIME_DIR}/discord-ipc-$i; - done + - export TMPDIR="$XDG_RUNTIME_DIR/app/$FLATPAK_ID" - zypak-wrapper /app/bin/heroic/heroic "$@" - ${heroic-app-image} @@ -218,19 +222,19 @@ modules: - DEST_MAN=$(FLATPAK_DEST)/share/man sources: - type: archive - url: "https://downloads.sourceforge.net/p7zip/p7zip_16.02_src_all.tar.bz2" + url: https://downloads.sourceforge.net/p7zip/p7zip_16.02_src_all.tar.bz2 sha256: 5eb20ac0e2944f6cb9c2d51dd6c4518941c185347d4089ea89087ffdd6e2341f - type: patch paths: - patches/p7zip/gcc10-conversion.patch - type: shell only-arches: - - "x86_64" + - x86_64 commands: - ln -sf makefile.linux_amd64_asm makefile.machine - type: shell only-arches: - - "i386" + - i386 commands: - ln -sf makefile.linux_x86_asm_gcc_4.X makefile.machine modules: @@ -238,18 +242,18 @@ modules: buildsystem: cmake-ninja sources: - type: archive - url: "https://github.com/yasm/yasm/archive/v1.3.0.tar.gz" + url: https://github.com/yasm/yasm/archive/v1.3.0.tar.gz sha256: f708be0b7b8c59bc1dbe7134153cd2f31faeebaa8eec48676c10f972a1f13df3 cleanup: - - "*" + - '*' - name: cabextract build-options: strip: true sources: - type: archive - url: "https://www.cabextract.org.uk/cabextract-1.10.tar.gz" - sha256: edfc785ef252460cab7fdfa6fb2599058a6f5618f7f48a4ad22da816da8cb117 + url: https://www.cabextract.org.uk/cabextract-1.11.tar.gz + sha256: b5546db1155e4c718ff3d4b278573604f30dd64c3c5bfd4657cd089b823a3ac6 x-checker-data: type: anitya project-id: 245 @@ -263,8 +267,8 @@ modules: - DESTDIR=$(FLATPAK_DEST) sources: - type: archive - url: "https://www.rarlab.com/rar/unrarsrc-6.2.5.tar.gz" - sha256: 9a3974410d1d340e3998dd2a6f98faefbe838cad556266e714adfb0e8cf9377c + url: https://www.rarlab.com/rar/unrarsrc-6.2.10.tar.gz + sha256: 55fe6ebd5e48d6655bfda3fd19b55438ca05e13c7e69772420caad9fdb68ef42 x-checker-data: type: anitya project-id: 13306 @@ -286,7 +290,7 @@ modules: sources: - type: archive sha256: 58d1e7608c12404f0229a3d9a4953d0d00c18040504498b483305bcb3de907a5 - url: "https://github.com/aria2/aria2/releases/download/release-1.36.0/aria2-1.36.0.tar.xz" + url: https://github.com/aria2/aria2/releases/download/release-1.36.0/aria2-1.36.0.tar.xz - type: patch path: patches/aria2/working-build.patch #END --- Winetricks Deps -- From e6209e8e5386278458b12acccf4384dc349cc133 Mon Sep 17 00:00:00 2001 From: Nocccer Date: Wed, 27 Sep 2023 22:04:26 +0200 Subject: [PATCH 5/9] Make gamescope first wrapper --- src/backend/launcher.ts | 9 ++++++--- src/common/types.ts | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/backend/launcher.ts b/src/backend/launcher.ts index 793ade5783..5c1d49a282 100644 --- a/src/backend/launcher.ts +++ b/src/backend/launcher.ts @@ -576,6 +576,12 @@ function setupWrappers( steamRuntime?: string[] ): Array { const wrappers: string[] = [] + + // let gamescope be first wrapper always + if (gameScopeCommand) { + wrappers.push(...gameScopeCommand) + } + if (gameSettings.wrapperOptions) { gameSettings.wrapperOptions.forEach((wrapperEntry: WrapperVariable) => { wrappers.push(wrapperEntry.exe) @@ -591,9 +597,6 @@ function setupWrappers( if (steamRuntime) { wrappers.push(...steamRuntime) } - if (gameScopeCommand) { - wrappers.push(...gameScopeCommand) - } return wrappers.filter((n) => n) } diff --git a/src/common/types.ts b/src/common/types.ts index b6a88158fd..d93a9760f2 100644 --- a/src/common/types.ts +++ b/src/common/types.ts @@ -708,7 +708,7 @@ export interface WindowProps extends Electron.Rectangle { maximized: boolean } -export interface GameScopeSettings { +interface GameScopeSettings { enabled: boolean integerScaling: boolean windowType: string From 23fbd247fec5fb574f05da9ce52576293066352a Mon Sep 17 00:00:00 2001 From: Nocccer Date: Wed, 27 Sep 2023 23:05:01 +0200 Subject: [PATCH 6/9] Small fixes --- src/backend/launcher.ts | 4 ++-- src/frontend/screens/Settings/components/Gamescope.tsx | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/backend/launcher.ts b/src/backend/launcher.ts index 5c1d49a282..f4d5bde21e 100644 --- a/src/backend/launcher.ts +++ b/src/backend/launcher.ts @@ -174,12 +174,12 @@ async function prepareLaunch( if (gameSettings.gamescope.windowType === 'borderless') { gameScopeCommand.push('-b') } - if (gameSettings.gamescope.upscaleMethod === 'fsr') { oldVersion ? gameScopeCommand.push('-U') : gameScopeCommand.push('-F', 'fsr') - } else { + } + if (gameSettings.gamescope.upscaleMethod === 'nis') { oldVersion ? gameScopeCommand.push('-Y') : gameScopeCommand.push('-F', 'nis') diff --git a/src/frontend/screens/Settings/components/Gamescope.tsx b/src/frontend/screens/Settings/components/Gamescope.tsx index db4325157a..060fcdbf0f 100644 --- a/src/frontend/screens/Settings/components/Gamescope.tsx +++ b/src/frontend/screens/Settings/components/Gamescope.tsx @@ -51,7 +51,10 @@ const Gamescope = () => { handleChange={() => setGamescope({ ...gamescope, enabled: !gamescope.enabled }) } - title={t('setting.gamescope.enable', 'Enable')} + title={t( + 'setting.gamescope.enable', + 'Enable (Gamescope need to be installed)' + )} /> Date: Mon, 2 Oct 2023 19:24:13 +0200 Subject: [PATCH 7/9] Add review fixes --- public/locales/en/translation.json | 18 +- src/backend/api/settings.ts | 3 + src/backend/launcher.ts | 97 ++-- src/backend/utils/ipc_handler.ts | 4 + src/common/typedefs/ipcBridge.d.ts | 1 + src/common/types.ts | 4 +- .../screens/Settings/components/Gamescope.tsx | 470 ++++++++++-------- 7 files changed, 353 insertions(+), 244 deletions(-) diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index 280f34173b..fbd954ccea 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -268,11 +268,13 @@ }, "gamemode": "Feral GameMode applies automatic and temporary tweaks to the system when running games. Enabling may improve performance.", "gamescope": { - "enable": "Enable Gamescope", "fpsLimiter": "The amount of frames gamescope should limit to. E.g. 60", - "gameResolution": "The native resolution the game can run on. E.g. your monitor pixel width and height.", - "integerScaling": "Use integer scaling", - "upscaleResolution": "The resolution gamescope should upscale to." + "fpsLimiterNoFocus": "The frame rate limit gamescope should limit per second if the game is not focused.", + "gameHeight": "The height resolution used by the game. A 16:9 aspect ratio is assumed by gamescope.", + "gameWidth": "The width resolution used by the game. A 16:9 aspect ratio is assumed by gamescope.", + "upscaleHeight": "The height resolution used by gamescope. A 16:9 aspect ratio is assumed.", + "upscaleMethod": "The upscaling method gamescope should use.", + "upscaleWidth": "The width resolution used by gamescope. A 16:9 aspect ratio is assumed." }, "general": "Sync with EGL if you have a working installation of the Epic Games Launcher elsewhere and want to import your games to avoid downloading them again.", "mangohud": "MangoHUD is an overlay that displays and monitors FPS, temperatures, CPU/GPU load and other system resources.", @@ -549,8 +551,9 @@ "fsync": "Enable Fsync", "gamemode": "Use GameMode (Feral Game Mode needs to be installed)", "gamescope": { - "enable": "Enable", - "integerScaling": "Use integer scaling" + "enableLimiter": "Enable FPS Limiter", + "enableUpscaling": "Enables Upscaling", + "missingMsg": "We could not found gamescope on the PATH. Install it or add it to the PATH." }, "hideChangelogsOnStartup": "Don't show changelogs on Startup", "ignoreGameUpdates": "Ignore game updates", @@ -638,6 +641,9 @@ "title": "EAC runtime enabled" } }, + "gamescope": { + "searchMsg": "Searching for gamescope executable." + }, "log": { "long-log-hint": "Log truncated, last 1000 lines are shown!" }, diff --git a/src/backend/api/settings.ts b/src/backend/api/settings.ts index 43b9cd3474..bd998b1a48 100644 --- a/src/backend/api/settings.ts +++ b/src/backend/api/settings.ts @@ -48,3 +48,6 @@ export const systemInfo = { ipcRenderer.invoke('getSystemInfo', cache), copyToClipboard: (): void => ipcRenderer.send('copySystemInfoToClipboard') } + +export const hasExecutable = async (executable: string) => + ipcRenderer.invoke('hasExecutable', executable) diff --git a/src/backend/launcher.ts b/src/backend/launcher.ts index cb0511d1aa..a0d630dc1c 100644 --- a/src/backend/launcher.ts +++ b/src/backend/launcher.ts @@ -124,7 +124,11 @@ async function prepareLaunch( } } - if (gameSettings.gamescope.enabled && !isSteamDeckGameMode) { + if ( + (gameSettings.gamescope?.enableLimiter || + gameSettings.gamescope?.enableUpscaling) && + !isSteamDeckGameMode + ) { const gameScopeBin = await searchForExecutableOnPath('gamescope') if (!gameScopeBin) { return { @@ -145,44 +149,61 @@ async function prepareLaunch( } gameScopeCommand.push(gameScopeBin) - if (gameSettings.gamescope.gameWidth) { - gameScopeCommand.push('-w', gameSettings.gamescope.gameWidth) - } - if (gameSettings.gamescope.gameHeight) { - gameScopeCommand.push('-h', gameSettings.gamescope.gameHeight) - } - if (gameSettings.gamescope.upscaleWidth) { - gameScopeCommand.push('-W', gameSettings.gamescope.upscaleWidth) - } - if (gameSettings.gamescope.upscaleHeight) { - gameScopeCommand.push('-H', gameSettings.gamescope.upscaleHeight) - } - if (gameSettings.gamescope.fpsLimiter) { - gameScopeCommand.push('-r', gameSettings.gamescope.fpsLimiter) - } - if (gameSettings.gamescope.fpsLimiterNoFocus) { - gameScopeCommand.push('-o', gameSettings.gamescope.fpsLimiterNoFocus) - } - if (gameSettings.gamescope.integerScaling) { - oldVersion - ? gameScopeCommand.push('-i') - : gameScopeCommand.push('-S', 'integer') - } - if (gameSettings.gamescope.windowType === 'fullscreen') { - gameScopeCommand.push('-f') - } - if (gameSettings.gamescope.windowType === 'borderless') { - gameScopeCommand.push('-b') - } - if (gameSettings.gamescope.upscaleMethod === 'fsr') { - oldVersion - ? gameScopeCommand.push('-U') - : gameScopeCommand.push('-F', 'fsr') + + if (gameSettings.gamescope.enableUpscaling) { + // game res + if (gameSettings.gamescope.gameWidth) { + gameScopeCommand.push('-w', gameSettings.gamescope.gameWidth) + } + if (gameSettings.gamescope.gameHeight) { + gameScopeCommand.push('-h', gameSettings.gamescope.gameHeight) + } + + // gamescope res + if (gameSettings.gamescope.upscaleWidth) { + gameScopeCommand.push('-W', gameSettings.gamescope.upscaleWidth) + } + if (gameSettings.gamescope.upscaleHeight) { + gameScopeCommand.push('-H', gameSettings.gamescope.upscaleHeight) + } + + // upscale method + if (gameSettings.gamescope.upscaleMethod === 'fsr') { + oldVersion + ? gameScopeCommand.push('-U') + : gameScopeCommand.push('-F', 'fsr') + } + if (gameSettings.gamescope.upscaleMethod === 'nis') { + oldVersion + ? gameScopeCommand.push('-Y') + : gameScopeCommand.push('-F', 'nis') + } + if (gameSettings.gamescope.upscaleMethod === 'integer') { + oldVersion + ? gameScopeCommand.push('-i') + : gameScopeCommand.push('-S', 'integer') + } + // didn't find stretch in old version + if (gameSettings.gamescope.upscaleMethod === 'stretch' && !oldVersion) { + gameScopeCommand.push('-S', 'stretch') + } + + // window type + if (gameSettings.gamescope.windowType === 'fullscreen') { + gameScopeCommand.push('-f') + } + if (gameSettings.gamescope.windowType === 'borderless') { + gameScopeCommand.push('-b') + } } - if (gameSettings.gamescope.upscaleMethod === 'nis') { - oldVersion - ? gameScopeCommand.push('-Y') - : gameScopeCommand.push('-F', 'nis') + + if (gameSettings.gamescope.enableLimiter) { + if (gameSettings.gamescope.fpsLimiter) { + gameScopeCommand.push('-r', gameSettings.gamescope.fpsLimiter) + } + if (gameSettings.gamescope.fpsLimiterNoFocus) { + gameScopeCommand.push('-o', gameSettings.gamescope.fpsLimiterNoFocus) + } } // Note: needs to be the last option diff --git a/src/backend/utils/ipc_handler.ts b/src/backend/utils/ipc_handler.ts index 302941a2c5..b6ea12da00 100644 --- a/src/backend/utils/ipc_handler.ts +++ b/src/backend/utils/ipc_handler.ts @@ -5,6 +5,7 @@ import { getLegendaryVersion, getNileVersion } from './helperBinaries' +import { hasExecutable } from './os/path' import { formatSystemInfo, getSystemInfo } from './systeminfo' ipcMain.on('abort', async (event, id) => { @@ -17,3 +18,6 @@ ipcMain.handle('getSystemInfo', async (e, cache) => getSystemInfo(cache)) ipcMain.on('copySystemInfoToClipboard', async () => getSystemInfo().then(formatSystemInfo).then(clipboard.writeText) ) +ipcMain.handle('hasExecutable', async (event, executable) => { + return hasExecutable(executable) +}) diff --git a/src/common/typedefs/ipcBridge.d.ts b/src/common/typedefs/ipcBridge.d.ts index e5568cbdee..6ed01a6a23 100644 --- a/src/common/typedefs/ipcBridge.d.ts +++ b/src/common/typedefs/ipcBridge.d.ts @@ -264,6 +264,7 @@ interface AsyncIPCFunctions { appName: string ) => Promise getAmazonLoginData: () => Promise + hasExecutable: (executable: string) => Promise } // This is quite ugly & throws a lot of errors in a regular .ts file diff --git a/src/common/types.ts b/src/common/types.ts index b109696bce..4cc913cdaa 100644 --- a/src/common/types.ts +++ b/src/common/types.ts @@ -708,8 +708,8 @@ export interface WindowProps extends Electron.Rectangle { } interface GameScopeSettings { - enabled: boolean - integerScaling: boolean + enableUpscaling: boolean + enableLimiter: boolean windowType: string gameWidth: string gameHeight: string diff --git a/src/frontend/screens/Settings/components/Gamescope.tsx b/src/frontend/screens/Settings/components/Gamescope.tsx index 060fcdbf0f..7de3927a4e 100644 --- a/src/frontend/screens/Settings/components/Gamescope.tsx +++ b/src/frontend/screens/Settings/components/Gamescope.tsx @@ -1,9 +1,10 @@ -import React, { ChangeEvent, useContext } from 'react' +import React, { ChangeEvent, useContext, useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' import { SelectField, TextInputField, - ToggleSwitch + ToggleSwitch, + UpdateComponent } from 'frontend/components/UI' import useSetting from 'frontend/hooks/useSetting' import ContextProvider from 'frontend/state/ContextProvider' @@ -15,8 +16,8 @@ const Gamescope = () => { const { platform } = useContext(ContextProvider) const isLinux = platform === 'linux' const [gamescope, setGamescope] = useSetting('gamescope', { - enabled: false, - integerScaling: false, + enableUpscaling: false, + enableLimiter: false, windowType: 'fullscreen', gameWidth: '', gameHeight: '', @@ -26,6 +27,22 @@ const Gamescope = () => { fpsLimiter: '', fpsLimiterNoFocus: '' }) + const [fetching, setFetching] = useState(true) + const [isInstalled, setIsInstalled] = useState(false) + + useEffect(() => { + setFetching(true) + window.api + .hasExecutable('gamescope') + .then((installed) => { + setIsInstalled(installed) + setFetching(false) + }) + .catch(() => { + setIsInstalled(false) + setFetching(false) + }) + }, []) function setResolution(value: string): string | undefined { const re = /^[0-9\b]+$/ @@ -41,218 +58,275 @@ const Gamescope = () => { return <> } - return ( -
    - {/* Enable */} -
    - - setGamescope({ ...gamescope, enabled: !gamescope.enabled }) - } - title={t( - 'setting.gamescope.enable', - 'Enable (Gamescope need to be installed)' - )} - /> + if (fetching) { + return ( + + ) + } - + if (!isInstalled) { + return ( +
    + {t( + 'setting.gamescope.missingMsg', + 'We could not found gamescope on the PATH. Install it or add it to the PATH.' + )}
    - {/* Integer Scaling */} + ) + } + + return ( +
    + {/* Enable Upscale */}
    setGamescope({ ...gamescope, - integerScaling: !gamescope.integerScaling + enableUpscaling: !gamescope.enableUpscaling }) } - title={t('setting.gamescope.integerScaling', 'Use integer scaling')} - /> - -
    - {/* Window Type */} - ) => - setGamescope({ ...gamescope, windowType: event.currentTarget.value }) - } - value={gamescope.windowType} - > - {['fullscreen', 'borderless'].map((opt, i) => ( - - ))} - - {/* Game Res */} -
    - ) => { - setGamescope({ - ...gamescope, - gameWidth: - setResolution(event.currentTarget.value) ?? gamescope.gameWidth - }) - }} - /> -
    - - ) => { - setGamescope({ - ...gamescope, - gameHeight: - setResolution(event.currentTarget.value) ?? gamescope.gameHeight - }) - }} - /> + {/* Upscale Settings */} + {gamescope.enableUpscaling && ( + <> + {/* Upscale Method */} + + } + onChange={(event: ChangeEvent) => + setGamescope({ + ...gamescope, + upscaleMethod: event.currentTarget.value + }) + } + value={gamescope.upscaleMethod} + > + {['fsr', 'nis', 'integer', 'stretch'].map((opt, i) => ( + + ))} + + {/* Game Res */} +
    + + } + onChange={(event: ChangeEvent) => { + setGamescope({ + ...gamescope, + gameWidth: + setResolution(event.currentTarget.value) ?? + gamescope.gameWidth + }) + }} + /> +
    + + } + onChange={(event: ChangeEvent) => { + setGamescope({ + ...gamescope, + gameHeight: + setResolution(event.currentTarget.value) ?? + gamescope.gameHeight + }) + }} + /> +
    + {/* Upscale Res */} +
    + + } + onChange={(event: ChangeEvent) => { + setGamescope({ + ...gamescope, + upscaleWidth: + setResolution(event.currentTarget.value) ?? + gamescope.upscaleWidth + }) + }} + /> +
    - -
    - {/* Upscale Method */} - ) => - setGamescope({ - ...gamescope, - upscaleMethod: event.currentTarget.value - }) - } - value={gamescope.upscaleMethod} - > - {['fsr', 'nis'].map((opt, i) => ( - - ))} - - {/* Upscale Res */} + + } + onChange={(event: ChangeEvent) => { + setGamescope({ + ...gamescope, + upscaleHeight: + setResolution(event.currentTarget.value) ?? + gamescope.upscaleHeight + }) + }} + /> +
    + {/* Window Type */} + ) => + setGamescope({ + ...gamescope, + windowType: event.currentTarget.value + }) + } + value={gamescope.windowType} + > + {['fullscreen', 'borderless'].map((opt, i) => ( + + ))} + + + )} + {/* Enable Limiter*/}
    - ) => { - setGamescope({ - ...gamescope, - upscaleWidth: - setResolution(event.currentTarget.value) ?? - gamescope.upscaleWidth - }) - }} - /> -
    - - ) => { - setGamescope({ - ...gamescope, - upscaleHeight: - setResolution(event.currentTarget.value) ?? - gamescope.upscaleHeight - }) - }} - /> - - -
    - {/* FPS Limiters */} -
    - ) => { - setGamescope({ - ...gamescope, - fpsLimiter: - setResolution(event.currentTarget.value) ?? gamescope.fpsLimiter - }) - }} - /> -
    - - ) => { + setGamescope({ ...gamescope, - fpsLimiterNoFocus: - setResolution(event.currentTarget.value) ?? - gamescope.fpsLimiterNoFocus + enableLimiter: !gamescope.enableLimiter }) - }} - /> - -
    + {/* FPS Limiter Settings */} + {gamescope.enableLimiter && ( + <> +
    + + } + onChange={(event: ChangeEvent) => { + setGamescope({ + ...gamescope, + fpsLimiter: + setResolution(event.currentTarget.value) ?? + gamescope.fpsLimiter + }) + }} + /> +
    + + } + onChange={(event: ChangeEvent) => { + setGamescope({ + ...gamescope, + fpsLimiterNoFocus: + setResolution(event.currentTarget.value) ?? + gamescope.fpsLimiterNoFocus + }) + }} + /> +
    + + )}
    ) } From a968e4f3fcb280ada6595ead1fd39e1b1e27ae50 Mon Sep 17 00:00:00 2001 From: Ariel Juodziukynas Date: Fri, 13 Oct 2023 16:22:28 -0300 Subject: [PATCH 8/9] Gamescope: fix (i) position --- .../screens/Settings/components/Gamescope.tsx | 123 +++++++++--------- .../sections/GamesSettings/index.scss | 21 +++ 2 files changed, 81 insertions(+), 63 deletions(-) diff --git a/src/frontend/screens/Settings/components/Gamescope.tsx b/src/frontend/screens/Settings/components/Gamescope.tsx index 7de3927a4e..2762cd9eaf 100644 --- a/src/frontend/screens/Settings/components/Gamescope.tsx +++ b/src/frontend/screens/Settings/components/Gamescope.tsx @@ -81,7 +81,7 @@ const Gamescope = () => { } return ( -
    +
    {/* Enable Upscale */}
    { ))} {/* Game Res */} -
    +
    { }) }} /> -
    + { />
    {/* Upscale Res */} -
    +
    { }) }} /> -
    {
    {/* FPS Limiter Settings */} {gamescope.enableLimiter && ( - <> -
    - - } - onChange={(event: ChangeEvent) => { - setGamescope({ - ...gamescope, - fpsLimiter: - setResolution(event.currentTarget.value) ?? - gamescope.fpsLimiter - }) - }} - /> -
    - - } - onChange={(event: ChangeEvent) => { - setGamescope({ - ...gamescope, - fpsLimiterNoFocus: - setResolution(event.currentTarget.value) ?? - gamescope.fpsLimiterNoFocus - }) - }} - /> -
    - +
    + + } + onChange={(event: ChangeEvent) => { + setGamescope({ + ...gamescope, + fpsLimiter: + setResolution(event.currentTarget.value) ?? + gamescope.fpsLimiter + }) + }} + /> +
    + + } + onChange={(event: ChangeEvent) => { + setGamescope({ + ...gamescope, + fpsLimiterNoFocus: + setResolution(event.currentTarget.value) ?? + gamescope.fpsLimiterNoFocus + }) + }} + /> +
    )}
    ) diff --git a/src/frontend/screens/Settings/sections/GamesSettings/index.scss b/src/frontend/screens/Settings/sections/GamesSettings/index.scss index e1657c3657..edbcd2840f 100644 --- a/src/frontend/screens/Settings/sections/GamesSettings/index.scss +++ b/src/frontend/screens/Settings/sections/GamesSettings/index.scss @@ -65,3 +65,24 @@ details { font-size: var(--text-xl); } } + +.gamescopeSettings { + .selectFieldWrapper { + grid-template-areas: + 'label info' + 'select select'; + grid-template-columns: max-content 1fr; + } + + .textInputFieldWrapper { + grid-template-areas: + 'label info' + 'input input'; + grid-template-columns: max-content 1fr; + } + + .row { + display: flex; + gap: 10px; + } +} From f0ba8bf9242b97bb92df6816f7f8306176221b1b Mon Sep 17 00:00:00 2001 From: Ariel Juodziukynas Date: Fri, 13 Oct 2023 16:23:30 -0300 Subject: [PATCH 9/9] Gamescope: remove unneeded div --- src/frontend/screens/Settings/components/Gamescope.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontend/screens/Settings/components/Gamescope.tsx b/src/frontend/screens/Settings/components/Gamescope.tsx index 2762cd9eaf..58922dba0e 100644 --- a/src/frontend/screens/Settings/components/Gamescope.tsx +++ b/src/frontend/screens/Settings/components/Gamescope.tsx @@ -267,7 +267,7 @@ const Gamescope = () => {
    {/* FPS Limiter Settings */} {gamescope.enableLimiter && ( -
    +
    { }) }} /> -
    +