зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1829414 [Wayland] Don't crash if we're getting EGL window for hidden GtkWindow on Wayland r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D177689
This commit is contained in:
Родитель
cace8b2cdf
Коммит
1e42fec5f4
|
@ -496,6 +496,16 @@ bool GLContextEGL::RenewSurface(CompositorWidget* aWidget) {
|
|||
|
||||
EGLNativeWindowType nativeWindow =
|
||||
GET_NATIVE_WINDOW_FROM_COMPOSITOR_WIDGET(aWidget);
|
||||
#ifdef MOZ_WAYLAND
|
||||
// In case we're missing native window on Wayland CompositorWidget is hidden.
|
||||
// Don't create a fallback EGL surface but fails here.
|
||||
// We need to repeat RenewSurface() when native window is available
|
||||
// (CompositorWidget becomes visible).
|
||||
if (GdkIsWaylandDisplay()) {
|
||||
NS_WARNING("Failed to get native window");
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
if (nativeWindow) {
|
||||
mSurface = mozilla::gl::CreateSurfaceFromNativeWindow(*mEgl, nativeWindow,
|
||||
mSurfaceConfig);
|
||||
|
|
|
@ -3428,10 +3428,10 @@ void* nsWindow::GetNativeData(uint32_t aDataType) {
|
|||
#ifdef MOZ_WAYLAND
|
||||
if (GdkIsWaylandDisplay()) {
|
||||
if (mCompositorWidgetDelegate &&
|
||||
mCompositorWidgetDelegate->AsGtkCompositorWidget()) {
|
||||
MOZ_DIAGNOSTIC_ASSERT(
|
||||
!mCompositorWidgetDelegate->AsGtkCompositorWidget()->IsHidden(),
|
||||
"We're getting OpenGL window for hidden window!");
|
||||
mCompositorWidgetDelegate->AsGtkCompositorWidget() &&
|
||||
mCompositorWidgetDelegate->AsGtkCompositorWidget()->IsHidden()) {
|
||||
NS_WARNING("Getting OpenGL EGL window for hidden Gtk window!");
|
||||
return nullptr;
|
||||
}
|
||||
eglWindow = moz_container_wayland_get_egl_window(
|
||||
mContainer, FractionalScaleFactor());
|
||||
|
|
Загрузка…
Ссылка в новой задаче