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

Commit 5801937

Browse files
MortimerGorokeianhzo
authored andcommitted
Fix reattach navbar and tray regression when a window is closed (#1669)
1 parent d9a5082 commit 5801937

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

  • app/src/common/shared/org/mozilla/vrbrowser/ui/widgets

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,13 +238,11 @@ public void closeWindow(@NonNull WindowWidget aWindow) {
238238
if (leftWindow == aWindow) {
239239
removeWindow(leftWindow);
240240
if (mFocusedWindow == leftWindow) {
241-
mFocusedWindow = null;
242241
focusWindow(frontWindow);
243242
}
244243
} else if (rightWindow == aWindow) {
245244
removeWindow(rightWindow);
246245
if (mFocusedWindow == rightWindow) {
247-
mFocusedWindow = null;
248246
focusWindow(frontWindow);
249247
}
250248
} else if (frontWindow == aWindow) {
@@ -256,7 +254,6 @@ public void closeWindow(@NonNull WindowWidget aWindow) {
256254
}
257255

258256
if (mFocusedWindow == frontWindow && !getCurrentWindows().isEmpty()) {
259-
mFocusedWindow = null;
260257
focusWindow(getFrontWindow());
261258
}
262259

@@ -319,7 +316,7 @@ public void focusWindow(@NonNull WindowWidget aWindow) {
319316
if (aWindow != mFocusedWindow) {
320317
WindowWidget prev = mFocusedWindow;
321318
mFocusedWindow = aWindow;
322-
if (prev != null) {
319+
if (prev != null && getCurrentWindows().contains(prev)) {
323320
prev.setActiveWindow(false);
324321
if (prev.isVisible()) {
325322
prev.getTitleBar().setVisible(true);

0 commit comments

Comments
 (0)