From 0f819a71ab2818d55e72968eea638f08fcb673f9 Mon Sep 17 00:00:00 2001
From: John Scipione <jscipione@gmail.com>
Date: Mon, 4 Nov 2013 16:14:28 -0500
Subject: [PATCH] Remove queued messages on escape
---
src/apps/webpositive/BrowserWindow.cpp | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/apps/webpositive/BrowserWindow.cpp b/src/apps/webpositive/BrowserWindow.cpp
index 109056a..32ed092 100644
a
|
b
|
|
53 | 53 | #include <ObjectList.h> |
54 | 54 | #include <MenuBar.h> |
55 | 55 | #include <MenuItem.h> |
| 56 | #include <MessageQueue.h> |
56 | 57 | #include <MessageRunner.h> |
57 | 58 | #include <NodeInfo.h> |
58 | 59 | #include <Path.h> |
… |
… |
BrowserWindow::DispatchMessage(BMessage* message, BHandler* target)
|
692 | 693 | return; |
693 | 694 | } else if (bytes[0] == B_ESCAPE) { |
694 | 695 | _InvokeButtonVisibly(fFindCloseButton); |
| 696 | // Remove any queued messages |
| 697 | BMessageQueue queue; |
| 698 | BMessage* msg; |
| 699 | while ((msg = queue.FindMessage(B_KEY_DOWN, 0)) != NULL) { |
| 700 | queue.RemoveMessage(msg); |
| 701 | delete msg; |
| 702 | } |
| 703 | while ((msg = queue.FindMessage(B_UNMAPPED_KEY_DOWN, 0)) != NULL) { |
| 704 | queue.RemoveMessage(msg); |
| 705 | delete msg; |
| 706 | } |
695 | 707 | return; |
696 | 708 | } |
697 | 709 | } else if (bytes[0] == B_ESCAPE) { |