History log of /haiku/src/bin/screen_blanker/ScreenBlanker.cpp
Revision Date Author Comments
# e4e2ce4c 09-Dec-2014 Puck Meerburg <puck@puckipedia.nl>

When testing screensaver, don't have mouse move exit the screen saver.

Fixes #7463

Signed-off-by: Adrien Destugues <pulkomandy@gmail.com>


# 658491b8 19-Nov-2013 Puck Meerburg <puck@puckipedia.nl>

Fixed #9952.

* Delay of the password lock for a few seconds

Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>


# 1c776bfe 15-Nov-2013 John Scipione <jscipione@gmail.com>

Lock screensaver window directly

By passing the window pointer to ScreenSaverRunner contructor and using that
to lock the window when drawing instead of getting the window from the
Window() method of the view. This is safer.


# d34a680c 14-Nov-2013 John Scipione <jscipione@gmail.com>

Screen Saver: fix race condition

Start the screensaver in the window thread instead of the runner
thread so that there is no lock contention for the window lock in
the runner thread when the saver starts.

The view that gets drawn into is assumed to have been prepared before
being passed to the runner thread, and this assumption has been made
true for the screensaver preview and screen_blanker apps.

Eliminate fHasStarted and the corresponding HasStarted() method in
ScreenSaverRunner as they are no longer needed.

Drawing still happens in the runner thread, and still needs to lock
the window thread potentially causing contention, yet, there
is a timeout here so the contention won't freeze the screensaver window,
only delay drawing the screensaver.

Drawing could be moved to the window thread via message passing to avoid
lock contention with the window but this would defeat a big part of the
purpose of having a separate rendering thread.

This fixes #10125 and #4260


# 0f1162d2 14-Nov-2013 John Scipione <jscipione@gmail.com>

ScreenSaver: Make sure password window is shown

… before resuming the saver on B_KEY_DOWN in the message filter.

It was assumed before, now we’re actually checking to make sure.


# e22c01af 14-Nov-2013 John Scipione <jscipione@gmail.com>

Screen Saver: style fixes


# 5efc1f3d 09-Dec-2010 Philippe Houdoin <philippe.houdoin@gmail.com>

Force blackness view only when no saver was found. This fix pseudo-saver Blackness
that was broken by previous change.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39790 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 52bc210d 29-Mar-2009 Karsten Heimrich <host.haiku@gmx.de>

* add flurry to the image
* seems we hit a race during shutdown, thus the BGLView would already be delete
by unload_add_on, crashing the screenblanker (tested with several GL saver)



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29793 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0834f79c 14-Mar-2009 Ryan Leavengood <leavengood@gmail.com>

An Esc pressed while the password window is showing will close it and resume
the screen saver.

I added this to the filter in the ScreenSaverWindow instead of the
PasswordWindow to avoid having to add another BMessageFilter. It already is
getting all keydowns anyhow.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29521 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d39c5354 13-Mar-2009 Ryan Leavengood <leavengood@gmail.com>

- Use PostMessage instead of a BMessenger to send a message to the window from
the app.

- Use the new "_fake" parameter to detect the initial mouse moved sent by
app_server instead of a BMessageRunner and delay.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29493 a95241bf-73f2-0310-859d-f6bbb57e9c96


# cb6a084f 12-Mar-2009 Ryan Leavengood <leavengood@gmail.com>

Fixed a bug in the screen saver code that could cause someone to get locked out
of their machine: if the password check is turned on, and the password window
is shown but times out (when the screen saver starts again after the standard
delay), the input filter never knew about this and would never try to end the
screen saver again.

The solution is to take the logic for turning off the screen saver out of the
input filter and put it in the screen blanker itself.

Also while working in the input filter I removed some debugging and a TODO that
I think cannot be fixed.

In the screen_blanker the exit after loading the settings file was removed
since the default settings now work for the screen_blanker.

Plus obviously code was added to handle exit upon user input as well as the
timing out of the password window.

If anyone has a better solution for the 250ms timeout to ignore initial mouse
moves, let me know.

Also I think the new calls should be nothrow, but I am not sure what the rule
is for that.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29488 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d0eaec30 01-Feb-2009 Michael Lotz <mmlr@mlotz.ch>

Fix more operator precedence errors. These do not do what you'd expect at first
sight. The comparison operator takes precedence over the binary ones.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29121 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 310a9c9e 19-Oct-2008 Axel Dörfler <axeld@pinc-software.de>

* Setting to the saver full screen and back is no longer needed when the
password window shows up (this avoids getting the Deskbar to front when
the password window shows up).
* Automatic whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28238 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f0d2e760 06-Jan-2007 Axel Dörfler <axeld@pinc-software.de>

* Fixed missing "not" operator in all those flags changing lines; turning off the
screen is now working as expected.
* Only remove DPMS runners when the time is actually supported (previous code would
not have always worked correctly in case the graphics card would not support all
DPMS modes).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19724 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 642090fd 09-Jun-2006 Axel Dörfler <axeld@pinc-software.de>

* ScreenCornerSelector is now a BControl and fully keyboard navigable.
* simplified drawing a bit, and got rid of those scary scale*() stuff (which also
results in better looks). The monitor now looks like the one in Screen; I think
it should either be a very reduced form or a very detailed form, but anything
in between often looks just odd.
* It now also listens to B_MOUSE_DOWN incl. mouse tracking, not only to B_MOUSE_UP.
* Less flickering on state changes (and focus change).
* Loading settings no longer overwrites defaults missing from the settings.
* Renamed ScreenSaverSettings::GetBlankCorner() to BlankCorner(),
LoadSettings() to Load(), GetState() to GetModuleState(), ....
* Some more cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17783 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d0e9fa68 07-Jun-2006 Axel Dörfler <axeld@pinc-software.de>

* Fixed some memory leaks when using the BMessageRunners.
* Now quits the window directly, instead of letting the application destructor do that.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17756 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 41158aaf 06-Jun-2006 Axel Dörfler <axeld@pinc-software.de>

* Renamed the ScreenSaverPrefs class to the more Be-like ScreenSaverSettings.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17755 a95241bf-73f2-0310-859d-f6bbb57e9c96


# af55bae2 06-Jun-2006 Axel Dörfler <axeld@pinc-software.de>

* Implemented DPMS support.
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17754 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7cae4a1e 06-Jun-2006 Axel Dörfler <axeld@pinc-software.de>

* Big time cleanup of the screen saver stuff, not yet finished yet, though.
Renamed lots of things, like ScreenSaverThread to ScreenSaverRunner,
refactored code, etc. Much cleaner interfaces and code.
* Fixed a couple of bugs and in the add-on handling, especially some settings
related bugs (ie. testing a screen saver will now use its latest settings,
etc.).
* Correctly implemented DPMS support in ScreenSaverPrefs and the ScreenSaver
preferences application - screen_blanker still ignores them, though.
* It's not yet font sensitive either.
* Changed the input_server add-on to not switch to the screen blanker immediately
when it's in the "blank corner" - doesn't seem to work yet, though (only tested
under Qemu).
* Correctly implemented the "preview" function (before, a screen saver would
never know it rendered a preview).
* Evaluates the return value of BScreenSaver::StartSaver().
* The screen saver thread is no longer killed without notice - it's now
always shut down properly.
* Made the code more robust against failure.
* Introduced some new bugs as well (the screen saver list view doesn't jump to
the selection anymore, for some reason), those will be fixed later (as the
remaining issues).
* Probably some more I forgot about.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17731 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e4e2ce4ce38546193ddab428b32a654447a07e19 09-Dec-2014 Puck Meerburg <puck@puckipedia.nl>

When testing screensaver, don't have mouse move exit the screen saver.

Fixes #7463

Signed-off-by: Adrien Destugues <pulkomandy@gmail.com>


# 658491b8984a4e31607c9cebeaca0fdec77d50e2 19-Nov-2013 Puck Meerburg <puck@puckipedia.nl>

Fixed #9952.

* Delay of the password lock for a few seconds

Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>


# 1c776bfe37a7c1a382f9720112f19de00c7cff07 15-Nov-2013 John Scipione <jscipione@gmail.com>

Lock screensaver window directly

By passing the window pointer to ScreenSaverRunner contructor and using that
to lock the window when drawing instead of getting the window from the
Window() method of the view. This is safer.


# d34a680c043c72bae01662cc730ca81cb4cd2615 14-Nov-2013 John Scipione <jscipione@gmail.com>

Screen Saver: fix race condition

Start the screensaver in the window thread instead of the runner
thread so that there is no lock contention for the window lock in
the runner thread when the saver starts.

The view that gets drawn into is assumed to have been prepared before
being passed to the runner thread, and this assumption has been made
true for the screensaver preview and screen_blanker apps.

Eliminate fHasStarted and the corresponding HasStarted() method in
ScreenSaverRunner as they are no longer needed.

Drawing still happens in the runner thread, and still needs to lock
the window thread potentially causing contention, yet, there
is a timeout here so the contention won't freeze the screensaver window,
only delay drawing the screensaver.

Drawing could be moved to the window thread via message passing to avoid
lock contention with the window but this would defeat a big part of the
purpose of having a separate rendering thread.

This fixes #10125 and #4260


# 0f1162d27e35f133e86a93b8a7effeec3e34f20f 14-Nov-2013 John Scipione <jscipione@gmail.com>

ScreenSaver: Make sure password window is shown

… before resuming the saver on B_KEY_DOWN in the message filter.

It was assumed before, now we’re actually checking to make sure.


# e22c01af030d33e53e6bbde56e331dd8cd7de097 14-Nov-2013 John Scipione <jscipione@gmail.com>

Screen Saver: style fixes


# 5efc1f3d21fa19214e9ecca71f36ab121e8edbab 09-Dec-2010 Philippe Houdoin <philippe.houdoin@gmail.com>

Force blackness view only when no saver was found. This fix pseudo-saver Blackness
that was broken by previous change.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39790 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 52bc210d99b2515444ab8f87d3ff892a0e527935 29-Mar-2009 Karsten Heimrich <host.haiku@gmx.de>

* add flurry to the image
* seems we hit a race during shutdown, thus the BGLView would already be delete
by unload_add_on, crashing the screenblanker (tested with several GL saver)



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29793 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0834f79c8ce6e973204ff08a16ffaa3e97d8a1ff 14-Mar-2009 Ryan Leavengood <leavengood@gmail.com>

An Esc pressed while the password window is showing will close it and resume
the screen saver.

I added this to the filter in the ScreenSaverWindow instead of the
PasswordWindow to avoid having to add another BMessageFilter. It already is
getting all keydowns anyhow.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29521 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d39c5354b8303d1babba79c69ca582804f36b5d4 13-Mar-2009 Ryan Leavengood <leavengood@gmail.com>

- Use PostMessage instead of a BMessenger to send a message to the window from
the app.

- Use the new "_fake" parameter to detect the initial mouse moved sent by
app_server instead of a BMessageRunner and delay.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29493 a95241bf-73f2-0310-859d-f6bbb57e9c96


# cb6a084f200d116677acdc7535f476626f09ccaa 12-Mar-2009 Ryan Leavengood <leavengood@gmail.com>

Fixed a bug in the screen saver code that could cause someone to get locked out
of their machine: if the password check is turned on, and the password window
is shown but times out (when the screen saver starts again after the standard
delay), the input filter never knew about this and would never try to end the
screen saver again.

The solution is to take the logic for turning off the screen saver out of the
input filter and put it in the screen blanker itself.

Also while working in the input filter I removed some debugging and a TODO that
I think cannot be fixed.

In the screen_blanker the exit after loading the settings file was removed
since the default settings now work for the screen_blanker.

Plus obviously code was added to handle exit upon user input as well as the
timing out of the password window.

If anyone has a better solution for the 250ms timeout to ignore initial mouse
moves, let me know.

Also I think the new calls should be nothrow, but I am not sure what the rule
is for that.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29488 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d0eaec308617fe6623df22fb2e41308517c5d7cb 01-Feb-2009 Michael Lotz <mmlr@mlotz.ch>

Fix more operator precedence errors. These do not do what you'd expect at first
sight. The comparison operator takes precedence over the binary ones.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29121 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 310a9c9e21c4d5a60afe67a8e14f4db274dfc02a 19-Oct-2008 Axel Dörfler <axeld@pinc-software.de>

* Setting to the saver full screen and back is no longer needed when the
password window shows up (this avoids getting the Deskbar to front when
the password window shows up).
* Automatic whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28238 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f0d2e760814f74ab8039a42bb3787a6ed7918391 06-Jan-2007 Axel Dörfler <axeld@pinc-software.de>

* Fixed missing "not" operator in all those flags changing lines; turning off the
screen is now working as expected.
* Only remove DPMS runners when the time is actually supported (previous code would
not have always worked correctly in case the graphics card would not support all
DPMS modes).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19724 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 642090fdc62bbf5df46a1135a006636c3ca63691 09-Jun-2006 Axel Dörfler <axeld@pinc-software.de>

* ScreenCornerSelector is now a BControl and fully keyboard navigable.
* simplified drawing a bit, and got rid of those scary scale*() stuff (which also
results in better looks). The monitor now looks like the one in Screen; I think
it should either be a very reduced form or a very detailed form, but anything
in between often looks just odd.
* It now also listens to B_MOUSE_DOWN incl. mouse tracking, not only to B_MOUSE_UP.
* Less flickering on state changes (and focus change).
* Loading settings no longer overwrites defaults missing from the settings.
* Renamed ScreenSaverSettings::GetBlankCorner() to BlankCorner(),
LoadSettings() to Load(), GetState() to GetModuleState(), ....
* Some more cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17783 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d0e9fa680eae3e69a2d4dff26dbf3e47ad7c9727 07-Jun-2006 Axel Dörfler <axeld@pinc-software.de>

* Fixed some memory leaks when using the BMessageRunners.
* Now quits the window directly, instead of letting the application destructor do that.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17756 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 41158aaf918229a36e911666a32573bb633196ea 06-Jun-2006 Axel Dörfler <axeld@pinc-software.de>

* Renamed the ScreenSaverPrefs class to the more Be-like ScreenSaverSettings.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17755 a95241bf-73f2-0310-859d-f6bbb57e9c96


# af55bae2f690f138d18dc982b7535840bd12b805 06-Jun-2006 Axel Dörfler <axeld@pinc-software.de>

* Implemented DPMS support.
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17754 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7cae4a1ee0a7e8f1214e6fa410efe9f5a0c7cecb 06-Jun-2006 Axel Dörfler <axeld@pinc-software.de>

* Big time cleanup of the screen saver stuff, not yet finished yet, though.
Renamed lots of things, like ScreenSaverThread to ScreenSaverRunner,
refactored code, etc. Much cleaner interfaces and code.
* Fixed a couple of bugs and in the add-on handling, especially some settings
related bugs (ie. testing a screen saver will now use its latest settings,
etc.).
* Correctly implemented DPMS support in ScreenSaverPrefs and the ScreenSaver
preferences application - screen_blanker still ignores them, though.
* It's not yet font sensitive either.
* Changed the input_server add-on to not switch to the screen blanker immediately
when it's in the "blank corner" - doesn't seem to work yet, though (only tested
under Qemu).
* Correctly implemented the "preview" function (before, a screen saver would
never know it rendered a preview).
* Evaluates the return value of BScreenSaver::StartSaver().
* The screen saver thread is no longer killed without notice - it's now
always shut down properly.
* Made the code more robust against failure.
* Introduced some new bugs as well (the screen saver list view doesn't jump to
the selection anymore, for some reason), those will be fixed later (as the
remaining issues).
* Probably some more I forgot about.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17731 a95241bf-73f2-0310-859d-f6bbb57e9c96