Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit 9c338d8

Browse files
authored
Fixes full screen exit issues (#3220)
1 parent 95c72d4 commit 9c338d8

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/NavigationBarWidget.java

+11-5
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,15 @@ private void initialize(@NonNull Context aContext) {
152152

153153
mNavigationListeners = new ArrayList<>();
154154

155-
mFullScreenBackHandler = this::exitFullScreenMode;
155+
mFullScreenBackHandler = () -> {
156+
if (mAttachedWindow != null) {
157+
mAttachedWindow.setIsFullScreen(false);
158+
}
159+
};
156160
mVRVideoBackHandler = () -> {
157161
exitVRVideo();
158-
if (mViewModel.getAutoEnteredVRVideo().getValue().get()) {
159-
exitFullScreenMode();
162+
if (mAttachedWindow != null) {
163+
mAttachedWindow.setIsFullScreen(false);
160164
}
161165
};
162166

@@ -278,7 +282,9 @@ private void updateUI() {
278282

279283
mBinding.navigationBarFullscreen.fullScreenExitButton.setOnClickListener(view -> {
280284
view.requestFocusFromTouch();
281-
exitFullScreenMode();
285+
if (mAttachedWindow != null) {
286+
mAttachedWindow.setIsFullScreen(false);
287+
}
282288
if (mAudio != null) {
283289
mAudio.playSound(AudioEngine.Sound.CLICK);
284290
}
@@ -601,7 +607,7 @@ private void enterFullScreenMode() {
601607
}
602608

603609
private void exitFullScreenMode() {
604-
if (mAttachedWindow == null || !mViewModel.getIsFullscreen().getValue().get()) {
610+
if (mAttachedWindow == null) {
605611
return;
606612
}
607613

0 commit comments

Comments
 (0)