зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1603839 [Linux] Explicitly set Wayland/X11 backend for GtkCompositorWidget, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D71888
This commit is contained in:
Родитель
4e87886f42
Коммит
7112c02038
|
@ -13,8 +13,8 @@ namespace widget {
|
|||
CompositorWidgetParent::CompositorWidgetParent(
|
||||
const CompositorWidgetInitData& aInitData,
|
||||
const layers::CompositorOptions& aOptions)
|
||||
: GtkCompositorWidget(aInitData.get_GtkCompositorWidgetInitData(),
|
||||
aOptions) {
|
||||
: GtkCompositorWidget(aInitData.get_GtkCompositorWidgetInitData(), aOptions,
|
||||
nullptr) {
|
||||
MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_GPU);
|
||||
}
|
||||
|
||||
|
|
|
@ -27,9 +27,10 @@ GtkCompositorWidget::GtkCompositorWidget(
|
|||
}
|
||||
|
||||
#ifdef MOZ_WAYLAND
|
||||
if (!mXDisplay) {
|
||||
MOZ_RELEASE_ASSERT(
|
||||
aWindow, "We're running on Wayland and but without valid nsWindow.");
|
||||
if (!aInitData.IsX11Display()) {
|
||||
if (!aWindow) {
|
||||
NS_WARNING("GtkCompositorWidget: We're missing nsWindow!");
|
||||
}
|
||||
mProvider.Initialize(aWindow);
|
||||
} else
|
||||
#endif
|
||||
|
@ -92,7 +93,9 @@ uintptr_t GtkCompositorWidget::GetWidgetKey() {
|
|||
}
|
||||
|
||||
EGLNativeWindowType GtkCompositorWidget::GetEGLNativeWindow() {
|
||||
return (EGLNativeWindowType)mWidget->GetNativeData(NS_NATIVE_EGL_WINDOW);
|
||||
return mWidget
|
||||
? (EGLNativeWindowType)mWidget->GetNativeData(NS_NATIVE_EGL_WINDOW)
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
#ifdef MOZ_WAYLAND
|
||||
|
|
|
@ -35,7 +35,7 @@ class GtkCompositorWidget : public CompositorWidget,
|
|||
public:
|
||||
GtkCompositorWidget(const GtkCompositorWidgetInitData& aInitData,
|
||||
const layers::CompositorOptions& aOptions,
|
||||
nsWindow* aWindow = nullptr);
|
||||
nsWindow* aWindow /* = nullptr*/);
|
||||
~GtkCompositorWidget();
|
||||
|
||||
// CompositorWidget Overrides
|
||||
|
|
|
@ -16,6 +16,7 @@ struct GtkCompositorWidgetInitData
|
|||
uintptr_t XWindow;
|
||||
nsCString XDisplayString;
|
||||
bool Shaped;
|
||||
bool IsX11Display;
|
||||
|
||||
LayoutDeviceIntSize InitialClientSize;
|
||||
};
|
||||
|
|
|
@ -7844,11 +7844,12 @@ void nsWindow::GetCompositorWidgetInitData(
|
|||
XFlush(mXDisplay);
|
||||
}
|
||||
|
||||
bool isShaped =
|
||||
mIsTransparent && !mHasAlphaVisual && !mTransparencyBitmapForTitlebar;
|
||||
*aInitData = mozilla::widget::GtkCompositorWidgetInitData(
|
||||
(mXWindow != X11None) ? mXWindow : (uintptr_t) nullptr,
|
||||
mXDisplay ? nsCString(XDisplayString(mXDisplay)) : nsCString(),
|
||||
mIsTransparent && !mHasAlphaVisual && !mTransparencyBitmapForTitlebar,
|
||||
GetClientSize());
|
||||
mXDisplay ? nsCString(XDisplayString(mXDisplay)) : nsCString(), isShaped,
|
||||
mIsX11Display, GetClientSize());
|
||||
}
|
||||
|
||||
#ifdef MOZ_WAYLAND
|
||||
|
|
Загрузка…
Ссылка в новой задаче