зеркало из https://github.com/mozilla/pjs.git
Actually set the modifier keys before dispatching d&d event into gecko. r=bienvenu, bug#47195
This commit is contained in:
Родитель
83e282cb9c
Коммит
d93bedaa03
|
@ -49,6 +49,9 @@ static NS_DEFINE_IID(kIDragServiceIID, NS_IDRAGSERVICE_IID);
|
|||
// This is cached for Leave notification
|
||||
static POINTL gDragLastPoint;
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* class nsNativeDragTarget
|
||||
*/
|
||||
|
@ -149,6 +152,16 @@ void nsNativeDragTarget::GetGeckoDragAction(DWORD grfKeyState, LPDWORD pdwEffect
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
PRBool IsKeyDown ( char key ) ;
|
||||
|
||||
inline
|
||||
PRBool IsKeyDown ( char key )
|
||||
{
|
||||
return GetKeyState(key) & 0x80 ? PR_TRUE : PR_FALSE;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------
|
||||
void nsNativeDragTarget::DispatchDragDropEvent(PRUint32 aEventType,
|
||||
POINTL aPT)
|
||||
|
@ -159,7 +172,6 @@ void nsNativeDragTarget::DispatchDragDropEvent(PRUint32 aEventType,
|
|||
|
||||
nsWindow * win = NS_STATIC_CAST(nsWindow *, mWindow);
|
||||
win->InitEvent(event, aEventType);
|
||||
|
||||
POINT cpos;
|
||||
|
||||
cpos.x = aPT.x;
|
||||
|
@ -174,6 +186,11 @@ void nsNativeDragTarget::DispatchDragDropEvent(PRUint32 aEventType,
|
|||
event.point.y = 0;
|
||||
}
|
||||
|
||||
event.isShift = IsKeyDown(NS_VK_SHIFT);
|
||||
event.isControl = IsKeyDown(NS_VK_CONTROL);
|
||||
event.isMeta = PR_FALSE;
|
||||
event.isAlt = IsKeyDown(NS_VK_ALT);
|
||||
|
||||
mWindow->DispatchEvent(&event, status);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче