diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /widget/gtk/GtkCompositorWidget.cpp | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'widget/gtk/GtkCompositorWidget.cpp')
-rw-r--r-- | widget/gtk/GtkCompositorWidget.cpp | 31 |
1 files changed, 7 insertions, 24 deletions
diff --git a/widget/gtk/GtkCompositorWidget.cpp b/widget/gtk/GtkCompositorWidget.cpp index a3443b9828..36559cfd54 100644 --- a/widget/gtk/GtkCompositorWidget.cpp +++ b/widget/gtk/GtkCompositorWidget.cpp @@ -39,11 +39,11 @@ GtkCompositorWidget::GtkCompositorWidget( "GtkCompositorWidget::mClientSize") { #if defined(MOZ_X11) if (GdkIsX11Display()) { - mXWindow = (Window)aInitData.XWindow(); - ConfigureX11Backend(mXWindow, aInitData.Shaped()); + ConfigureX11Backend((Window)aInitData.XWindow(), aInitData.Shaped()); LOG("GtkCompositorWidget::GtkCompositorWidget() [%p] mXWindow %p " "mIsRenderingSuspended %d\n", - (void*)mWidget.get(), (void*)mXWindow, !!mIsRenderingSuspended); + (void*)mWidget.get(), (void*)aInitData.XWindow(), + !!mIsRenderingSuspended); } #endif #if defined(MOZ_WAYLAND) @@ -123,8 +123,8 @@ EGLNativeWindowType GtkCompositorWidget::GetEGLNativeWindow() { window = (EGLNativeWindowType)mWidget->GetNativeData(NS_NATIVE_EGL_WINDOW); } #if defined(MOZ_X11) - if (mXWindow) { - window = (EGLNativeWindowType)mXWindow; + else { + window = (EGLNativeWindowType)mProvider.GetXWindow(); } #endif LOG("GtkCompositorWidget::GetEGLNativeWindow [%p] window %p\n", mWidget.get(), @@ -173,9 +173,6 @@ void GtkCompositorWidget::DisableRendering() { LOG("GtkCompositorWidget::DisableRendering [%p]\n", (void*)mWidget.get()); mIsRenderingSuspended = true; mProvider.CleanupResources(); -#if defined(MOZ_X11) - mXWindow = {}; -#endif } #if defined(MOZ_WAYLAND) @@ -187,27 +184,13 @@ bool GtkCompositorWidget::ConfigureWaylandBackend() { #if defined(MOZ_X11) bool GtkCompositorWidget::ConfigureX11Backend(Window aXWindow, bool aShaped) { - mXWindow = aXWindow; - // We don't have X window yet. - if (!mXWindow) { + if (!aXWindow) { mIsRenderingSuspended = true; return false; } - - // Grab the window's visual and depth - XWindowAttributes windowAttrs; - if (!XGetWindowAttributes(DefaultXDisplay(), mXWindow, &windowAttrs)) { - NS_WARNING("GtkCompositorWidget(): XGetWindowAttributes() failed!"); - return false; - } - - Visual* visual = windowAttrs.visual; - int depth = windowAttrs.depth; - // Initialize the window surface provider - mProvider.Initialize(mXWindow, visual, depth, aShaped); - return true; + return mProvider.Initialize(aXWindow, aShaped); } #endif |