Bug 1882021 [Linux/X11] Clean up XWindow from GtkCompositorWidget and disable rendering if nsWindow is unmapped r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D203104
This commit is contained in:
stransky 2024-02-29 10:59:14 +00:00
parent 2960b1b38e
commit 506151ac79

View File

@ -615,8 +615,6 @@ void nsWindow::Destroy() {
DestroyLayerManager();
mSurfaceProvider.CleanupResources();
g_signal_handlers_disconnect_by_data(gtk_settings_get_default(), this);
if (mIMContext) {
@ -4123,6 +4121,16 @@ void nsWindow::OnUnmap() {
mSourceDragContext = nullptr;
}
}
// We don't have valid XWindow any more,
// so clear stored ones at GtkCompositorWidget() for OMTC rendering
// and mSurfaceProvider for legacy rendering.
if (GdkIsX11Display()) {
mSurfaceProvider.CleanupResources();
if (mCompositorWidgetDelegate) {
mCompositorWidgetDelegate->DisableRendering();
}
}
}
void nsWindow::OnSizeAllocate(GtkAllocation* aAllocation) {