-
-
Notifications
You must be signed in to change notification settings - Fork 474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support additional gamescope options #3476
Conversation
0b0148f
to
f08d2b7
Compare
this generates a lot of log spam when changing the additional options thingy, I think there should be a way to fix this though |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
fc2f2c7
to
99a7b0d
Compare
I believe that would be good to also add the HDR option. |
i think on change is the best option since otherwise you need to have a onChange and an onBlur |
fe42318
to
386b2bc
Compare
|
That would look like this const [fetching, setFetching] = useState(true)
const [isInstalled, setIsInstalled] = useState(false)
+ const [additionalOptions, setAdditionalOptions] = useState(gamescope.additionalOptions)
+
useEffect(() => {
setFetching(true)
window.api
@@ -358,7 +360,7 @@ const Gamescope = () => {
label={t('options.gamescope.additionalOptions', 'Additional Options')}
htmlId="additionalOptions"
placeholder=""
- value={gamescope.additionalOptions}
+ value={additionalOptions}
afterInput={
<FontAwesomeIcon
className="helpIcon"
@@ -369,7 +371,8 @@ const Gamescope = () => {
)}
/>
}
- onChange={(event: ChangeEvent<HTMLInputElement>) =>
+ onChange={(event: ChangeEvent<HTMLInputElement>) => setAdditionalOptions(event.currentTarget.value)}
+ onBlur={(event: ChangeEvent<HTMLInputElement>) =>
setGamescope({
...gamescope,
additionalOptions: event.currentTarget.value
I imagine while we are at it we could do the same thing for other input fields in this component |
yeah I was trying to fix this, but I just didn't connect it with useState lol |
386b2bc
to
ad21e79
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Funny story behind this PR: I was trying to play some random Styx game from GOG that had broken mouse capture on kwin wayland, I opened it through gamescope, it works but on the wrong monitor this time, then I wrote the code for this PR really quickly to change the displays, and guess what ... gamescope doesn't support changing the displays. I will have to make a PR there as well
Use the following Checklist if you have changed something on the Backend or Frontend: