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

Add ToggleScrSvr function and expose it for python scripts to call upon. #1656

Closed
wants to merge 3 commits into from
Closed

Add ToggleScrSvr function and expose it for python scripts to call upon. #1656

wants to merge 3 commits into from

Conversation

SlrG
Copy link
Contributor

@SlrG SlrG commented Oct 21, 2012

This adds a function to toggle the screensaver on/off. By adding it to builtin.cpp it gets exposed to python scripts or addons to call upon it when needed.

@ghost
Copy link

ghost commented Oct 22, 2012

imo this should be more of an app ping thing. ie it also pings the idle timer.

@SlrG
Copy link
Contributor Author

SlrG commented Oct 22, 2012

@cptspiff:
I don't quite understand what you mean. :) I'm open to change it in every possible way. Regarding the idle timer, would you say it would be better to prevent it from changing?

At the moment I plan to use this function to write a python screensaver script which starts the windows system screensaver instead of providing or using an xbmc internal one. A feature which I noticed was asked for several times over the last two years via the forum by different people.

Calling the external screensaver will however make XBMC loose focus and not react to the mouse move or keypress which exits the windows saver. On return the black xbmc screensaver window will still be open and I found no xbmc function to make it close without having the user to interact. (which would reset the idle timer, too)

That is my usecase. Maybe unrelevant for most people. But the toggle function itself I deem quite useful to have for scripts and addons writers (see Gifties comment). The http-api is gone and I don't know if toggling the screensaver is doable by json-rpc.

@ghost
Copy link

ghost commented Oct 22, 2012

i'm saying rename the function and make it more usable by making it do an app ping rather than just waking up the screensaver.

@SlrG
Copy link
Contributor Author

SlrG commented Oct 22, 2012

@cptspiff:
Please forgive me, I'm feeling rather stupid to have to say this, but I still don't understand. What other things should the function achieve? Resetting the idle timer is no problem. One line of code. Should this happen on activating the screensaver, too? Or only when deactivating?

An app ping how I understand it, would only wake something up, right? It won't make sense to have it toggle between "waking" and "sleeping", or am I missing something?

"Waking" will only work if the screensaver is running. What other processes has xbmc running that need to be woken up? No python script will be able to wake the pc from suspend if no timer is involved. Which probably would go a bit above my coding skills. :)

For "sleeping" it would be possible to suspend instead of screensaver. I can't imagine other xbmc processes that need to be activated for "sleeping"?! And for suspend I would rather use a seperate function and not mix it with the screensaver one.

So for me the name as it is makes perfect sense. Even if the idle timer is resetted on toggling.

What name would you suggest the function should have?

@ghost
Copy link

ghost commented Oct 23, 2012

XBMC.PingApp or something like that.

my point here is that, while currently there is only idle timer and ssaver, who knows what might pop up later that makes sense. being prepared...

@SlrG
Copy link
Contributor Author

SlrG commented Oct 24, 2012

@cptspiff:
Ah. Now that makes it clearer. I'll soon close this pull request and be back with a new one, which does like you suggest. A last question, though. XBMC.PingApp will only wake the app. May I add yet another PR with an enable screensaver function?

@ghost
Copy link

ghost commented Oct 24, 2012

makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant