Turns out our pulse mechanism was broken; we need to honour the rate set by

SetPulseRate() even if it is 0. BView::_Attach() and BView::SetFlags() now
just set the previous pulse rate again (which will start pulsing in case
there is no fPulseRunner yet).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19850 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2007-01-17 21:26:54 +00:00
parent 2a720453e1
commit 6c3692dc87
2 changed files with 6 additions and 10 deletions
+3 -3
View File
@@ -1,5 +1,5 @@
/* /*
* Copyright 2001-2006, Haiku. * Copyright 2001-2007, Haiku.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
@@ -843,7 +843,7 @@ BView::SetFlags(uint32 flags)
if (flags & B_PULSE_NEEDED) { if (flags & B_PULSE_NEEDED) {
check_lock_no_pick(); check_lock_no_pick();
if (fOwner->fPulseRunner == NULL) if (fOwner->fPulseRunner == NULL)
fOwner->SetPulseRate(500000); fOwner->SetPulseRate(fOwner->PulseRate());
} }
if (flags & (B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE if (flags & (B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE
@@ -4503,7 +4503,7 @@ BView::_Attach()
if (fFlags & B_PULSE_NEEDED) { if (fFlags & B_PULSE_NEEDED) {
check_lock_no_pick(); check_lock_no_pick();
if (fOwner->fPulseRunner == NULL) if (fOwner->fPulseRunner == NULL)
fOwner->SetPulseRate(500000); fOwner->SetPulseRate(fOwner->PulseRate());
} }
if (!fOwner->IsHidden()) if (!fOwner->IsHidden())
+3 -7
View File
@@ -1448,7 +1448,6 @@ void
BWindow::ScreenChanged(BRect screen_size, color_space depth) BWindow::ScreenChanged(BRect screen_size, color_space depth)
{ {
// Hook function // Hook function
// does nothing
} }
@@ -1456,7 +1455,7 @@ void
BWindow::SetPulseRate(bigtime_t rate) BWindow::SetPulseRate(bigtime_t rate)
{ {
// TODO: What about locking?!? // TODO: What about locking?!?
if (rate < 0 || rate == fPulseRate) if (rate < 0 || rate == fPulseRate || !(rate == 0 ^ fPulseRunner == NULL))
return; return;
fPulseRate = rate; fPulseRate = rate;
@@ -1480,7 +1479,6 @@ BWindow::SetPulseRate(bigtime_t rate)
bigtime_t bigtime_t
BWindow::PulseRate() const BWindow::PulseRate() const
{ {
// TODO: What about locking?!?
return fPulseRate; 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('V', B_COMMAND_KEY, new BMessage(B_PASTE), NULL);
AddShortcut('A', B_COMMAND_KEY, new BMessage(B_SELECT_ALL), 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; fPulseRunner = NULL;
// TODO: is this correct??? should the thread loop be started???
//SetPulseRate( 500000 );
// TODO: see if you can use 'fViewsNeedPulse' // TODO: see if you can use 'fViewsNeedPulse'
fIsFilePanel = false; fIsFilePanel = false;