History log of /haiku/src/kits/screensaver/ScreenSaverRunner.cpp
Revision Date Author Comments
# e9a0833a 25-Feb-2014 John Scipione <jscipione@gmail.com>

ScreenSaverRunner: Fix segmentation fault loading bad screen saver.

When Settings.ModuleName() returned NULL here we got a segmentation fault
trying to access the pointer.

I ran into this trying to load up a non-screensaver executable in ScreenSaver,
it crashed instead of doing the right thing and refusing to load.

Also, since we go to the trouble of saving this to a variable, we should actually use it.


# 94f8ac8c 25-Feb-2014 John Scipione <jscipione@gmail.com>

ScreenSaverRunner: print errors to stderr instead of stdout.

Also print on a couple of new error cases:
* print and error if fSaver is NULL,
* print and error if unload_add_on failed.


# 06f133c1 25-Feb-2014 John Scipione <jscipione@gmail.com>

ScreenSaverRunner: treat load_add_on return value like an image_id

... rather than a status_t, because that's what it is.


# 84466cef 25-Feb-2014 John Scipione <jscipione@gmail.com>

ScreenSaverRunner: check return value of methods


# d960838b 25-Feb-2014 John Scipione <jscipione@gmail.com>

ScreenSaverRunner: clarify some comments


# 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


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

ScreenSaverRunner: Suspend() and Resume() return status_t


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

Screen Saver: style fixes


# 4b7e2196 03-Oct-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Remove /boot/common for good

* Remove support for the "common" installation location from packagefs,
package kit, package daemon, package managers.
* Rename the B_COMMON_*_DIRECTORY constants referring to writable
directories to B_SYSTEM_*_DIRECTORY.
* Remove/adjust the use of various B_COMMON_*_DIRECTORY constants.
I'm sure some occurrence still remain. They can be adjusted when the
remaining B_COMMON_*_DIRECTORY constants are removed.


# 91de0513 26-Sep-2013 John Scipione <jscipione@gmail.com>

ScreenSaver: Revert the controversial parts of hrev46012

ScreenSaver once again locks up due to the bug described in #4260
awaiting a systemic fix.


# d9acbaf0 02-Sep-2013 John Scipione <jscipione@gmail.com>

ScreenSaver: Timeout if window won't lock. Fixes #4260.

If we fail to lock the window in the kInitialTickRate time, quit the thread.
We were deadlocking causing #4260 because you could open several
threads by moving through the screen saver list quickly all trying to lock
the same window at the same time, classic deadlock.


# fa365178 02-Sep-2013 John Scipione <jscipione@gmail.com>

ScreenSaverRunner: Style fixes

Also update copyright info, add myself to authors list alphabetically.


# 323b6546 21-Nov-2011 Oliver Tappe <zooey@hirschkaefer.de>

Filtered flat import of Oliver's svn package management branch

Bring the changes that aren't package management related and the ones
that are but don't take effect as long as they are ignored by the build
system into the master.

Summary of changes:
* Introduce private header <directories.h> with constants for a good
deal of paths that should usually be retrieved via find_directory().
* Replace hard-coded paths by using find_directory() or the
<directories.h> constants (e.g. in drivers and the kernel).
* Add find_directory() constants needed for package management.
* Add __HAIKU_ABI_NAME and B_HAIKU_ABI_NAME macros.
* src/apps/deskbar: BeMenu.* -> DeskbarMenu.*,
DeskBarUtils.* -> DeskbarUtils.*
* Change deskbar menu settings directory from ~/config/be to
~/config/settings/deskbar.
* Other smaller cleanups, changes, and fixes.


# 3dfd9cb9 16-Jun-2011 Oliver Tappe <zooey@hirschkaefer.de>

Flat commit of all changes from package-management branch in svn


# d159cdcf 04-Oct-2009 Ryan Leavengood <leavengood@gmail.com>

Apply patch from Caitlin Shaw to allow for smaller screensaver tick times that 50 ms.

This fixes #4628.

I added the TODO because I think this code is getting hairy.


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


# 835e3546 09-Dec-2008 Rene Gollent <anevilyak@gmail.com>

Remove unnecessary comparison.



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


# bdffbce7 09-Dec-2008 Rene Gollent <anevilyak@gmail.com>

Adjust ScreenSaverRunner to make the screen saver draw once before sleeping. This fixes the perceived black screen problem with the Message screensaver. Also cleaned up Message slightly to retrieve its string from fortune more cleanly, and readded it to the build since it will no longer deadlock the screensaver module for 30 seconds at a time.


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


# dbcdcf39 09-Dec-2008 Rene Gollent <anevilyak@gmail.com>

Correct slight regression from r28777 - screen saver tick size can be adjusted dynamically, and thus we must update it after each complete tick. Fixes ticket #3211.



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


# 4f07e62e 04-Dec-2008 Rene Gollent <anevilyak@gmail.com>

Break up the screen saver update interval into 50 msec ticks. This lets us quickly evaluate if it's time to exit the screen saver, which would previously have blocked until the tick interval was up. This fixes ticket #2339.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28777 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


# 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


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

Damn, I forgot to include this directory when committing the screen saver changes.
This should have been part of r17731. Fixes the build.


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


# e9a0833a86246dde90eef56e09b36fc4069a5ee4 25-Feb-2014 John Scipione <jscipione@gmail.com>

ScreenSaverRunner: Fix segmentation fault loading bad screen saver.

When Settings.ModuleName() returned NULL here we got a segmentation fault
trying to access the pointer.

I ran into this trying to load up a non-screensaver executable in ScreenSaver,
it crashed instead of doing the right thing and refusing to load.

Also, since we go to the trouble of saving this to a variable, we should actually use it.


# 94f8ac8cf1e63d9290981d8430bdf2e0c93017d0 25-Feb-2014 John Scipione <jscipione@gmail.com>

ScreenSaverRunner: print errors to stderr instead of stdout.

Also print on a couple of new error cases:
* print and error if fSaver is NULL,
* print and error if unload_add_on failed.


# 06f133c1f2b16a3fffd00fe5a9a64cbfdbb55ab3 25-Feb-2014 John Scipione <jscipione@gmail.com>

ScreenSaverRunner: treat load_add_on return value like an image_id

... rather than a status_t, because that's what it is.


# 84466cefd3ea62b7a18aa30002a6cfc362b3d9ba 25-Feb-2014 John Scipione <jscipione@gmail.com>

ScreenSaverRunner: check return value of methods


# d960838b5b81641f82b2b6da10606113d542731d 25-Feb-2014 John Scipione <jscipione@gmail.com>

ScreenSaverRunner: clarify some comments


# 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


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

ScreenSaverRunner: Suspend() and Resume() return status_t


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

Screen Saver: style fixes


# 4b7e219688450694efc9d1890f83f816758c16d3 03-Oct-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Remove /boot/common for good

* Remove support for the "common" installation location from packagefs,
package kit, package daemon, package managers.
* Rename the B_COMMON_*_DIRECTORY constants referring to writable
directories to B_SYSTEM_*_DIRECTORY.
* Remove/adjust the use of various B_COMMON_*_DIRECTORY constants.
I'm sure some occurrence still remain. They can be adjusted when the
remaining B_COMMON_*_DIRECTORY constants are removed.


# 91de05130520dce5d8d09447552152da06ec2c97 26-Sep-2013 John Scipione <jscipione@gmail.com>

ScreenSaver: Revert the controversial parts of hrev46012

ScreenSaver once again locks up due to the bug described in #4260
awaiting a systemic fix.


# d9acbaf0dc65137e36e15b351c4ff7a56aca55b1 02-Sep-2013 John Scipione <jscipione@gmail.com>

ScreenSaver: Timeout if window won't lock. Fixes #4260.

If we fail to lock the window in the kInitialTickRate time, quit the thread.
We were deadlocking causing #4260 because you could open several
threads by moving through the screen saver list quickly all trying to lock
the same window at the same time, classic deadlock.


# fa3651781a7d9c61eb1fb7608e5a37ea87c25d04 02-Sep-2013 John Scipione <jscipione@gmail.com>

ScreenSaverRunner: Style fixes

Also update copyright info, add myself to authors list alphabetically.


# 323b65468e5836bb27a5e373b14027d902349437 21-Nov-2011 Oliver Tappe <zooey@hirschkaefer.de>

Filtered flat import of Oliver's svn package management branch

Bring the changes that aren't package management related and the ones
that are but don't take effect as long as they are ignored by the build
system into the master.

Summary of changes:
* Introduce private header <directories.h> with constants for a good
deal of paths that should usually be retrieved via find_directory().
* Replace hard-coded paths by using find_directory() or the
<directories.h> constants (e.g. in drivers and the kernel).
* Add find_directory() constants needed for package management.
* Add __HAIKU_ABI_NAME and B_HAIKU_ABI_NAME macros.
* src/apps/deskbar: BeMenu.* -> DeskbarMenu.*,
DeskBarUtils.* -> DeskbarUtils.*
* Change deskbar menu settings directory from ~/config/be to
~/config/settings/deskbar.
* Other smaller cleanups, changes, and fixes.


# 3dfd9cb95ce45f59160d50975210bc55e3fc0709 16-Jun-2011 Oliver Tappe <zooey@hirschkaefer.de>

Flat commit of all changes from package-management branch in svn


# d159cdcf4e29fc51c8c733012924a288d8062b5e 04-Oct-2009 Ryan Leavengood <leavengood@gmail.com>

Apply patch from Caitlin Shaw to allow for smaller screensaver tick times that 50 ms.

This fixes #4628.

I added the TODO because I think this code is getting hairy.


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


# 835e354694a496eb8bd56ae219e0c83a1ea8a4c4 09-Dec-2008 Rene Gollent <anevilyak@gmail.com>

Remove unnecessary comparison.



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


# bdffbce7af2ff1016e0af243970646c7c4e0d729 09-Dec-2008 Rene Gollent <anevilyak@gmail.com>

Adjust ScreenSaverRunner to make the screen saver draw once before sleeping. This fixes the perceived black screen problem with the Message screensaver. Also cleaned up Message slightly to retrieve its string from fortune more cleanly, and readded it to the build since it will no longer deadlock the screensaver module for 30 seconds at a time.


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


# dbcdcf395040ae1d58bbe0e257eeb8f6ae227269 09-Dec-2008 Rene Gollent <anevilyak@gmail.com>

Correct slight regression from r28777 - screen saver tick size can be adjusted dynamically, and thus we must update it after each complete tick. Fixes ticket #3211.



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


# 4f07e62e339367cbb53ac41a9f0c8caf758f23cf 04-Dec-2008 Rene Gollent <anevilyak@gmail.com>

Break up the screen saver update interval into 50 msec ticks. This lets us quickly evaluate if it's time to exit the screen saver, which would previously have blocked until the tick interval was up. This fixes ticket #2339.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28777 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


# 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


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

Damn, I forgot to include this directory when committing the screen saver changes.
This should have been part of r17731. Fixes the build.


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