From 8ade0bf99a383f83d53adbddbeae0d98f4f71bae Mon Sep 17 00:00:00 2001
From: Kacper Kasper <kacperkasper@gmail.com>
Date: Mon, 28 Apr 2014 15:17:02 +0000
Subject: [PATCH] Fix for my previous patch
* Default button shouldn't be invoked only when another button
is focused.
Sorry about the fuss.
---
src/kits/interface/Window.cpp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/kits/interface/Window.cpp b/src/kits/interface/Window.cpp
index f315dac..f26708b 100644
a
|
b
|
|
28 | 28 | #include <MessageQueue.h> |
29 | 29 | #include <MessageRunner.h> |
30 | 30 | #include <Path.h> |
| 31 | #include <PictureButton.h> |
31 | 32 | #include <PropertyInfo.h> |
32 | 33 | #include <Roster.h> |
33 | 34 | #include <Screen.h> |
… |
… |
BWindow::_DetermineTarget(BMessage* message, BHandler* target)
|
3288 | 3289 | { |
3289 | 3290 | // if we have a default button, it might want to hear |
3290 | 3291 | // about pressing the <enter> key, but it shouldn't |
3291 | | // intercept it if another BControl is focused |
| 3292 | // intercept it if another B*Button is focused |
3292 | 3293 | int32 rawChar; |
3293 | 3294 | if (DefaultButton() != NULL |
3294 | | && dynamic_cast<BControl*>(CurrentFocus()) == NULL |
| 3295 | && dynamic_cast<BButton*>(CurrentFocus()) == NULL |
| 3296 | && dynamic_cast<BPictureButton*>(CurrentFocus()) == NULL |
3295 | 3297 | && message->FindInt32("raw_char", &rawChar) == B_OK |
3296 | 3298 | && rawChar == B_ENTER) |
3297 | 3299 | return DefaultButton(); |