summaryrefslogtreecommitdiff
path: root/layout/forms
diff options
context:
space:
mode:
authorBrian Smith <brian@dbsoft.org>2022-04-26 10:20:30 -0500
committerBrian Smith <brian@dbsoft.org>2022-04-26 10:21:29 -0500
commite764f258e2530aa172102ff091ef205cc9bd5154 (patch)
tree57ce2c4d44b1500e51a48e6d793342e3cd295f4f /layout/forms
parent3daf711085889bad1bd68651bc4e8790412ae105 (diff)
downloaduxp-e764f258e2530aa172102ff091ef205cc9bd5154.tar.gz
Issue #1829 - Revert "Issue #1751 -- Remove XP_MACOSX conditionals from /layout"
This reverts commit aa0fd3d68c856504646e1d7eb499bc890ef44101.
Diffstat (limited to 'layout/forms')
-rw-r--r--layout/forms/nsListControlFrame.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/layout/forms/nsListControlFrame.cpp b/layout/forms/nsListControlFrame.cpp
index 50e05776ef..5e157b7842 100644
--- a/layout/forms/nsListControlFrame.cpp
+++ b/layout/forms/nsListControlFrame.cpp
@@ -834,7 +834,11 @@ nsListControlFrame::HandleListSelection(nsIDOMEvent* aEvent,
nsCOMPtr<nsIDOMMouseEvent> mouseEvent = do_QueryInterface(aEvent);
bool isShift;
bool isControl;
+#ifdef XP_MACOSX
+ mouseEvent->GetMetaKey(&isControl);
+#else
mouseEvent->GetCtrlKey(&isControl);
+#endif
mouseEvent->GetShiftKey(&isShift);
return PerformSelection(aClickedIndex, isShift, isControl); // might destroy us
}
@@ -1904,7 +1908,11 @@ nsListControlFrame::DragMove(nsIDOMEvent* aMouseEvent)
nsCOMPtr<nsIDOMMouseEvent> mouseEvent = do_QueryInterface(aMouseEvent);
NS_ASSERTION(mouseEvent, "aMouseEvent is not an nsIDOMMouseEvent!");
bool isControl;
+#ifdef XP_MACOSX
+ mouseEvent->GetMetaKey(&isControl);
+#else
mouseEvent->GetCtrlKey(&isControl);
+#endif
nsWeakFrame weakFrame(this);
// Turn SHIFT on when you are dragging, unless control is on.
bool wasChanged = PerformSelection(selectedIndex,
@@ -2112,8 +2120,14 @@ nsListControlFrame::KeyDown(nsIDOMEvent* aKeyEvent)
bool dropDownMenuOnUpDown;
bool dropDownMenuOnSpace;
+#ifdef XP_MACOSX
+ dropDownMenuOnUpDown = IsInDropDownMode() && !mComboboxFrame->IsDroppedDown();
+ dropDownMenuOnSpace = !keyEvent->IsAlt() && !keyEvent->IsControl() &&
+ !keyEvent->IsMeta();
+#else
dropDownMenuOnUpDown = keyEvent->IsAlt();
dropDownMenuOnSpace = IsInDropDownMode() && !mComboboxFrame->IsDroppedDown();
+#endif
bool withinIncrementalSearchTime =
keyEvent->mTime - gLastKeyTime <= INCREMENTAL_SEARCH_KEYPRESS_TIME;
if ((dropDownMenuOnUpDown &&