Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Unwanted behaviour from sfml window while fullscreen in other applications  (Read 5158 times)

0 Members and 2 Guests are viewing this topic.

SzefRon

  • Newbie
  • *
  • Posts: 4
    • View Profile
Hi, is there any way I could make an sfml window not freeze while I'm fullscreen in other applications?
Running the app as an administrator only fixes the issue partially, but it fixes it fully for the console.
I attached a video showing the problem (I really hope this isn't my recording software's issue. Console doesn't seem to be affected by this and both windows were set up exactly the same way).
First few seconds show both of the windows working as intended (reacting on input), then I enter a fullscreen game and sadly sfml window freezes up while console still works.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
There isn't a lot of information to go by, as such kind of hard to tell anything.

What's the "console" you talk about exactly?

Make sure you're always processing events and that you only access event members for the given event type.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

SzefRon

  • Newbie
  • *
  • Posts: 4
    • View Profile
I use sfml 2.4.2 (I use dev-cpp which uses gcc 4.9.2) and by console I mean my application is a console application and I didn't hide the console window (just for debugging). By sfml window I mean the window that gets created by the executable.
I recorded the behaviour of both the console window and the sfml window of my application
and judging from the recording it seems like the sfml window freezes up whenever you go fullscreen on ANOTHER application (it stays on the last frame before going fullscreen and refuses to make any changes to the window. I didn't show that in the recording, but I tested it after).
I should probably mention both the console window and the sfml window aren't minimised, they're just hidden behind the fullscreen game and only the sfml window seems to be unresponsive.

I'm trying to make it still render frames even while being hidden behind a fullscreen application (not minimised). I'm not sure whether that's possible, that's why I'm here. I'm asking whether there's a setting in sfml or whether I could change something in the handling of the sfml window, that could do that for me.
I also used sf::RenderWindow to render the window.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Took a while to understand what you're saying :D

So the SFML window is behind another fullscreen window and it's not updating anymore according to the recording software.

That's kind of expected behavior, by going fullscreen on a display, you give exclusive rendering rights to the fullscreen application. You may also get the window manager deciding if the window that's not visible is updated. And finally the video capturing software's hooks being effected.

You could try using a windowed fullscreen mode and see if that works.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

SzefRon

  • Newbie
  • *
  • Posts: 4
    • View Profile
Alright, so the problem doesn't come from sfml,
but why isn't the console window affected by those rendering permissions?

Also, can I somehow grant those rendering permissions to the sfml window inside my code?
If not, how can I operate the window manager to do what I want?
It's really important that it's rendered no matter what!

kojack

  • Sr. Member
  • ****
  • Posts: 343
  • C++/C# game dev teacher.
    • View Profile
I just tried, my SFML based app continued to render fine while I played full screen Dishonored.
Tested both with the app on a second monitor, and with the app on the same monitor behind the full screen game (using OBS to see it still working).
I'm on SFML 2.5.1 though (well, slightly newer, since I got it from the repo).


SzefRon

  • Newbie
  • *
  • Posts: 4
    • View Profile
Turns out it was obs' fault! I feel dumb... Oh well.
If you didn't test it, I would probably still be thinking it was my code's fault or something xD
Window capture doesn't like fullscreen...
Thanks a lot! At least I didn't lose my mind while trying to fix it myself!

 

anything