Closed Bug 1737068 Opened 4 years ago Closed 4 years ago

[Linux] Use Map/Unmap widget signals to manage GdkWindow

Categories

(Core :: Widget: Gtk, defect, P2)

defect

Tracking

()

RESOLVED FIXED
95 Branch
Tracking Status
firefox95 --- fixed

People

(Reporter: stransky, Assigned: stransky)

References

Details

Crash Data

Attachments

(3 files)

We need to manage GdkWindow better.
When we get map signal, we need to create GdkWindow and start compositor.
On Unmap widget signals we need to stop compositor and release GdkWindow (or at least underlying EGL window and XWindow) as it's no longer valid.

This patch does:

  • Track nsWindow real visibility by widget_map_cb / widget_unrealize_cb callbacks and set mIsMapped attribute properly.
  • Clear mGdkWindow attribute when mGdkWindow is not visible and we can't paint into it.
  • Implement and use ConfigureGdkWindow() to set up mGdkWindow when it's visible, start compositor, VSync.
  • Implement and use ReleaseGdkWindow() to clear up mGdkWindow when it's not visible, stop compositor, Vsync.
  • Make sure nsWindow works when mGdkWindow is null.
  • Configure Drag popup accordingly.
  • When GtkCompositorWidget is created, make suspended rendering state as initial one as we can't render to widget window.
    Enable rendering when underlying window is visible (nsWindow::ConfigureGdkWindow) or GtkCompositorWidget is assigned (nsWindow::SetCompositorWidgetDelegate).
  • Use moz_container_wayland_add_initial_draw_callback() at nsWindow::ConfigureGdkWindow() to set Wayland EGL window as it was before.
  • Make moz_container_wayland_add_initial_draw_callback() to run callbacks instantly when mozcontainer is already visible.
  • Implement and use moz_container_wayland_clear_initial_draw_callback() to clear mozcontainer callbacks when it becomes hidden.
  • Rename COMPOSITOR_PAUSED_MISSING_EGL_WINDOW to COMPOSITOR_PAUSED_MISSING_WINDOW as it's used for GLX too.
  • Initially pause rendering for GLX too.
Pushed by stransky@redhat.com: https://hg.mozilla.org/integration/autoland/rev/26c607095b9b [Linux] Enable/Disable rendering to GdkWindow when we're mapped/unmapped r=rmader https://hg.mozilla.org/integration/autoland/rev/ac34c4dc4723 [Linux] Postpone compositor rendering until widget window is ready, r=rmader https://hg.mozilla.org/integration/autoland/rev/3de8f260e8b1 [Linux] Grab pointer when window is mapped and there's an active request for it, r=rmader
Backout by imoraru@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8e32db0ee9e2 Backed out 3 changesets for causing multiple test failures with thread sanitizer on GtkCompositorWidget.cpp. CLOSED TREE

Backed out for causing multiple test failures with thread sanitizer on GtkCompositorWidget.cpp.
Affected platform is linux1804-64-tsan-qr opt.

Push with failures

Failure log for bc failures
Failure log for wr failures
Failure log for wpt failures
Failure log for mochitest plain failures
Failure log for mda failures
Failure log for reftest failures

Backout link

Flags: needinfo?(stransky)
Pushed by stransky@redhat.com: https://hg.mozilla.org/integration/autoland/rev/00569d0fc9b9 [Linux] Enable/Disable rendering to GdkWindow when we're mapped/unmapped r=rmader https://hg.mozilla.org/integration/autoland/rev/88ecfc06a267 [Linux] Postpone compositor rendering until widget window is ready, r=rmader https://hg.mozilla.org/integration/autoland/rev/f632271e9d62 [Linux] Grab pointer when window is mapped and there's an active request for it, r=rmader
Flags: needinfo?(stransky)
Type: enhancement → defect
Priority: P3 → P2
Regressions: 1738026
Regressions: 1738066
Regressions: 1738729
Regressions: 1739232
Crash Signature: [@ mozilla::widget::WaylandBufferSHM::Lock]
Regressions: 1744896

I think I found a regression caused by this: https://bugzilla.mozilla.org/show_bug.cgi?id=1745098

Regressions: 1745098
Regressions: 1745582
Regressions: 1743821
No longer regressions: 1743821
Regressions: 1743821

This old ifndef is still there. Is this desired?
https://searchfox.org/mozilla-central/rev/5d2b9e940ca09bd1cbc15aa681f69424cde8904c/xpfe/appshell/AppWindow.cpp#586

  // XXX: Skip unmapping the window on Linux due to GLX hangs on the compositor
  // thread with NVIDIA driver 310.32. We don't need to worry about user
  // interactions with destroyed windows on X11 either.
#ifndef MOZ_WIDGET_GTK
  if (mWindow) mWindow->Show(false);
#endif
Flags: needinfo?(stransky)

I think it does not matter.

Flags: needinfo?(stransky)
See Also: → 1752992
No longer regressions: 1739232
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: