diff --git a/gfx/tests/gtest/TestCompositor.cpp b/gfx/tests/gtest/TestCompositor.cpp index 22bfd110edff..7a2556ae0276 100644 --- a/gfx/tests/gtest/TestCompositor.cpp +++ b/gfx/tests/gtest/TestCompositor.cpp @@ -82,7 +82,6 @@ public: virtual LayoutDeviceIntPoint WidgetToScreenOffset() override { return LayoutDeviceIntPoint(0, 0); } NS_IMETHOD DispatchEvent(mozilla::WidgetGUIEvent* aEvent, nsEventStatus& aStatus) override { return NS_OK; } - NS_IMETHOD CaptureRollupEvents(nsIRollupListener * aListener, bool aDoCapture) override { return NS_OK; } NS_IMETHOD_(void) SetInputContext(const InputContext& aContext, const InputContextAction& aAction) override {} NS_IMETHOD_(InputContext) GetInputContext() override { abort(); } diff --git a/widget/PuppetWidget.h b/widget/PuppetWidget.h index f727d348974c..3d2c907cc8bf 100644 --- a/widget/PuppetWidget.h +++ b/widget/PuppetWidget.h @@ -147,10 +147,6 @@ public: const mozilla::Maybe& aConstraints) override; bool AsyncPanZoomEnabled() const override; - NS_IMETHOD CaptureRollupEvents(nsIRollupListener* aListener, - bool aDoCapture) override - { return NS_ERROR_UNEXPECTED; } - NS_IMETHOD_(bool) ExecuteNativeKeyBinding(NativeKeyBindingsType aType, const mozilla::WidgetKeyboardEvent& aEvent, diff --git a/widget/android/nsWindow.h b/widget/android/nsWindow.h index 24f5f050ebb4..7162f477cc8b 100644 --- a/widget/android/nsWindow.h +++ b/widget/android/nsWindow.h @@ -181,9 +181,6 @@ public: NS_IMETHOD SetTitle(const nsAString& aTitle) override { return NS_OK; } NS_IMETHOD SetIcon(const nsAString& aIconSpec) override { return NS_OK; } NS_IMETHOD CaptureMouse(bool aCapture) override { return NS_ERROR_NOT_IMPLEMENTED; } - NS_IMETHOD CaptureRollupEvents(nsIRollupListener *aListener, - bool aDoCapture) override { return NS_ERROR_NOT_IMPLEMENTED; } - NS_IMETHOD GetAttention(int32_t aCycleCount) override { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHOD BeginResizeDrag(mozilla::WidgetGUIEvent* aEvent, int32_t aHorizontal, diff --git a/widget/cocoa/nsChildView.h b/widget/cocoa/nsChildView.h index 9b6df9033cd1..f609cfef8cdf 100644 --- a/widget/cocoa/nsChildView.h +++ b/widget/cocoa/nsChildView.h @@ -362,7 +362,6 @@ public: NS_IMETHOD SetCursor(nsCursor aCursor) override; NS_IMETHOD SetCursor(imgIContainer* aCursor, uint32_t aHotspotX, uint32_t aHotspotY) override; - NS_IMETHOD CaptureRollupEvents(nsIRollupListener * aListener, bool aDoCapture) override; NS_IMETHOD SetTitle(const nsAString& title) override; NS_IMETHOD GetAttention(int32_t aCycleCount) override; diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm index 7b62a193cd5c..9eb09a24cbea 100644 --- a/widget/cocoa/nsChildView.mm +++ b/widget/cocoa/nsChildView.mm @@ -1613,13 +1613,6 @@ LayoutDeviceIntPoint nsChildView::WidgetToScreenOffset() NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(LayoutDeviceIntPoint(0,0)); } -NS_IMETHODIMP nsChildView::CaptureRollupEvents(nsIRollupListener * aListener, - bool aDoCapture) -{ - // this never gets called, only top-level windows can be rollup widgets - return NS_OK; -} - NS_IMETHODIMP nsChildView::SetTitle(const nsAString& title) { // child views don't have titles diff --git a/widget/cocoa/nsCocoaWindow.h b/widget/cocoa/nsCocoaWindow.h index f5759c0acba6..27776b1e07eb 100644 --- a/widget/cocoa/nsCocoaWindow.h +++ b/widget/cocoa/nsCocoaWindow.h @@ -305,7 +305,8 @@ public: LayerManagerPersistence aPersistence = LAYER_MANAGER_CURRENT) override; NS_IMETHOD DispatchEvent(mozilla::WidgetGUIEvent* aEvent, nsEventStatus& aStatus) override; - NS_IMETHOD CaptureRollupEvents(nsIRollupListener * aListener, bool aDoCapture) override; + virtual void CaptureRollupEvents(nsIRollupListener * aListener, + bool aDoCapture) override; NS_IMETHOD GetAttention(int32_t aCycleCount) override; virtual bool HasPendingInputEvent() override; virtual nsTransparencyMode GetTransparencyMode() override; diff --git a/widget/cocoa/nsCocoaWindow.mm b/widget/cocoa/nsCocoaWindow.mm index 084b3c43bf27..6da31fdc8cbe 100644 --- a/widget/cocoa/nsCocoaWindow.mm +++ b/widget/cocoa/nsCocoaWindow.mm @@ -2060,9 +2060,11 @@ nsMenuBarX* nsCocoaWindow::GetMenuBar() return mMenuBar; } -NS_IMETHODIMP nsCocoaWindow::CaptureRollupEvents(nsIRollupListener* aListener, bool aDoCapture) +void +nsCocoaWindow::CaptureRollupEvents(nsIRollupListener* aListener, + bool aDoCapture) { - NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; + NS_OBJC_BEGIN_TRY_ABORT_BLOCK; gRollupListener = nullptr; @@ -2099,9 +2101,7 @@ NS_IMETHODIMP nsCocoaWindow::CaptureRollupEvents(nsIRollupListener* aListener, b [mWindow setLevel:NSModalPanelWindowLevel]; } - return NS_OK; - - NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT; + NS_OBJC_END_TRY_ABORT_BLOCK; } NS_IMETHODIMP nsCocoaWindow::GetAttention(int32_t aCycleCount) diff --git a/widget/gonk/nsWindow.h b/widget/gonk/nsWindow.h index 38a593e80748..6106982f938c 100644 --- a/widget/gonk/nsWindow.h +++ b/widget/gonk/nsWindow.h @@ -92,12 +92,6 @@ public: uint32_t aPointerOrientation, nsIObserver* aObserver) override; - NS_IMETHOD CaptureRollupEvents(nsIRollupListener *aListener, - bool aDoCapture) - { - return NS_ERROR_NOT_IMPLEMENTED; - } - virtual nsresult MakeFullScreen( bool aFullScreen, nsIScreen* aTargetScreen = nullptr) override; diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp index 7ce83b07aa11..6a7905273467 100644 --- a/widget/gtk/nsWindow.cpp +++ b/widget/gtk/nsWindow.cpp @@ -1890,15 +1890,15 @@ nsWindow::CaptureMouse(bool aCapture) return NS_OK; } -NS_IMETHODIMP +void nsWindow::CaptureRollupEvents(nsIRollupListener *aListener, bool aDoCapture) { if (!mGdkWindow) - return NS_OK; + return; if (!mContainer) - return NS_ERROR_FAILURE; + return; LOG(("CaptureRollupEvents %p %i\n", this, int(aDoCapture))); @@ -1921,8 +1921,6 @@ nsWindow::CaptureRollupEvents(nsIRollupListener *aListener, gtk_grab_remove(GTK_WIDGET(mContainer)); gRollupListener = nullptr; } - - return NS_OK; } NS_IMETHODIMP diff --git a/widget/gtk/nsWindow.h b/widget/gtk/nsWindow.h index 54d502d9afad..cfd4c7aece07 100644 --- a/widget/gtk/nsWindow.h +++ b/widget/gtk/nsWindow.h @@ -145,7 +145,7 @@ public: virtual void SetWindowClass(const nsAString& xulWinType) override; virtual LayoutDeviceIntPoint WidgetToScreenOffset() override; NS_IMETHOD CaptureMouse(bool aCapture) override; - NS_IMETHOD CaptureRollupEvents(nsIRollupListener *aListener, + virtual void CaptureRollupEvents(nsIRollupListener *aListener, bool aDoCapture) override; NS_IMETHOD GetAttention(int32_t aCycleCount) override; virtual nsresult SetWindowClipRegion(const nsTArray& aRects, diff --git a/widget/nsBaseWidget.h b/widget/nsBaseWidget.h index 4b632bb49a7d..5a2a3eda0685 100644 --- a/widget/nsBaseWidget.h +++ b/widget/nsBaseWidget.h @@ -141,6 +141,8 @@ public: // nsIWidget interface NS_IMETHOD CaptureMouse(bool aCapture) override; + virtual void CaptureRollupEvents(nsIRollupListener* aListener, + bool aDoCapture) override {} virtual nsIWidgetListener* GetWidgetListener() override; virtual void SetWidgetListener(nsIWidgetListener* alistener) override; virtual void Destroy() override; diff --git a/widget/nsIWidget.h b/widget/nsIWidget.h index 4034e5fb68c4..36d3ac04d70b 100644 --- a/widget/nsIWidget.h +++ b/widget/nsIWidget.h @@ -1395,7 +1395,8 @@ class nsIWidget : public nsISupports * @param aDoCapture true enables capture, false disables capture * */ - NS_IMETHOD CaptureRollupEvents(nsIRollupListener* aListener, bool aDoCapture) = 0; + virtual void CaptureRollupEvents(nsIRollupListener* aListener, + bool aDoCapture) = 0; /** * Bring this window to the user's attention. This is intended to be a more diff --git a/widget/uikit/nsWindow.h b/widget/uikit/nsWindow.h index c936f5cd3020..cb18c090692c 100644 --- a/widget/uikit/nsWindow.h +++ b/widget/uikit/nsWindow.h @@ -80,10 +80,6 @@ public: virtual nsresult ConfigureChildren(const nsTArray& aConfigurations) override; NS_IMETHOD DispatchEvent(mozilla::WidgetGUIEvent* aEvent, nsEventStatus& aStatus) override; - NS_IMETHOD CaptureRollupEvents(nsIRollupListener * aListener, - bool aDoCapture) override { - return NS_ERROR_NOT_IMPLEMENTED; - } void WillPaintWindow(); bool PaintWindow(LayoutDeviceIntRegion aRegion); diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp index 5eb95442ec4a..844c60357c05 100644 --- a/widget/windows/nsWindow.cpp +++ b/widget/windows/nsWindow.cpp @@ -3565,8 +3565,8 @@ NS_IMETHODIMP nsWindow::CaptureMouse(bool aCapture) * **************************************************************/ -NS_IMETHODIMP nsWindow::CaptureRollupEvents(nsIRollupListener * aListener, - bool aDoCapture) +void +nsWindow::CaptureRollupEvents(nsIRollupListener* aListener, bool aDoCapture) { if (aDoCapture) { gRollupListener = aListener; @@ -3579,8 +3579,6 @@ NS_IMETHODIMP nsWindow::CaptureRollupEvents(nsIRollupListener * aListener, sProcessHook = false; UnregisterSpecialDropdownHooks(); } - - return NS_OK; } /************************************************************** diff --git a/widget/windows/nsWindow.h b/widget/windows/nsWindow.h index 4275965d0494..9507f0c6e240 100644 --- a/widget/windows/nsWindow.h +++ b/widget/windows/nsWindow.h @@ -167,7 +167,7 @@ public: nsEventStatus& aStatus) override; virtual void EnableDragDrop(bool aEnable) override; NS_IMETHOD CaptureMouse(bool aCapture) override; - NS_IMETHOD CaptureRollupEvents(nsIRollupListener * aListener, + virtual void CaptureRollupEvents(nsIRollupListener* aListener, bool aDoCapture) override; NS_IMETHOD GetAttention(int32_t aCycleCount) override; virtual bool HasPendingInputEvent() override;