@@ -301,11 +301,14 @@ public void moveWindowRight(@NonNull WindowWidget aWindow) {
301301 if (aWindow == leftWindow ) {
302302 placeWindow (leftWindow , WindowPlacement .FRONT );
303303 placeWindow (frontWindow , WindowPlacement .LEFT );
304+ switchTopBars (leftWindow , frontWindow );
304305 } else if (aWindow == frontWindow ) {
305306 if (rightWindow != null ) {
306307 placeWindow (rightWindow , WindowPlacement .FRONT );
308+ switchTopBars (rightWindow , frontWindow );
307309 } else if (leftWindow != null ) {
308310 placeWindow (leftWindow , WindowPlacement .FRONT );
311+ switchTopBars (leftWindow , frontWindow );
309312 }
310313 placeWindow (frontWindow , WindowPlacement .RIGHT );
311314 }
@@ -323,11 +326,14 @@ public void moveWindowLeft(@NonNull WindowWidget aWindow) {
323326 if (aWindow == rightWindow ) {
324327 placeWindow (rightWindow , WindowPlacement .FRONT );
325328 placeWindow (frontWindow , WindowPlacement .RIGHT );
329+ switchTopBars (rightWindow , frontWindow );
326330 } else if (aWindow == frontWindow ) {
327331 if (leftWindow != null ) {
328332 placeWindow (leftWindow , WindowPlacement .FRONT );
333+ switchTopBars (leftWindow , frontWindow );
329334 } else if (rightWindow != null ) {
330335 placeWindow (rightWindow , WindowPlacement .FRONT );
336+ switchTopBars (rightWindow , frontWindow );
331337 }
332338 placeWindow (frontWindow , WindowPlacement .LEFT );
333339 }
@@ -715,6 +721,15 @@ public int getWindowsCount() {
715721 return getCurrentWindows ().size ();
716722 }
717723
724+ private void switchTopBars (WindowWidget w1 , WindowWidget w2 ) {
725+ // Used to fix a minor visual glitch.
726+ // See https://github.com/MozillaReality/FirefoxReality/issues/1722
727+ TopBarWidget bar1 = w1 .getTopBar ();
728+ TopBarWidget bar2 = w2 .getTopBar ();
729+ w1 .setTopBar (bar2 );
730+ w2 .setTopBar (bar1 );
731+ }
732+
718733 private void updateViews () {
719734 WindowWidget frontWindow = getFrontWindow ();
720735 WindowWidget leftWindow = getLeftWindow ();
0 commit comments