Tracker: Replace custom LooperAutoLocker with AutoLocker<BLooper>.
This commit is contained in:
@@ -2023,7 +2023,7 @@ PositionPassingMenuItem::Invoke(BMessage* message)
|
|||||||
// use the window position only, if the item was invoked from the menu
|
// use the window position only, if the item was invoked from the menu
|
||||||
// menu->Window() points to the window the item was invoked from
|
// menu->Window() points to the window the item was invoked from
|
||||||
if (dynamic_cast<BContainerWindow*>(menu->Window()) == NULL) {
|
if (dynamic_cast<BContainerWindow*>(menu->Window()) == NULL) {
|
||||||
LooperAutoLocker lock(menu);
|
AutoLocker<BLooper> lock(menu->Looper());
|
||||||
if (lock.IsLocked()) {
|
if (lock.IsLocked()) {
|
||||||
BPoint invokeOrigin(menu->Window()->Frame().LeftTop());
|
BPoint invokeOrigin(menu->Window()->Frame().LeftTop());
|
||||||
clone.AddPoint("be:invoke_origin", invokeOrigin);
|
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 {
|
class ShortcutFilter : public BMessageFilter {
|
||||||
public:
|
public:
|
||||||
ShortcutFilter(uint32 shortcutKey, uint32 shortcutModifier,
|
ShortcutFilter(uint32 shortcutKey, uint32 shortcutModifier,
|
||||||
|
|||||||
Reference in New Issue
Block a user