* DispatchMessage()'s B_WINDOW_ACTIVATED now checks if there are any pending
activation messages, and always retrieves the information from the latest. * Reverted r23062, as the above should fix bug #613 as well. * This should also fix bug #1674. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23196 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -874,7 +874,6 @@ BWindow::DispatchMessage(BMessage *msg, BHandler *target)
|
||||
// combine with pending resize notifications
|
||||
BMessage* pendingMessage;
|
||||
while ((pendingMessage = MessageQueue()->FindMessage(B_WINDOW_RESIZED, 0))) {
|
||||
if (pendingMessage != msg) {
|
||||
int32 nextWidth;
|
||||
if (pendingMessage->FindInt32("width", &nextWidth) == B_OK)
|
||||
width = nextWidth;
|
||||
@@ -887,9 +886,6 @@ BWindow::DispatchMessage(BMessage *msg, BHandler *target)
|
||||
delete pendingMessage;
|
||||
// this deletes the first *additional* message
|
||||
// fCurrentMessage is safe
|
||||
} else {
|
||||
MessageQueue()->RemoveMessage(pendingMessage);
|
||||
}
|
||||
}
|
||||
if (width != fFrame.Width() || height != fFrame.Height()) {
|
||||
// NOTE: we might have already handled the resize
|
||||
@@ -932,10 +928,32 @@ FrameMoved(origin);
|
||||
}
|
||||
|
||||
case B_WINDOW_ACTIVATED:
|
||||
if (target == this) {
|
||||
if (target != this) {
|
||||
target->MessageReceived(msg);
|
||||
break;
|
||||
}
|
||||
|
||||
bool active;
|
||||
if (msg->FindBool("active", &active) == B_OK
|
||||
&& active != fActive) {
|
||||
if (msg->FindBool("active", &active) != B_OK)
|
||||
break;
|
||||
|
||||
// find latest activation message
|
||||
|
||||
while (true) {
|
||||
BMessage* pendingMessage = MessageQueue()->FindMessage(
|
||||
B_WINDOW_RESIZED, 0);
|
||||
if (pendingMessage == NULL)
|
||||
break;
|
||||
|
||||
bool nextActive;
|
||||
if (pendingMessage->FindBool("active", &nextActive) == B_OK)
|
||||
active = nextActive;
|
||||
|
||||
MessageQueue()->RemoveMessage(pendingMessage);
|
||||
delete pendingMessage;
|
||||
}
|
||||
|
||||
if (active != fActive) {
|
||||
fActive = active;
|
||||
|
||||
WindowActivated(active);
|
||||
@@ -957,8 +975,6 @@ FrameMoved(origin);
|
||||
msg.AddMessenger("view", messenger);
|
||||
_control_input_server_(&msg, &reply);
|
||||
}
|
||||
} else
|
||||
target->MessageReceived(msg);
|
||||
break;
|
||||
|
||||
case B_SCREEN_CHANGED:
|
||||
@@ -1686,8 +1702,7 @@ BWindow::UpdateIfNeeded()
|
||||
|
||||
BMessage *msg;
|
||||
for (int32 i = 0; (msg = queue->FindMessage(i)) != NULL; i++) {
|
||||
// TODO: Dispatch more messages ?!?!? Check what beos does.
|
||||
if (msg->what == _UPDATE_ || msg->what == B_WINDOW_ACTIVATED) {
|
||||
if (msg->what == _UPDATE_) {
|
||||
BWindow::DispatchMessage(msg, this);
|
||||
// we need to make sure that no overridden method is called
|
||||
// here; for BWindow::DispatchMessage() we now exactly what
|
||||
|
||||
Reference in New Issue
Block a user