зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1296993 (part 8) - Streamline nsIWidget::CaptureMouse. r=mstange.
This patch does the following. - Removes the return value, because none of the call sites check it. - Removes the empty implementations from several nsIWidget instances, because they can use the nsBaseWidget one. --HG-- extra : rebase_source : 1c42bb32a662f2659c934a245ecd0025045120a5
This commit is contained in:
Родитель
346d5f4895
Коммит
5bf56904c4
|
@ -180,7 +180,6 @@ public:
|
|||
void SetNativeData(uint32_t aDataType, uintptr_t aVal) override;
|
||||
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 GetAttention(int32_t aCycleCount) override { return NS_ERROR_NOT_IMPLEMENTED; }
|
||||
NS_IMETHOD BeginResizeDrag(mozilla::WidgetGUIEvent* aEvent,
|
||||
int32_t aHorizontal,
|
||||
|
|
|
@ -1867,16 +1867,16 @@ nsWindow::WidgetToScreenOffset()
|
|||
return GdkPointToDevicePixels({ x, y });
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
void
|
||||
nsWindow::CaptureMouse(bool aCapture)
|
||||
{
|
||||
LOG(("CaptureMouse %p\n", (void *)this));
|
||||
|
||||
if (!mGdkWindow)
|
||||
return NS_OK;
|
||||
return;
|
||||
|
||||
if (!mContainer)
|
||||
return NS_ERROR_FAILURE;
|
||||
return;
|
||||
|
||||
if (aCapture) {
|
||||
gtk_grab_add(GTK_WIDGET(mContainer));
|
||||
|
@ -1886,8 +1886,6 @@ nsWindow::CaptureMouse(bool aCapture)
|
|||
ReleaseGrabs();
|
||||
gtk_grab_remove(GTK_WIDGET(mContainer));
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -144,7 +144,7 @@ public:
|
|||
NS_IMETHOD SetIcon(const nsAString& aIconSpec) override;
|
||||
virtual void SetWindowClass(const nsAString& xulWinType) override;
|
||||
virtual LayoutDeviceIntPoint WidgetToScreenOffset() override;
|
||||
NS_IMETHOD CaptureMouse(bool aCapture) override;
|
||||
virtual void CaptureMouse(bool aCapture) override;
|
||||
virtual void CaptureRollupEvents(nsIRollupListener *aListener,
|
||||
bool aDoCapture) override;
|
||||
NS_IMETHOD GetAttention(int32_t aCycleCount) override;
|
||||
|
|
|
@ -420,11 +420,6 @@ void nsBaseWidget::BaseCreate(nsIWidget* aParent,
|
|||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsBaseWidget::CaptureMouse(bool aCapture)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
// Accessor functions to get/set the client data
|
||||
|
|
|
@ -140,7 +140,7 @@ public:
|
|||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIWidget interface
|
||||
NS_IMETHOD CaptureMouse(bool aCapture) override;
|
||||
virtual void CaptureMouse(bool aCapture) override {}
|
||||
virtual void CaptureRollupEvents(nsIRollupListener* aListener,
|
||||
bool aDoCapture) override {}
|
||||
virtual nsIWidgetListener* GetWidgetListener() override;
|
||||
|
|
|
@ -1381,7 +1381,7 @@ class nsIWidget : public nsISupports
|
|||
* @param aCapture true enables mouse capture, false disables mouse capture
|
||||
*
|
||||
*/
|
||||
NS_IMETHOD CaptureMouse(bool aCapture) = 0;
|
||||
virtual void CaptureMouse(bool aCapture) = 0;
|
||||
|
||||
/**
|
||||
* Classify the window for the window manager. Mostly for X11.
|
||||
|
|
|
@ -3537,7 +3537,7 @@ nsWindow::EnableDragDrop(bool aEnable)
|
|||
*
|
||||
**************************************************************/
|
||||
|
||||
NS_IMETHODIMP nsWindow::CaptureMouse(bool aCapture)
|
||||
void nsWindow::CaptureMouse(bool aCapture)
|
||||
{
|
||||
TRACKMOUSEEVENT mTrack;
|
||||
mTrack.cbSize = sizeof(TRACKMOUSEEVENT);
|
||||
|
@ -3552,7 +3552,6 @@ NS_IMETHODIMP nsWindow::CaptureMouse(bool aCapture)
|
|||
}
|
||||
sIsInMouseCapture = aCapture;
|
||||
TrackMouseEvent(&mTrack);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/**************************************************************
|
||||
|
|
|
@ -166,7 +166,7 @@ public:
|
|||
NS_IMETHOD DispatchEvent(mozilla::WidgetGUIEvent* aEvent,
|
||||
nsEventStatus& aStatus) override;
|
||||
virtual void EnableDragDrop(bool aEnable) override;
|
||||
NS_IMETHOD CaptureMouse(bool aCapture) override;
|
||||
virtual void CaptureMouse(bool aCapture) override;
|
||||
virtual void CaptureRollupEvents(nsIRollupListener* aListener,
|
||||
bool aDoCapture) override;
|
||||
NS_IMETHOD GetAttention(int32_t aCycleCount) override;
|
||||
|
|
Загрузка…
Ссылка в новой задаче