From f2bb8e9336670d36a807141712190c200c8d369c Mon Sep 17 00:00:00 2001 From: stransky Date: Tue, 26 Jul 2022 14:56:48 +0000 Subject: [PATCH] Bug 1777664 [Wayland] Add more logging to EGL window management r=emilio Differential Revision: https://phabricator.services.mozilla.com/D152692 --- widget/gtk/GtkCompositorWidget.cpp | 9 ++++++--- widget/gtk/MozContainerWayland.cpp | 10 +++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/widget/gtk/GtkCompositorWidget.cpp b/widget/gtk/GtkCompositorWidget.cpp index 0a1d88894c76..65cc2a45e08b 100644 --- a/widget/gtk/GtkCompositorWidget.cpp +++ b/widget/gtk/GtkCompositorWidget.cpp @@ -118,15 +118,18 @@ void GtkCompositorWidget::RemoteLayoutSizeUpdated( } EGLNativeWindowType GtkCompositorWidget::GetEGLNativeWindow() { + EGLNativeWindowType window = nullptr; if (mWidget) { - return (EGLNativeWindowType)mWidget->GetNativeData(NS_NATIVE_EGL_WINDOW); + window = (EGLNativeWindowType)mWidget->GetNativeData(NS_NATIVE_EGL_WINDOW); } #if defined(MOZ_X11) if (mXWindow) { - return (EGLNativeWindowType)mXWindow; + window = (EGLNativeWindowType)mXWindow; } #endif - return nullptr; + LOG("GtkCompositorWidget::GetEGLNativeWindow [%p] mWidget %p window %p\n", + (void*)mWidget.get(), mWidget.get(), window); + return window; } #if defined(MOZ_WAYLAND) diff --git a/widget/gtk/MozContainerWayland.cpp b/widget/gtk/MozContainerWayland.cpp index 4b20bc7de553..54d798c46ac3 100644 --- a/widget/gtk/MozContainerWayland.cpp +++ b/widget/gtk/MozContainerWayland.cpp @@ -682,6 +682,9 @@ struct wl_egl_window* moz_container_wayland_get_egl_window( MutexAutoLock lock(*wl_container->container_lock); if (!wl_container->surface || !wl_container->ready_to_draw) { + LOGWAYLAND( + " quit, wl_container->surface %p wl_container->ready_to_draw %d\n", + wl_container->surface, wl_container->ready_to_draw); return nullptr; } if (!wl_container->eglwindow) { @@ -690,9 +693,10 @@ struct wl_egl_window* moz_container_wayland_get_egl_window( wl_container->surface, (int)round(gdk_window_get_width(window) * scale), (int)round(gdk_window_get_height(window) * scale)); - LOGWAYLAND("%s [%p] created eglwindow %p\n", __FUNCTION__, - (void*)moz_container_get_nsWindow(container), - (void*)wl_container->eglwindow); + LOGWAYLAND("%s [%p] created eglwindow %p size %d x %d scale %f\n", + __FUNCTION__, (void*)moz_container_get_nsWindow(container), + (void*)wl_container->eglwindow, gdk_window_get_width(window), + gdk_window_get_height(window), scale); } return wl_container->eglwindow; }