From 54354618d524f684e979966b7e5f72db13985bad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 11 Jan 2006 22:30:41 +0000 Subject: [PATCH] BWindow::_DetermineTarget() now defaults to the window, instead of no target at all in case the window doesn't have a current focus view. That allows shortcuts like Command+q/w to work again. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15920 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/Window.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/kits/interface/Window.cpp b/src/kits/interface/Window.cpp index 89b3613565..96792fe9e5 100644 --- a/src/kits/interface/Window.cpp +++ b/src/kits/interface/Window.cpp @@ -2501,6 +2501,9 @@ BWindow::_SetFocus(BView *focusView, bool notifyInputServer) BHandler * BWindow::_DetermineTarget(BMessage *message, BHandler *target) { + if (target == NULL) + target = this; + switch (message->what) { case B_KEY_DOWN: case B_KEY_UP: @@ -2519,7 +2522,9 @@ BWindow::_DetermineTarget(BMessage *message, BHandler *target) case B_UNMAPPED_KEY_UP: case B_MODIFIERS_CHANGED: // these messages should be dispatched by the focus view - return CurrentFocus(); + if (CurrentFocus() != NULL) + return CurrentFocus(); + break; case B_MOUSE_DOWN: case B_MOUSE_UP: @@ -2735,6 +2740,7 @@ BWindow::_HandleKeyDown(char key, uint32 modifiers) if ((modifiers & B_COMMAND_KEY) != 0) { // Command+q has been pressed, so, we will quit // the shortcut mechanism doesn't allow handlers outside the window + // TODO: in BeOS, this shortcut can be removed! if (key == 'Q' || key == 'q') { be_app->PostMessage(B_QUIT_REQUESTED); return true;