diff --git a/headers/os/interface/Window.h b/headers/os/interface/Window.h index 50841fef2c..92e40b4881 100644 --- a/headers/os/interface/Window.h +++ b/headers/os/interface/Window.h @@ -185,6 +185,7 @@ public: void EndViewTransaction(); // referred as CommitViewTransaction() // in BeBook + bool InViewTransaction() const; BRect Bounds() const; BRect Frame() const; diff --git a/src/kits/interface/ListView.cpp b/src/kits/interface/ListView.cpp index 57c89fe2b1..faa653e7d3 100644 --- a/src/kits/interface/ListView.cpp +++ b/src/kits/interface/ListView.cpp @@ -655,10 +655,9 @@ void BListView::SetFont(const BFont* font, uint32 mask) { BView::SetFont(font, mask); - //_FontChanged(); - // TODO: this absolutely kills the performance, if a BListItem - // changes the font when drawing - if this should be called at all, - // it should only be done outside any updates! + + if (Window() != NULL && !Window()->InViewTransaction()) + _FontChanged(); } diff --git a/src/kits/interface/Window.cpp b/src/kits/interface/Window.cpp index 323c3e5452..999a146fb2 100644 --- a/src/kits/interface/Window.cpp +++ b/src/kits/interface/Window.cpp @@ -682,6 +682,14 @@ BWindow::EndViewTransaction() } +bool +BWindow::InViewTransaction() const +{ + BAutolock locker(const_cast(this)); + return fInTransaction; +} + + bool BWindow::IsFront() const {