diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp index 37745acc3329..0e5314d2ad6f 100644 --- a/widget/gtk/nsWindow.cpp +++ b/widget/gtk/nsWindow.cpp @@ -408,7 +408,6 @@ nsWindow::nsWindow() mPanInProgress(false), mDrawToContainer(false), mTitlebarBackdropState(false), - mIsPIPWindow(false), mIsWaylandPanelWindow(false), mIsChildWindow(false), mAlwaysOnTop(false), @@ -5908,7 +5907,6 @@ nsresult nsWindow::Create(nsIWidget* aParent, nsNativeWidget aNativeParent, } mAlwaysOnTop = aInitData && aInitData->mAlwaysOnTop; - mIsPIPWindow = aInitData && aInitData->mPIPWindow; // mNoAutoHide seems to be always false here. // The mNoAutoHide state is set later on nsMenuPopupFrame level // and can be changed so we use WaylandPopupIsPermanent() to get diff --git a/widget/gtk/nsWindow.h b/widget/gtk/nsWindow.h index d80cdde02a28..fa90621be478 100644 --- a/widget/gtk/nsWindow.h +++ b/widget/gtk/nsWindow.h @@ -658,8 +658,6 @@ class nsWindow final : public nsBaseWidget { bool mDrawToContainer : 1; // Draw titlebar with :backdrop css state (inactive/unfocused). bool mTitlebarBackdropState : 1; - // It's PictureInPicture window. - bool mIsPIPWindow : 1; // It's undecorated popup utility window, without resizers/titlebar, // movable by mouse. Used on Wayland for popups without // parent (for instance WebRTC sharing indicator, notifications). diff --git a/widget/nsBaseWidget.cpp b/widget/nsBaseWidget.cpp index b723ebd4dfb4..a872c904e2b8 100644 --- a/widget/nsBaseWidget.cpp +++ b/widget/nsBaseWidget.cpp @@ -154,7 +154,8 @@ nsBaseWidget::nsBaseWidget(BorderStyle aBorderStyle) mIMEHasQuit(false), mIsFullyOccluded(false), mNeedFastSnaphot(false), - mCurrentPanGestureBelongsToSwipe(false) { + mCurrentPanGestureBelongsToSwipe(false), + mIsPIPWindow(false) { #ifdef NOISY_WIDGET_LEAKS gNumWidgets++; printf("WIDGETS+ = %d\n", gNumWidgets); @@ -419,6 +420,7 @@ void nsBaseWidget::BaseCreate(nsIWidget* aParent, widget::InitData* aInitData) { mPopupLevel = aInitData->mPopupLevel; mPopupType = aInitData->mPopupHint; mHasRemoteContent = aInitData->mHasRemoteContent; + mIsPIPWindow = aInitData->mPIPWindow; } if (aParent) { @@ -2313,6 +2315,7 @@ nsBaseWidget::SwipeInfo nsBaseWidget::SendMayStartSwipe( WidgetWheelEvent nsBaseWidget::MayStartSwipeForAPZ( const PanGestureInput& aPanInput, const APZEventResult& aApzResult) { WidgetWheelEvent event = aPanInput.ToWidgetEvent(this); + if (aPanInput.AllowsSwipe()) { SwipeInfo swipeInfo = SendMayStartSwipe(aPanInput); event.mCanTriggerSwipe = swipeInfo.wantsSwipe; diff --git a/widget/nsBaseWidget.h b/widget/nsBaseWidget.h index 0ac102f71dbc..4b7c963e9376 100644 --- a/widget/nsBaseWidget.h +++ b/widget/nsBaseWidget.h @@ -674,6 +674,8 @@ class nsBaseWidget : public nsIWidget, public nsSupportsWeakReference { void FreeShutdownObserver(); void FreeLocalesChangedObserver(); + bool IsPIPWindow() const { return mIsPIPWindow; }; + nsIWidgetListener* mWidgetListener; nsIWidgetListener* mAttachedWidgetListener; nsIWidgetListener* mPreviouslyAttachedWidgetListener; @@ -721,6 +723,9 @@ class nsBaseWidget : public nsIWidget, public nsSupportsWeakReference { // a PANGESTURE_(MAY)START event). bool mCurrentPanGestureBelongsToSwipe; + // It's PictureInPicture window. + bool mIsPIPWindow : 1; + struct InitialZoomConstraints { InitialZoomConstraints(const uint32_t& aPresShellID, const ScrollableLayerGuid::ViewID& aViewID,