Skip to content

Commit

Permalink
Bug 1882021 [Linux/X11] Clean up XWindow from GtkCompositorWidget and…
Browse files Browse the repository at this point in the history
… disable rendering if nsWindow is unmapped r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D203104
  • Loading branch information
stransky committed Feb 29, 2024
1 parent 2960b1b commit 506151a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions widget/gtk/nsWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -615,8 +615,6 @@ void nsWindow::Destroy() {

DestroyLayerManager();

mSurfaceProvider.CleanupResources();

g_signal_handlers_disconnect_by_data(gtk_settings_get_default(), this);

if (mIMContext) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 506151a

Please sign in to comment.