BWindow: Fix keyboard handling bug.
- In the case of certain messages that are dispatched from the app_server with multiple target tokens (i.e. due to an attached view that has a mouse or keyboard event mask set), we need to strip the focus flag from the message before passing it to the non-focus views. Fixes a bug observed via Clipdinger where the aforementioned circumstance would result in all keyboard shortcuts being invoked multiple times.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2001-2015 Haiku, Inc. All rights reserved
|
* Copyright 2001-2016 Haiku, Inc. All rights reserved
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -3446,6 +3446,10 @@ BWindow::_UnpackMessage(unpack_cookie& cookie, BMessage** _message,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
*_message = new BMessage(*cookie.message);
|
*_message = new BMessage(*cookie.message);
|
||||||
|
// the secondary copies of the message should not be treated as focus
|
||||||
|
// messages, otherwise there will be unintended side effects, i.e.
|
||||||
|
// keyboard shortcuts getting processed multiple times.
|
||||||
|
(*_message)->RemoveName("_feed_focus");
|
||||||
*_target = target;
|
*_target = target;
|
||||||
cookie.index++;
|
cookie.index++;
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user