Skip to content

Commit

Permalink
Bug 1886802 [Linux] Init XWindow for GLX context early r=emilio a=RyanVM
Browse files Browse the repository at this point in the history
  • Loading branch information
stransky committed Mar 25, 2024
1 parent 35602dc commit fe885ea
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion widget/gtk/nsWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9740,8 +9740,19 @@ void nsWindow::GetCompositorWidgetInitData(

LOG("nsWindow::GetCompositorWidgetInitData");

Window window = GetX11Window();
#ifdef MOZ_X11
// We're bit hackish here. Old GLX backend needs XWindow when GLContext
// is created so get XWindow now before map signal.
// We may see crashes/errors when nsWindow is unmapped (XWindow is
// invalidated) but we can't do anything about it.
if (!window && !gfxVars::UseEGL()) {
window =
gdk_x11_window_get_xid(gtk_widget_get_window(GTK_WIDGET(mContainer)));
}
#endif
*aInitData = mozilla::widget::GtkCompositorWidgetInitData(
GetX11Window(), displayName, GetShapedState(), GdkIsX11Display(),
window, displayName, GetShapedState(), GdkIsX11Display(),
GetClientSize());

#ifdef MOZ_X11
Expand Down

0 comments on commit fe885ea

Please sign in to comment.