Opening popup menu freezes whole browser
Categories
(Core :: Widget: Gtk, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox105 | --- | fixed |
People
(Reporter: stransky, Assigned: stransky)
References
(Blocks 1 open bug)
Details
Attachments
(13 files)
2.37 MB,
video/webm
|
Details | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
Opening popup menu freezes whole browser.
Assignee | ||
Comment 1•2 years ago
|
||
Seems to be specific to my environment/extensions installed.
Assignee | ||
Comment 2•2 years ago
|
||
This is caused by frozen refresh driver - still investigating why we see it. Looks like a race condition while we close the popup / pause compositor but we still render to the window.
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 3•2 years ago
|
||
The frozen thick driver causes that we're not proceed events for the popup so we don't set input region and don't configure the new popup.
Assignee | ||
Comment 4•2 years ago
|
||
This is a problem with CompositorBridgeChild::SendPause() in widget code - we call that in case we hide a window to stop rendering to it (perhaps?). But that causes issue when one nsRefreshDriver is used by more WebRenderLayerManager. The main UI window uses the same nsRefreshDriver as a popup (both have different WebRenderLayerManager but they use the same nsRefreshDriver), we end up with complete UI freeze and log is flooded with 'Over max pending transaction limit when trying to paint, skipping' when the popup is closed and CompositorBridgeChild::SendPause() is called.
So there's a question if it's a good idea to use CompositorBridgeChild::SendPause() here.
Assignee | ||
Comment 5•2 years ago
|
||
Explanation by mstange:
CompositorBridgeChild::SendPause() is intended to avoid compositing in the minimized window, for example from a loading spinner animation
these animations are driven by the compositor and can continue even if the main thread doesn't send any further paints
but bypassing the refresh driver for this seems like a bad design - one part of the system is saying "don't composite" and the other part of the system is saying "I'm expecting you to composite and I won't do anything until you do"
Assignee | ||
Comment 6•2 years ago
|
||
So we need to remove SendPause() here. We can use SendPause()/SendResumeAsync() only when we wait for some external event like window creation or so and we need to pair every SendPause() with SendResumeAsync() to make sure we don't block rendering of another window as nsRefreshDriver can be shared.
Assignee | ||
Comment 7•2 years ago
|
||
Assignee | ||
Comment 8•2 years ago
|
||
nsWindow::SetCompositorWidgetDelegate() should not control compositor state as nsWindow::SetCompositorWidgetDelegate() itself is called by nsBaseWidget::CreateCompositor()/nsBaseWidget::DestroyCompositor().
In this patch we remove compositor pause/resume from nsWindow::SetCompositorWidgetDelegate() and update only GdkWindow/XWindow stored in remote widget.
Depends on D152686
Assignee | ||
Comment 9•2 years ago
|
||
Depends on D152687
Assignee | ||
Comment 10•2 years ago
|
||
We should not pause compositor as compositing is driven by refresh driver and compositor pause leads to browser freeze.
Depends on D152688
Assignee | ||
Comment 11•2 years ago
|
||
Enable composition only once when nsWindow is created and don't stop compositon until a window is destroyed.
Remove COMPOSITOR_PAUSED_MISSING_WINDOW as we don't manage compositing for hidden windows any more.
Depends on D152689
Assignee | ||
Comment 12•2 years ago
|
||
Depends on D152690
Assignee | ||
Comment 13•2 years ago
|
||
Depends on D152691
Assignee | ||
Comment 14•2 years ago
|
||
When mCompositorWidgetDelegate is changed we need to recreate compositor and Wayland vsync. In this patch we do:
- Make mCompositorWidgetDelegate hard requirement for Wayland vsync source to avoid hidden failure.
- Stop Wayland vsync source at nsWindow::SetCompositorWidgetDelegate() when we're going to release or change mCompositorWidgetDelegate.
- Start Wayland vsync source at nsWindow::SetCompositorWidgetDelegate() when there's a new mCompositorWidgetDelegate to make sure vsync uses
recent one. - Set new window config (XWindow, shape, widget) and resume compositor at nsWindow::SetCompositorWidgetDelegate() when new mCompositorWidgetDelegate is assigned to widget.
- As it's possible that mCompositorWidgetDelegate is missing in nsWindow::ConfigureGdkWindow() use moz_container_wayland_add_initial_draw_callback() to call mCompositorWidgetDelegate->EnableRendering() & WaylandStartVsync(). That ensures we won't silently fail to set up nsWindow for rendering.
Depends on D152692
Assignee | ||
Comment 15•2 years ago
|
||
Depends on D152693
Assignee | ||
Comment 16•2 years ago
|
||
Assignee | ||
Comment 17•2 years ago
|
||
Depends on D152694
Assignee | ||
Comment 18•2 years ago
|
||
Depends on D152730
Assignee | ||
Comment 19•2 years ago
|
||
Depends on D152731
Assignee | ||
Comment 20•2 years ago
|
||
Comment 21•2 years ago
|
||
Pushed by stransky@redhat.com: https://hg.mozilla.org/integration/autoland/rev/0fa3652858e9 [Linux] Replace CleanLayerManagerRecursive() with DestroyLayerManager() as they're the same r=emilio https://hg.mozilla.org/integration/autoland/rev/396ad8e5d024 [Linux] Don't pause/resume compositor by nsWindow::SetCompositorWidgetDelegate() r=emilio https://hg.mozilla.org/integration/autoland/rev/8a1503365add [Linux] Create nsWindow with initially paused compositor as we don't have valid GdkWindow/XWindow yet r=emilio https://hg.mozilla.org/integration/autoland/rev/0531e0fd8b47 [Wayland] Don't pause compositor when nsWindow is hidden r=emilio https://hg.mozilla.org/integration/autoland/rev/66c3420f8f7f [Wayland] Remove EnableRenderingToWindow()/DisableRenderingToWindow/()/ResumeCompositorHiddenWindow() r=emilio https://hg.mozilla.org/integration/autoland/rev/5dcb07911ae4 [Wayland] Split ShowWaylandWindow() to ShowWaylandPopupWindow()/ShowWaylandToplevelWindow() and enable/disable VSync for visible/hidden toplevel windows r=emilio https://hg.mozilla.org/integration/autoland/rev/d4beab20f7e5 [Wayland] Add more logging to EGL window management r=emilio https://hg.mozilla.org/integration/autoland/rev/0a19e7857a10 [Wayland] Handle mCompositorWidgetDelegate changes in nsWindow r=emilio https://hg.mozilla.org/integration/autoland/rev/af89aa9ca4fb [Linux] Destory layer manager at nsWindow::ReleaseGdkWindow() r=emilio https://hg.mozilla.org/integration/autoland/rev/07d98fdfda1e [Wayland] Remove print of this from logging r=emilio https://hg.mozilla.org/integration/autoland/rev/c79511446521 [Wayland] Assert when ShowWaylandToplevelWindow() is called on popup r=emilio https://hg.mozilla.org/integration/autoland/rev/e081a91279cc [Linux] Remove redundant logging from GtkCompositorWidget r=emilio
Assignee | ||
Comment 22•2 years ago
|
||
This one also depends on Bug 1752992 - we need to destroy compositor when popup window (usually tooltip) is closed to make sure the refresh driver is not blocked.
It's because we close the tooltip popups from widget code and it's not deleted by layout so compositing is still enabled/refres driver is ticking but nothing is painted and that causes whole UI freeze.
Bug 1619246 (disabled wayland vsync) may be also a factor here and can help if we enable/disable vsync for popups.
Comment 23•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/0fa3652858e9
https://hg.mozilla.org/mozilla-central/rev/396ad8e5d024
https://hg.mozilla.org/mozilla-central/rev/8a1503365add
https://hg.mozilla.org/mozilla-central/rev/0531e0fd8b47
https://hg.mozilla.org/mozilla-central/rev/66c3420f8f7f
https://hg.mozilla.org/mozilla-central/rev/5dcb07911ae4
https://hg.mozilla.org/mozilla-central/rev/d4beab20f7e5
https://hg.mozilla.org/mozilla-central/rev/0a19e7857a10
https://hg.mozilla.org/mozilla-central/rev/af89aa9ca4fb
https://hg.mozilla.org/mozilla-central/rev/07d98fdfda1e
https://hg.mozilla.org/mozilla-central/rev/c79511446521
https://hg.mozilla.org/mozilla-central/rev/e081a91279cc
Description
•