mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-20 06:07:30 +09:00
parent
470a6e4401
commit
13fcc4a046
949 changed files with 95662 additions and 444 deletions
|
|
@ -712,6 +712,21 @@ nsXULPopupManager::ShowMenu(nsIContent *aMenu,
|
|||
|
||||
nsAutoString position;
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
nsCOMPtr<nsIDOMXULMenuListElement> menulist = do_QueryInterface(aMenu);
|
||||
bool isNonEditableMenulist = false;
|
||||
if (menulist) {
|
||||
bool editable;
|
||||
menulist->GetEditable(&editable);
|
||||
isNonEditableMenulist = !editable;
|
||||
}
|
||||
|
||||
if (isNonEditableMenulist) {
|
||||
position.AssignLiteral("selection");
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
||||
if (onMenuBar || !onmenu)
|
||||
position.AssignLiteral("after_start");
|
||||
else
|
||||
|
|
@ -1799,6 +1814,15 @@ nsXULPopupManager::MayShowPopup(nsMenuPopupFrame* aPopup)
|
|||
return false;
|
||||
}
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
if (rootWin) {
|
||||
auto globalWin = nsGlobalWindow::Cast(rootWin.get());
|
||||
if (globalWin->IsInModalState()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// cannot open a popup that is a submenu of a menupopup that isn't open.
|
||||
nsMenuFrame* menuFrame = do_QueryFrame(aPopup->GetParent());
|
||||
if (menuFrame) {
|
||||
|
|
@ -2304,6 +2328,7 @@ nsXULPopupManager::HandleKeyboardEventWithKeyCode(
|
|||
switch (keyCode) {
|
||||
case nsIDOMKeyEvent::DOM_VK_UP:
|
||||
case nsIDOMKeyEvent::DOM_VK_DOWN:
|
||||
#ifndef XP_MACOSX
|
||||
// roll up the popup when alt+up/down are pressed within a menulist.
|
||||
bool alt;
|
||||
aKeyEvent->GetAltKey(&alt);
|
||||
|
|
@ -2312,6 +2337,7 @@ nsXULPopupManager::HandleKeyboardEventWithKeyCode(
|
|||
break;
|
||||
}
|
||||
MOZ_FALLTHROUGH;
|
||||
#endif
|
||||
|
||||
case nsIDOMKeyEvent::DOM_VK_LEFT:
|
||||
case nsIDOMKeyEvent::DOM_VK_RIGHT:
|
||||
|
|
@ -2340,7 +2366,9 @@ nsXULPopupManager::HandleKeyboardEventWithKeyCode(
|
|||
break;
|
||||
|
||||
case nsIDOMKeyEvent::DOM_VK_TAB:
|
||||
#ifndef XP_MACOSX
|
||||
case nsIDOMKeyEvent::DOM_VK_F10:
|
||||
#endif
|
||||
if (aTopVisibleMenuItem &&
|
||||
!aTopVisibleMenuItem->Frame()->GetContent()->AttrValueIs(kNameSpaceID_None,
|
||||
nsGkAtoms::activateontab, nsGkAtoms::_true, eCaseMatters)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue