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

added: Inhibit screensaver builtin #16345

Merged
merged 1 commit into from Sep 16, 2019
Merged

Conversation

arnova
Copy link
Member

@arnova arnova commented Jul 3, 2019

Description

This implements a new builtin to prevent the screensaver from starting. Currently there are other "hacks" out there to accomplish this, but with this builtin there is a "proper" way now.

Motivation and Context

It implements a new feature

How Has This Been Tested?

Some very sophisticated Python scripting ;-)

Screenshots (if appropriate):

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • Clean up (non-breaking change which removes non-working, unmaintained functionality)
  • Improvement (non-breaking change which improves existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that will cause existing functionality to change)
  • Cosmetic change (non-breaking change that doesn't touch code)
  • None of the above (please explain below)

Checklist:

  • My code follows the Code Guidelines of this project
  • My change requires a change to the documentation, either Doxygen or wiki
  • I have updated the documentation accordingly
  • I have read the Contributing document
  • I have added tests to cover my change
  • All new and existing tests passed

@lrusak
Copy link
Contributor

lrusak commented Jul 3, 2019

I'd rather not add to the complexity of the screensaver stuff until we can properly break out the screensaver (and dpms) from CApplication (which is what #16269 intends to solve)

@arnova
Copy link
Member Author

arnova commented Jul 4, 2019

@lrusak : No problem. Will rebase on your work as soon as it's in mainline

/// ,
/// Inhibit the screensaver
/// }
/// \table_row2_l{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe make it a more detailed, e.g.:

///   \table_row2_l{
///     <b>`InhibitScreensaver(yesNo)`</b>
///     ,
///     Inhibit the screensaver
///     @param[in] yesNo   value with "true" or "false" to inhibit or allow screensaver (leaved empty force to true)
///   }

Copy link
Member

@AlwinEsch AlwinEsch Jul 22, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise I find this request very good and helpful for my web browser addon 😊 (to avoid screensaver on webvideo)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AlwinEsch : Thanks for the review I'll incorporate your suggestions in this PR.

@arnova arnova added this to the Matrix 19.0-alpha 1 milestone Jul 24, 2019
@arnova arnova added Type: Feature non-breaking change which adds functionality v19 Matrix labels Jul 24, 2019
@garbear
Copy link
Member

garbear commented Jul 25, 2019

A good next step would be to turn the inhibition into a context manager so that multiple clients could use the builtin

@arnova
Copy link
Member Author

arnova commented Jul 26, 2019

@garbear: Not sure what you mean by that. Why isn't it possible now to use it by multiple clients?

@eigendude
Copy link

Alice: inhibit
Bob: inhibit
Alice: uninhibit
-> Bob still thinks shutdown is inhibited

@eigendude
Copy link

eigendude commented Jul 26, 2019

(work account)

to fix this, you can use an object with context that reserves a "handle" given to it by an inhibitor. Both Alice and Bob would acquire a handle, and shutdown is inhibited as long as handles are outstanding. that way, Alice and Bob can operate without knowing about each other

@arnova
Copy link
Member Author

arnova commented Jul 27, 2019

(work account)

to fix this, you can use an object with context that reserves a "handle" given to it by an inhibitor. Both Alice and Bob would acquire a handle, and shutdown is inhibited as long as handles are outstanding. that way, Alice and Bob can operate without knowing about each other

You simply mean using a refcounter then, right? Do note that we need to do this for other stuff as well then like the shutdown inhibiter builtin.

@garbear
Copy link
Member

garbear commented Jul 29, 2019

Yes, I recommend adding refcounting where two agents want to access the shared state.

@arnova
Copy link
Member Author

arnova commented Sep 11, 2019

Yes, I recommend adding refcounting where two agents want to access the shared state.

@garbear : After some thought, I think this should be done separately from this PR since it also affects several other builtins (like the shutdown inhibiter).

@garbear
Copy link
Member

garbear commented Sep 11, 2019

sounds good

@arnova arnova merged commit f5b3bf1 into xbmc:master Sep 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature non-breaking change which adds functionality v19 Matrix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants