brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.87k stars 2.34k forks source link

Delayed input processing with multiple windows #34469

Open rillian opened 11 months ago

rillian commented 11 months ago

Description

I quite commonly see jank using multiple windows on Linux. This is most common when there are active updates in the other window. User input events like scrolling or clicking to focus an input box seem to hang the interface for 2-3 seconds before there is any response in the content window.

E.g. I can't use Slack if a YouTube video is playing in another window.

This does not happen between multiple tabs in the same window, or between windows of different browser instances. I most commonly notice it with private windows, but can reproduce with two regular-profile windows.

Steps to Reproduce

  1. Open youtube and start a video playing
  2. Open a new browser window and visit a news site like https://cbc.ca/news
  3. Scroll. Wait 5 seconds, then try to scroll the news page again.

Actual result:

News page hangs for ~3 seconds, then scrolls.

Expected result:

All windows should remain responsive.

Reproduces how often:

It's been pretty consistent. The above steps showed the problem each time I tried them today.

Brave version (brave://version info)

1.61.77 Chromium: 119.0.6045.163 (Official Build) beta (64-bit)

Version/Channel Information:

Other Additional Information:

I could not reproduce with the Fedora rpm-packaged Chromium. I could reproduce with the Fedora flatpak of Chrome, but less reliably.

Miscellaneous Information:

I observed this on x86_64 Fedora Linux systems, Gnome desktop on Wayland, Intel integrated graphics.

fallaciousreasoning commented 11 months ago

Note: Also applies to PWA windows in the same profile (i.e. if you have the Slack PWA open and a regular browser tab open, both will jank)

(I'm running Ubuntu with Wayland + Brave Nightly - it seems a lot better on Ubuntu 2023.10)

rillian commented 11 months ago

I wasn't able to reproduce in either Ubuntu 22.04 or Fedora 38 virtual machines, which suggests it may have more do to with the device layer than wayland specifically.

is there logging we can turn to to see if the gpu queue is hanging somehow?

fallaciousreasoning commented 11 months ago

No you mention this, I have a super vague idea it happened not that long after I bumped my NVIDIA drivers (though that might be confirmation bias on my part).

I have super limited experience with anything lower than the application layer sorry, so I dunno how much help I'm going to be (but that's not gunna stop me trying :laughing:)

rillian commented 11 months ago

Possibly related:

the hypothesis for the xwayland issue sounds like chromium is estimating the screen refresh rate at 1 fps if a window is hidden, and applying that when processing updates to a non-hidden window. I generally use maximized windows on the same or different workspaces, which is consistent with that.

fallaciousreasoning commented 11 months ago

Oh that sounds very plausible - my setup has recently changed so I have the multiple windows on the same screen - I'm going to try putting some windows on other workspaces and see if that makes things janky.

Update: I seem to still be jank free