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
This commit is contained in:
parent
dbcdcf3950
commit
bdffbce7af
@ -130,7 +130,7 @@ BEOS_ADD_ONS_PRINT = Canon\ LIPS3\ Compatible Canon\ LIPS4\ Compatible
|
||||
BEOS_ADD_ONS_PRINT_TRANSPORT = HP\ JetDirect IPP LPR Parallel\ Port
|
||||
Print\ To\ File Serial\ Port USB\ Port
|
||||
;
|
||||
BEOS_ADD_ONS_SCREENSAVERS = Haiku IFS Spider ;
|
||||
BEOS_ADD_ONS_SCREENSAVERS = Haiku IFS Spider Welcome ;
|
||||
BEOS_ADD_ONS_DRIVERS_AUDIO = auich auvia echo3g emuxki ; #hda
|
||||
BEOS_ADD_ONS_DRIVERS_AUDIO_OLD = ; #cmedia sis7018 usb_audio ;
|
||||
BEOS_ADD_ONS_DRIVERS_GRAPHICS = $(X86_ONLY)radeon $(X86_ONLY)nvidia
|
||||
|
@ -21,17 +21,14 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
// Double brackets to satisfy a compiler warning
|
||||
const pattern kCheckered = { { 0xcc, 0xcc, 0x33, 0x33, 0xcc, 0xcc, 0x33, 0x33 } };
|
||||
|
||||
|
||||
// Get a clever message from fortune
|
||||
BString *get_message()
|
||||
{
|
||||
BString *result = new BString();
|
||||
system("fortune > /tmp/fortune_msg");
|
||||
FILE *file = fopen("/tmp/fortune_msg", "r");
|
||||
FILE *file = popen("/bin/fortune", "r");
|
||||
if (file) {
|
||||
char buf[512];
|
||||
int bytesRead;
|
||||
@ -41,7 +38,6 @@ BString *get_message()
|
||||
}
|
||||
fclose(file);
|
||||
}
|
||||
remove("/tmp/fortune_msg");
|
||||
|
||||
// Just in case
|
||||
if (result->Length() <= 0) {
|
||||
|
@ -183,7 +183,7 @@ ScreenSaverRunner::_Run()
|
||||
|
||||
int32 snoozeCount = 0;
|
||||
int32 frame = 0;
|
||||
bigtime_t lastTickTime = system_time();
|
||||
bigtime_t lastTickTime = -1;
|
||||
bigtime_t tick = fSaver ? fSaver->TickSize() : kTickBase;
|
||||
|
||||
while (!fQuitting) {
|
||||
@ -193,7 +193,7 @@ ScreenSaverRunner::_Run()
|
||||
// will result in the screen saver not responding to deactivation
|
||||
// for that length of time
|
||||
snooze(kTickBase);
|
||||
if (system_time() - lastTickTime < tick)
|
||||
if (lastTickTime > 0 && system_time() - lastTickTime < tick)
|
||||
continue;
|
||||
else {
|
||||
// re-evaluate the tick time after each successful wakeup -
|
||||
|
Loading…
Reference in New Issue
Block a user