Skip to content
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

Sound not disabled when starting without focus #2287

Open
jensj12 opened this issue Nov 11, 2015 · 8 comments
Open

Sound not disabled when starting without focus #2287

jensj12 opened this issue Nov 11, 2015 · 8 comments
Labels
bug Something went wrong. good-first-issue Low hanging fruits good for people new to open source or OpenRCT2.

Comments

@jensj12
Copy link
Contributor

jensj12 commented Nov 11, 2015

Enable 'disable sound on focus loss', start the game and go to another window before the game is started up. Even though the game doesn't have focus, sound is enabled. If you lose focus again after going back to the game the sound is disabled like it should.

@Gymnasiast Gymnasiast added the bug Something went wrong. label Nov 11, 2015
@zsilencer
Copy link
Contributor

looks like normal behavior for windows, even starcraft 2 does this.

@Krutonium
Copy link
Member

Actually I think it's just a bug that usually doesn't get addressed - normally you look for a Window Minimised Event, in this case you miss the event, and should probably check the Window status after init finishes.

@HaasJona
Copy link
Contributor

I agree with @zsilencer and don't think this is a bug. First, the setting is labelled 'disable sound on focus loss' so if there is no focus to begin with and therefore no focus loss, then I don't see why the sound should be disabled. Also if you have a slow PC and you start the game in the background then it's helpful to know when the game is loaded fully because that is when you're getting sound. If you start the game you usually want to have sound (and if not you usually want to disable sound completely anyway) so I think the current behaviour makes sense.

@mrtnptrs
Copy link
Contributor

I agree with @zsilencer and @HaasJona and this could also be treated as a very minor "bug". My advice would be to close this issue. Could anyone do this or say why that wouldn't be good? :)

@tupaschoal
Copy link
Member

Still happens on v0.3.1

@ZehMatt ZehMatt added the good-first-issue Low hanging fruits good for people new to open source or OpenRCT2. label Oct 3, 2020
@733737
Copy link
Contributor

733737 commented Sep 30, 2022

I cannot replicate this

@jensj12
Copy link
Contributor Author

jensj12 commented Oct 1, 2022

I can still reproduce the issue on 6d97bbd, though it sometimes mutes after about 1 second (depending on whether the other window is fullscreen, as far as I've tested).

@MattBDev
Copy link

I think the issue is fixed even if there is a short delay before the music pauses.

Daniel-Lightbourn added a commit to Daniel-Lightbourn/OpenRCT2 that referenced this issue Apr 13, 2024
Defer calling `PlayTitleMusic()` the first time when OpenRCT2 starts until
after SDL events have been polled. This allows the code to process focus
events to mute the audio before the title music starts playing.
Daniel-Lightbourn added a commit to Daniel-Lightbourn/OpenRCT2 that referenced this issue Apr 13, 2024
Defer calling `PlayTitleMusic()` the first time when OpenRCT2 starts until
after SDL events have been polled. This allows the code to process focus
events to mute the audio before the title music starts playing.
Daniel-Lightbourn added a commit to Daniel-Lightbourn/OpenRCT2 that referenced this issue Apr 13, 2024
Defer calling `PlayTitleMusic()` the first time when OpenRCT2 starts until
after SDL events have been polled. This allows the code to process focus
events to mute the audio before the title music starts playing.
Daniel-Lightbourn added a commit to Daniel-Lightbourn/OpenRCT2 that referenced this issue Apr 24, 2024
Defer calling `PlayTitleMusic()` the first time when OpenRCT2 starts until
after SDL events have been polled. This allows the code to process focus
events to mute the audio before the title music starts playing.
Daniel-Lightbourn added a commit to Daniel-Lightbourn/OpenRCT2 that referenced this issue Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something went wrong. good-first-issue Low hanging fruits good for people new to open source or OpenRCT2.
Projects
None yet
Development

No branches or pull requests

10 participants