Tracker: Replace custom LooperAutoLocker with AutoLocker<BLooper>.
This commit is contained in:
parent
a43a4e9fbf
commit
c6b6adc407
@ -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);
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user