Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,7 @@ void pauseGeckoViewCompositor() {
return;
}
mIsPresentingImmersive = true;
mWindows.enterImmersiveMode();
TelemetryWrapper.startImmersive();
PauseCompositorRunnable runnable = new PauseCompositorRunnable();

Expand All @@ -821,6 +822,7 @@ void resumeGeckoViewCompositor() {
return;
}
mIsPresentingImmersive = false;
mWindows.exitImmersiveMode();
// Show the window in front of you when you exit immersive mode.
resetUIYaw();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class WindowsState {
private WindowPlacement mPrevWindowPlacement;
private boolean mStoredCurvedMode = false;
private boolean mForcedCurvedMode = false;
private boolean mIsPaused = false;

public enum WindowPlacement{
FRONT(0),
Expand Down Expand Up @@ -363,6 +364,8 @@ public void resumeCompositor() {
}

public void onPause() {
mIsPaused = true;

saveState();
for (WindowWidget window: mRegularWindows) {
window.onPause();
Expand All @@ -373,6 +376,8 @@ public void onPause() {
}

public void onResume() {
mIsPaused = false;

for (WindowWidget window: mRegularWindows) {
window.onResume();
}
Expand All @@ -395,6 +400,43 @@ public boolean isInPrivateMode() {
return mPrivateMode;
}

public void enterImmersiveMode() {
if (!isInPrivateMode()) {
for (WindowWidget window: mRegularWindows) {
if (window != mFocusedWindow) {
window.onPause();
}
}

} else {
for (WindowWidget window: mPrivateWindows) {
if (window != mFocusedWindow) {
window.onPause();
}
}
}
}

public void exitImmersiveMode() {
if (mIsPaused) {
return;
}

if (!isInPrivateMode()) {
for (WindowWidget window: mRegularWindows) {
if (window != mFocusedWindow) {
window.onResume();
}
}

} else {
for (WindowWidget window: mPrivateWindows) {
if (window != mFocusedWindow) {
window.onResume();
}
}
}
Comment thread
keianhzo marked this conversation as resolved.
}

public void enterPrivateMode() {
if (mPrivateMode) {
Expand Down