This repository was archived by the owner on Jul 22, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
app/src/common/shared/org/mozilla/vrbrowser/ui/widgets Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -381,19 +381,19 @@ public void updateFocusedView(View aFocusedView) {
381381 }
382382
383383 public void dismiss () {
384- exitVoiceInputMode ();
385- if (mFocusedView != null && mFocusedView != mAttachedWindow ) {
386- mFocusedView .clearFocus ();
387- }
388- mWidgetPlacement .visible = false ;
389- mWidgetManager .updateWidget (this );
390-
391- mWidgetManager .popBackHandler (mBackHandler );
392-
393- mIsCapsLock = false ;
394- mIsLongPress = false ;
395- handleShift (false );
396- hideOverlays ();
384+ exitVoiceInputMode ();
385+ if (mFocusedView != null && mFocusedView != mAttachedWindow ) {
386+ mFocusedView .clearFocus ();
387+ }
388+ mWidgetPlacement .visible = false ;
389+ mWidgetManager .updateWidget (this );
390+
391+ mWidgetManager .popBackHandler (mBackHandler );
392+
393+ mIsCapsLock = false ;
394+ mIsLongPress = false ;
395+ handleShift (false );
396+ hideOverlays ();
397397 }
398398
399399 public void proxifyLayerIfNeeded (ArrayList <WindowWidget > aWindows ) {
@@ -1023,8 +1023,12 @@ public boolean dispatchKeyEvent(final KeyEvent event) {
10231023 final InputConnection connection = mInputConnection ;
10241024 if (connection != null ) {
10251025 if (isAttachToWindowWidget ()) {
1026- connection .sendKeyEvent (event );
1027- hide (UIWidget .KEEP_WIDGET );
1026+ if (event .getKeyCode () == KeyEvent .KEYCODE_BACK ) {
1027+ return false ;
1028+ } else {
1029+ connection .sendKeyEvent (event );
1030+ hide (UIWidget .KEEP_WIDGET );
1031+ }
10281032 return true ;
10291033 }
10301034 // Android Components do not support InputConnection.sendKeyEvent()
Original file line number Diff line number Diff line change @@ -1806,10 +1806,13 @@ public void onAction(String action) {
18061806
18071807 @ Override
18081808 public void onDismiss () {
1809- hideContextMenus ();
18101809 if (aSelection .isActionAvailable (GeckoSession .SelectionActionDelegate .ACTION_UNSELECT )) {
18111810 aSelection .execute (GeckoSession .SelectionActionDelegate .ACTION_UNSELECT );
1811+ } else {
1812+ aSelection .collapseToEnd ();
18121813 }
1814+
1815+ aSelection .hide ();
18131816 }
18141817 });
18151818 mSelectionMenu .show (KEEP_FOCUS );
You can’t perform that action at this time.
0 commit comments