Tracker: If a BTextView is focused, do not force-forward clipboard events to it.
In its original state this code just forwarded all clipboard messages to the focused view, which sometimes was a BTextView or the like which knows nothing about Tracker's custom clipboard events, and thus would wind up in an infinite loop. Now, the messages are left to be handled by the focused view if a BTextView is selected (e.g. in a file panel, or in Tracker's navigator), but otherwise forwarded directly to the BPoseView. Fixes #12721.
This commit is contained in:
parent
0d3051a20b
commit
56f9e8b759
@ -1378,9 +1378,23 @@ BContainerWindow::MessageReceived(BMessage* message)
|
||||
case kPasteLinksFromClipboard:
|
||||
{
|
||||
BView* view = CurrentFocus();
|
||||
if (view->LockLooper()) {
|
||||
view->MessageReceived(message);
|
||||
view->UnlockLooper();
|
||||
if (dynamic_cast<BTextView*>(view) == NULL) {
|
||||
// The selected item is not a BTextView, so forward the
|
||||
// message to the PoseView.
|
||||
if (fPoseView != NULL)
|
||||
fPoseView->MessageReceived(message);
|
||||
} else {
|
||||
// Since we catch the generic clipboard shortcuts in a way that
|
||||
// means the BTextView will never get them, we must
|
||||
// manually forward them ourselves.
|
||||
//
|
||||
// However, we have to take care to not forward the custom
|
||||
// clipboard messages, else we would wind up in infinite
|
||||
// recursion.
|
||||
if (message->what == B_CUT || message->what == B_COPY
|
||||
|| message->what == B_PASTE) {
|
||||
view->MessageReceived(message);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user