Bug 1219215 - part 0: fix context menu code to take window dragging region into account, r=jimm

--HG--
extra : commitid : DiCsOzFXOc6
extra : rebase_source : 2feea836b779b237d2da9f5f2e966ed3c6c37d4b
This commit is contained in:
Gijs Kruitbosch 2016-01-18 14:30:44 +00:00
Родитель 77d52c0a79
Коммит 652ed2993f
1 изменённых файлов: 13 добавлений и 7 удалений

Просмотреть файл

@ -5228,13 +5228,19 @@ nsWindow::ProcessMessage(UINT msg, WPARAM& wParam, LPARAM& lParam,
WidgetMouseEvent::eRightButton,
MOUSE_INPUT_SOURCE());
if (lParam != -1 && !result && mCustomNonClient) {
WidgetMouseEvent event(true, eMouseHitTest, this,
WidgetMouseEvent::eReal,
WidgetMouseEvent::eNormal);
event.refPoint = LayoutDeviceIntPoint(GET_X_LPARAM(pos), GET_Y_LPARAM(pos));
event.inputSource = MOUSE_INPUT_SOURCE();
event.mFlags.mOnlyChromeDispatch = true;
if (DispatchWindowEvent(&event)) {
bool shouldShowMenu = false;
if (mDraggableRegion.Contains(GET_X_LPARAM(pos), GET_Y_LPARAM(pos))) {
shouldShowMenu = true;
} else {
WidgetMouseEvent event(true, eMouseHitTest, this,
WidgetMouseEvent::eReal,
WidgetMouseEvent::eNormal);
event.refPoint = LayoutDeviceIntPoint(GET_X_LPARAM(pos), GET_Y_LPARAM(pos));
event.inputSource = MOUSE_INPUT_SOURCE();
event.mFlags.mOnlyChromeDispatch = true;
shouldShowMenu = DispatchWindowEvent(&event);
}
if (shouldShowMenu) {
// Blank area hit, throw up the system menu.
DisplaySystemMenu(mWnd, mSizeMode, mIsRTL, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
result = true;