зеркало из https://github.com/mozilla/gecko-dev.git
Bug 891316 part.2 Use widget::MSGResult in widget::WindowHook r=jimm
This commit is contained in:
Родитель
f50359d44b
Коммит
1320d65578
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include "WindowHook.h"
|
||||
#include "nsWindow.h"
|
||||
#include "nsWindowDefs.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace widget {
|
||||
|
@ -99,17 +100,20 @@ WindowHook::DeleteIfEmpty(MessageData *data) {
|
|||
|
||||
bool
|
||||
WindowHook::Notify(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam,
|
||||
LRESULT *aResult) {
|
||||
MSGResult& aResult)
|
||||
{
|
||||
MessageData *data = Lookup(nMsg);
|
||||
if (!data)
|
||||
return false;
|
||||
|
||||
uint32_t length = data->monitors.Length();
|
||||
for (uint32_t midx = 0; midx < length; midx++) {
|
||||
data->monitors[midx].Invoke(hWnd, nMsg, wParam, lParam, aResult);
|
||||
data->monitors[midx].Invoke(hWnd, nMsg, wParam, lParam, &aResult.mResult);
|
||||
}
|
||||
|
||||
return data->hook.Invoke(hWnd, nMsg, wParam, lParam, aResult);
|
||||
aResult.mConsumed =
|
||||
data->hook.Invoke(hWnd, nMsg, wParam, lParam, &aResult.mResult);
|
||||
return aResult.mConsumed;
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
@ -20,6 +20,8 @@ class nsWindow;
|
|||
namespace mozilla {
|
||||
namespace widget {
|
||||
|
||||
struct MSGResult;
|
||||
|
||||
class WindowHook {
|
||||
public:
|
||||
|
||||
|
@ -60,7 +62,7 @@ private:
|
|||
};
|
||||
|
||||
bool Notify(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam,
|
||||
LRESULT *aResult);
|
||||
MSGResult& aResult);
|
||||
|
||||
MessageData *Lookup(UINT nMsg);
|
||||
MessageData *LookupOrCreate(UINT nMsg);
|
||||
|
|
|
@ -651,8 +651,8 @@ NS_METHOD nsWindow::Destroy()
|
|||
// Our windows can be subclassed which may prevent us receiving WM_DESTROY. If OnDestroy()
|
||||
// didn't get called, call it now.
|
||||
if (false == mOnDestroyCalled) {
|
||||
LRESULT result;
|
||||
mWindowHook.Notify(mWnd, WM_DESTROY, 0, 0, &result);
|
||||
MSGResult msgResult;
|
||||
mWindowHook.Notify(mWnd, WM_DESTROY, 0, 0, msgResult);
|
||||
OnDestroy();
|
||||
}
|
||||
|
||||
|
@ -4428,7 +4428,7 @@ nsWindow::ExternalHandlerProcessMessage(UINT aMessage,
|
|||
LPARAM& aLParam,
|
||||
MSGResult& aResult)
|
||||
{
|
||||
if (mWindowHook.Notify(mWnd, aMessage, aWParam, aLParam, &aResult.mResult)) {
|
||||
if (mWindowHook.Notify(mWnd, aMessage, aWParam, aLParam, aResult)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче