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

Author Topic: Window preventing from screensaver or monitor powersave  (Read 8412 times)

0 Members and 1 Guest are viewing this topic.

Njifra

  • Guest
Window preventing from screensaver or monitor powersave
« 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?
« Last Edit: May 03, 2014, 09:40:03 pm by Njifra »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Window preventing from screensaver or monitor powersave
« Reply #1 on: May 03, 2014, 09:58:42 pm »
Nop.
Laurent Gomila - SFML developer

Njifra

  • Guest
Re: Window preventing from screensaver or monitor powersave
« Reply #2 on: May 03, 2014, 09:59:39 pm »
Will it be added?
« Last Edit: May 04, 2014, 12:52:37 am by Njifra »

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Window preventing from screensaver or monitor powersave
« Reply #3 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.
« Last Edit: May 04, 2014, 03:46:28 am by zsbzsb »
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Window preventing from screensaver or monitor powersave
« Reply #4 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 ;)
Laurent Gomila - SFML developer

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Window preventing from screensaver or monitor powersave
« Reply #5 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 ;)
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

migizi

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Window preventing from screensaver or monitor powersave
« Reply #6 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.

Njifra

  • Guest
Re: Window preventing from screensaver or monitor powersave
« Reply #7 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.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
AW: Re: Window preventing from screensaver or monitor powersave
« Reply #8 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. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

therocode

  • Full Member
  • ***
  • Posts: 125
    • View Profile
    • Development blog
Re: Window preventing from screensaver or monitor powersave
« Reply #9 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.

Veritas

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • Email
Re: Window preventing from screensaver or monitor powersave
« Reply #10 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.
"Lasciate ogni speranza, voi ch'entrate"

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: Window preventing from screensaver or monitor powersave
« Reply #11 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?

G.

  • Hero Member
  • *****
  • Posts: 1593
    • View Profile
Re: Window preventing from screensaver or monitor powersave
« Reply #12 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.
« Last Edit: May 09, 2014, 09:42:04 pm by G. »

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Window preventing from screensaver or monitor powersave
« Reply #13 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).
SFML / OS X developer

ekun

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • Vagante
    • Email
Re: Window preventing from screensaver or monitor powersave
« Reply #14 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.
@ekunenuke

 

anything