SFML community forums

General => Feature requests => Topic started by: Njifra on May 03, 2014, 09:37:02 pm

Title: Window preventing from screensaver or monitor powersave
Post by: Njifra on May 03, 2014, 09:37:02 pm
Title says all.
I don't think I need to explain more.
Maybe this code says all (even thought title says all too):

// Prevent screensaver or monitor powersave
case WM_SYSCOMMAND:
{
        switch (wParam)
        {
                case SC_SCREENSAVE:
                case SC_MONITORPOWER:
                return 0;
        }
        break;
}
 

Does this already exists?
Title: Re: Window preventing from screensaver or monitor powersave
Post by: Laurent on May 03, 2014, 09:58:42 pm
Nop.
Title: Re: Window preventing from screensaver or monitor powersave
Post by: Njifra on May 03, 2014, 09:59:39 pm
Will it be added?
Title: Re: Window preventing from screensaver or monitor powersave
Post by: zsbzsb on May 04, 2014, 03:44:41 am
No, because as far as I know there is no cross platform method to preventing the screensaver.

Plus in my opinion a program shouldn't be affecting the hosting environment in this way.
Title: Re: Window preventing from screensaver or monitor powersave
Post by: Laurent on May 04, 2014, 09:42:26 am
Quote
Will it be added?
Let's see if other users have an opinion about it.

If you want to help, you can help by investigating implementation on other OSes, to see if they all support the feature. Note that it doesn't mean it will be integrated, but at least the technical part would be sorted out and we would just have to decide whether we want it or not ;)
Title: Re: Window preventing from screensaver or monitor powersave
Post by: Nexus on May 04, 2014, 01:33:38 pm
A feature request should always contain a decription of the feature plus the reason why you want to integrate it. In which scenario do you really require this functionality? Nothing will be added only because it's possible.

It's not us that have to find arguments against the feature, but you to find some for it ;)
Title: Re: Window preventing from screensaver or monitor powersave
Post by: migizi on May 07, 2014, 03:45:32 am
Might require a bit of work on Linux. I know there is xscreensaver but I'm not sure about the API for any others. I remember when Dungeon Defenders was ported and they made use of the gnome-screensaver API. It caused a lot of problems for people not running gnome.
Title: Re: Window preventing from screensaver or monitor powersave
Post by: Njifra on May 07, 2014, 10:21:02 pm
A feature request should always contain a decription of the feature plus the reason why you want to integrate it. In which scenario do you really require this functionality? Nothing will be added only because it's possible.

It's not us that have to find arguments against the feature, but you to find some for it ;)

Reason:
Well, SFML is multimedia library and video player is multimedia app. And, video player must prevent screensaver from showing... I would not download/buy one if it doesent prevent screensaver cuz it would be annoying to move my mouse every 15 minutes while watching movie...

Quote
Will it be added?
Let's see if other users have an opinion about it.

If you want to help, you can help by investigating implementation on other OSes, to see if they all support the feature. Note that it doesn't mean it will be integrated, but at least the technical part would be sorted out and we would just have to decide whether we want it or not ;)

Sure, ill write implementation on other   OSes too. But when I get my PC fixed :)
Im writing this from my mobile.
Title: AW: Re: Window preventing from screensaver or monitor powersave
Post by: eXpl0it3r on May 08, 2014, 12:07:18 am
Well, SFML is multimedia library and video player is multimedia app. And, video player must prevent screensaver from showing... I would not download/buy one if it doesent prevent screensaver cuz it would be annoying to move my mouse every 15 minutes while watching movie...
Alot of players I know don't do that. If you don't want the screensaver to show, deactivate it.
Nowadays screensavers are only for decoration purposes anyway. ;)
Title: Re: Window preventing from screensaver or monitor powersave
Post by: therocode on May 09, 2014, 08:59:21 am
I would agree that if I made a video player, I would want this feature. I think it is retarded when video players get interrupted by the screensaver. It is much more annoying to manually deactivate the screen saver every time I want to watch something. Often you don't even remember to, until it happens in mid-film and you get annoyed and have to pause and deactivate it.

So my opinion is that if SFML is meant to be able to be used for video players and other such passive visual media, then I am all for this feature.
Title: Re: Window preventing from screensaver or monitor powersave
Post by: Veritas on May 09, 2014, 02:28:17 pm
I will have to agree with this. Maybe not all video players support this feature but the major ones do and there is a reason for doing so. If it's possible to implement this on sfml I think it would be a handy feature.
Title: Re: Window preventing from screensaver or monitor powersave
Post by: Ixrec on May 09, 2014, 07:47:50 pm
I never have this problem with screensavers (since I don't use them), but I do have it a lot with laptops falling asleep in the middle of a video, whether it's streaming from Youtube or playing locally in MPC or whatever.  So if anyone's trying to implement this please make sure it prevents sleep mode as well as screensavers (I don't know if the OS treats them differently).

Incidentally, since the main use case seems to be video playing, maybe this would go better in sfeMovie than "core" SFML?
Title: Re: Window preventing from screensaver or monitor powersave
Post by: G. on May 09, 2014, 09:39:22 pm
There are also replays of previous games based on saved inputs, or being a spectator of an online match.
My screensaver popped up once when I was watching 2 AI play against each other. :D
Sure not everyone needs this feature, but it has its uses.
Title: Re: Window preventing from screensaver or monitor powersave
Post by: Hiura on May 10, 2014, 08:06:36 am
I'm not arguing for or against this feature but if it is added then we need to be able to enable/disable it (not all multimedia app want that).
Title: Re: Window preventing from screensaver or monitor powersave
Post by: ekun on December 27, 2014, 12:24:57 am
I realize this is an old topic, but it doesn't look like this feature has been implemented so I figured I'd chime in with my relevant use case.

When players play our game with a usb gamepad without using keyboard or mouse, the computer sleeps automatically while they're playing. It'd be nice for some way to prevent this by disabling the automatic sleep while the window is open.
Title: Re: Window preventing from screensaver or monitor powersave
Post by: eXpl0it3r on December 27, 2014, 01:35:47 am
I think this feature is something that one day could be integrated into SFML and since there's no ticket on the issue tracker, I suggest you go ahead and create one.
Keep in mind however, that there's a lot of other things there, some dating back years. Plus there has to be done some research first, e.g. whether such a feature is even doable on all supported OS. Thus you shouldn't expect this to get implemented in the near future. However if you have concrete ideas on how this could be implemented properly, we could start a discussion here and if you or someone else provides the full implementation, it probably would get into SFML a lot quicker. ;)