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:
Rene Gollent
2016-01-15 20:31:26 -05:00
parent 2eb5cc49ab
commit 7a3892f439
+5 -1
View File
@@ -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.
*
* Authors:
@@ -3446,6 +3446,10 @@ BWindow::_UnpackMessage(unpack_cookie& cookie, BMessage** _message,
continue;
*_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;
cookie.index++;
return true;