diff --git a/src/kits/interface/View.cpp b/src/kits/interface/View.cpp index cc5decb0cf..ab4c22ce6a 100644 --- a/src/kits/interface/View.cpp +++ b/src/kits/interface/View.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006, Haiku. + * Copyright 2001-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: @@ -843,7 +843,7 @@ BView::SetFlags(uint32 flags) if (flags & B_PULSE_NEEDED) { check_lock_no_pick(); if (fOwner->fPulseRunner == NULL) - fOwner->SetPulseRate(500000); + fOwner->SetPulseRate(fOwner->PulseRate()); } if (flags & (B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE @@ -4503,7 +4503,7 @@ BView::_Attach() if (fFlags & B_PULSE_NEEDED) { check_lock_no_pick(); if (fOwner->fPulseRunner == NULL) - fOwner->SetPulseRate(500000); + fOwner->SetPulseRate(fOwner->PulseRate()); } if (!fOwner->IsHidden()) diff --git a/src/kits/interface/Window.cpp b/src/kits/interface/Window.cpp index 0fa5f1cbc2..d74f36a744 100644 --- a/src/kits/interface/Window.cpp +++ b/src/kits/interface/Window.cpp @@ -1448,7 +1448,6 @@ void BWindow::ScreenChanged(BRect screen_size, color_space depth) { // Hook function - // does nothing } @@ -1456,7 +1455,7 @@ void BWindow::SetPulseRate(bigtime_t rate) { // TODO: What about locking?!? - if (rate < 0 || rate == fPulseRate) + if (rate < 0 || rate == fPulseRate || !(rate == 0 ^ fPulseRunner == NULL)) return; fPulseRate = rate; @@ -1480,7 +1479,6 @@ BWindow::SetPulseRate(bigtime_t rate) bigtime_t BWindow::PulseRate() const { - // TODO: What about locking?!? return fPulseRate; } @@ -2378,12 +2376,10 @@ BWindow::_InitData(BRect frame, const char* title, window_look look, AddShortcut('V', B_COMMAND_KEY, new BMessage(B_PASTE), NULL); AddShortcut('A', B_COMMAND_KEY, new BMessage(B_SELECT_ALL), NULL); - fPulseRate = 0; + // We set the default pulse rate, but we don't start the pulse + fPulseRate = 500000; fPulseRunner = NULL; - // TODO: is this correct??? should the thread loop be started??? - //SetPulseRate( 500000 ); - // TODO: see if you can use 'fViewsNeedPulse' fIsFilePanel = false;