Tracker: Replace custom LooperAutoLocker with AutoLocker<BLooper>.

This commit is contained in:
Augustin Cavalier 2022-04-25 20:51:41 -04:00
parent a43a4e9fbf
commit c6b6adc407
2 changed files with 1 additions and 31 deletions

View File

@ -2023,7 +2023,7 @@ PositionPassingMenuItem::Invoke(BMessage* message)
// use the window position only, if the item was invoked from the menu
// menu->Window() points to the window the item was invoked from
if (dynamic_cast<BContainerWindow*>(menu->Window()) == NULL) {
LooperAutoLocker lock(menu);
AutoLocker<BLooper> lock(menu->Looper());
if (lock.IsLocked()) {
BPoint invokeOrigin(menu->Window()->Frame().LeftTop());
clone.AddPoint("be:invoke_origin", invokeOrigin);

View File

@ -348,36 +348,6 @@ private:
};
class LooperAutoLocker {
public:
LooperAutoLocker(BHandler* handler)
: fHandler(handler),
fHasLock(handler->LockLooper())
{
}
~LooperAutoLocker()
{
if (fHasLock)
fHandler->UnlockLooper();
}
bool operator!() const
{
return !fHasLock;
}
bool IsLocked() const
{
return fHasLock;
}
private:
BHandler* fHandler;
bool fHasLock;
};
class ShortcutFilter : public BMessageFilter {
public:
ShortcutFilter(uint32 shortcutKey, uint32 shortcutModifier,