Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Windows users seeing blank "white window" artifacts appear when merging tabs into browser window #41272

Closed
2 of 6 tasks
Brave-Matt opened this issue Sep 27, 2024 · 13 comments · Fixed by brave/brave-core#26791
Closed
2 of 6 tasks

Comments

@Brave-Matt
Copy link

Description

image

Several users on Windows are seeing strange "white boxes" appear when they tear a tab off from the browser window, then merge it back into that window. It looks like it creates a sort of weird "ghost" window behind the main browser window they're attempting to attach the tab to. A couple users have submitted recordings of the behavior:
https://www.youtube.com/watch?v=GEqN40QRiEA
https://www.youtube.com/watch?v=1dbYKaRoCCE

This appears to only be happening for Windows users as nobody on macOS has reported this issue yet. I cannot reproduce on my end, but both Windows 10 and 11 users have reported the same issue.

Steps to reproduce

  1. Open a new browser tab.
  2. Add a second tab on the same browser window.
  3. Drag either of the tabs off the first window.
  4. Reattach it to the original browser window.

Actual result

Strange ghost artifact window appears

Expected result

No artifacts should appear

Reproduces how often

Easily reproduced

Brave version (brave://version info)

v1.70.119

Channel information

  • release (stable)
  • beta
  • nightly

Reproducibility

  • with Brave Shields disabled
  • with Brave Rewards disabled
  • in the latest version of Chrome

Miscellaneous information

Consolidated user reports:
https://community.brave.com/t/white-windows-when-merging-tabs/570407/11

@tanoshi40
Copy link

I have the same issue.

2 things to add:

  • When splitting and merging windows, after merging when you right-click on a tab select "move to another window", it shows "new window" tabs for each one of the blank windows that seems to be created while merging tabs. When you click on move to that window the "white" window reappears as a proper tab.
  • For me on the latest beta build this issue does not seem to be there anymore.

@Saoiray
Copy link

Saoiray commented Sep 28, 2024

Just had a user point out that this issue happens by having Close window when closing last tab disabled. Upon doing this, I was able to replicate. Upon enabling that setting, the issue goes away.

Using this same setup, it seems to occur also in Nightly.

image

Also want to note that once this issue occurs, it will remain active until you force Brave to terminate all processes. Such as even after enabling the setting, I closed Brave and was greeted to the blank windows that had been generated while testing the above.

image

Note:

Chrome doesn't have this setting as an option, so it seems not to be an upstream problem.

cc: @rebron

@nightcrewlab
Copy link

nightcrewlab commented Sep 28, 2024 via email

@Zoltus
Copy link

Zoltus commented Oct 3, 2024

I have the exact same problem, and had it for couple of weeks atleast, most annoying bug I have ever had in any browser so should be high priority.

Edit after weeks of this i had to change to chrome, just impossible to use brave when screen is full of white pages

@rebron
Copy link
Collaborator

rebron commented Oct 4, 2024

cc: @simonhong

@rebron rebron added the priority/P2 A bad problem. We might uplift this to the next planned release. label Oct 4, 2024
@Brave-Matt
Copy link
Author

Another user seeing this issue:
https://community.brave.com/t/brave-pages-bug/574139/2

@Ilie-Lesan
Copy link

Ilie-Lesan commented Oct 8, 2024

Looks like the unload controller is never setting the is_attempting_to_close_browser_ on true when kEnableClosingLastTab is disabled. As a result, some empty (invisible) windows are created when attaching/detaching a tab from the browser.
STR:

  1. Set kEnableClosingLastTab on false
  2. Open a browser window with two tabs
  3. Drag one tab out of the window
  4. Attach the dragged tab to the first window
  5. From the context menu, click "Bring all tabs to this window"(shouldn't be visible in this case)

At this point, you will see that the ghost tabs appear in the UI. Also, you can see them in the task manager.
Code of interest:
Image

I didn't do a deep investigation(maybe next week), but I think this is a good starting point if someone else wants to pick it.
FYI: @simonhong @bsclifton

@Freefire666
Copy link

Good day
I have now installed Release v1.70.126 portable.
The white windows are still there sporadically and block the desktop :/.

@Ilie-Lesan
Copy link

@Freefire666 Thanks for the confirmation. The problem is known, and we have steps to reproduce it. I will try to fix it in the near future.

@q2apro
Copy link

q2apro commented Oct 15, 2024

Probably related to: "White window when minimizing a Brave browser window to the system tray in Windows 10" at https://community.brave.com/t/white-window-when-minimizing-a-brave-browser-window-to-the-system-tray-in-windows-10/575265

@Ilie-Lesan
Copy link

After testing the Brave browser, I saw the following two cases where the ghost windows appear.

  1. Trying to close the last window creates two invisible windows. Please see the video below.
close_last_tab_create_ghosts_new_tabs.mp4

I couldn't find a clean solution to fix this issue. It looks like when the OnTabStripModelChanged is called with no tabs is already too late. An attempt to fix this issue was to add a new tab before closing all the tabs scheduled for closing. The problem with this approach is that we cannot solve the problem for reentrancy(Ctrl+W on a tab). Here is how I've initially tried to fix it: Ilie-Lesan/brave-core@eaad7ee#diff-c88f3e9d6876f950836824fdc80f905f2095daf7a4f449588afcfe831d297fe5R41

  1. Draging in and out a window also creates an invisible(new tab window)
drag_and_drop_create_a_ghosts_tabs.mp4

My initial idea for fixing the second issue(the one with drag & drop) was to allow the browser to close as long as the reason for closing is kInsertedIntoOtherTabStrip. This worked well, but the code looked a bit messy(I had to modify the TabStripEmpty function to accept a parameter and adapt the implementation for all observers).

The approach from this pull request is to always load a new tab in the existing web content when the user is closing the last tab(inspired by the PolicyAllowsTabClosing function). This will solve both problems, but the shortcoming of this approach is that the history of navigation is kept for the new tab. Please let me know if we can live with this behavior or suggest a new approach to loading a new tab.

FYI: @simonhong @bsclifton

@MadhaviSeelam
Copy link

MadhaviSeelam commented Dec 30, 2024

Verification PASSED using

Brave | 1.75.133 Chromium: 132.0.6834.57 (Official Build) nightly (64-bit)
-- | --
Revision | ce1787778a7a5d92e63a29f8be965494ef49cbbd
OS | Windows 11 Version 24H2 (Build 26100.2605)

Reproduced the issue in 1.70.119

2024-12-30_16h22_53.mp4
  1. Installed 1.75.133
  2. launched Brave
  3. opened brave://settings/system
  4. toggled off Close widow when closing last tab setting
  5. opened another tab
  6. detached that tab to created another browser window B
  7. attached the tab of browser window B to browser window A
  8. verified only one browser window A exists with two tabs
  9. opened tab's context menu and selected Move tab to new window
  10. verified another window created
  11. toggled On Close widow when closing last tab setting
  12. repeated steps 5 - 10

Confirmed no ghost/blank white windows are created

2024-12-30_16h40_37.mp4

# for free to join this conversation on GitHub. Already have an account? # to comment