From a8ae893bc3a0bc2fedf8ef564c3bdf88739b9ad1 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Sat, 29 Apr 2017 15:09:05 -0400 Subject: [PATCH] Tracker: Fix B_UNDO/B_REDO forwarding to a focused BTextView. --- src/kits/tracker/ContainerWindow.cpp | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/src/kits/tracker/ContainerWindow.cpp b/src/kits/tracker/ContainerWindow.cpp index cafc808e4b..11c8d488bb 100644 --- a/src/kits/tracker/ContainerWindow.cpp +++ b/src/kits/tracker/ContainerWindow.cpp @@ -1399,6 +1399,26 @@ BContainerWindow::MessageReceived(BMessage* message) break; } + case B_UNDO: { + BView* view = CurrentFocus(); + if (dynamic_cast(view) == NULL) { + FSUndo(); + } else { + view->MessageReceived(message); + } + break; + } + + case B_REDO: { + BView* view = CurrentFocus(); + if (dynamic_cast(view) == NULL) { + FSRedo(); + } else { + view->MessageReceived(message); + } + break; + } + case kNewFolder: PostMessage(message, PoseView()); break; @@ -1690,14 +1710,6 @@ BContainerWindow::MessageReceived(BMessage* message) UpdateTitle(); break; - case B_UNDO: - FSUndo(); - break; - - case B_REDO: - FSRedo(); - break; - default: _inherited::MessageReceived(message); break;