BLooper: Add DispatchExternalMessage()
* This is primarily a service method for ports of widget tool kits that require single-threaded GUI. DispatchExternalMessage() calls DispatchMessage(), but also sets fLastMessage, so that [Detach]CurrentMessage() work correctly. This allows to detach a message in DispatchMessage() when called from the window thread, add it to a global queue, and later process the queued messages in a different thread that calls DispatchExternalMessage(). * BLooper/BWindow: Make sure fLastMessage is accessed only when locked.
This commit is contained in:
@@ -52,6 +52,8 @@ public:
|
||||
virtual void MessageReceived(BMessage* message);
|
||||
BMessage* CurrentMessage() const;
|
||||
BMessage* DetachCurrentMessage();
|
||||
void DispatchExternalMessage(BMessage* message,
|
||||
BHandler* handler, bool& _detached);
|
||||
BMessageQueue* MessageQueue() const;
|
||||
bool IsMessageWaiting() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user