mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-03 12:35:58 +00:00
Implement ScreenToWidget for Bug 388359. patch by Karl Tomlinson, r+sr=roc
This commit is contained in:
parent
708bb0ec77
commit
955e5d5a58
@ -1404,7 +1404,22 @@ nsWindow::WidgetToScreen(const nsRect& aOldRect, nsRect& aNewRect)
|
||||
NS_IMETHODIMP
|
||||
nsWindow::ScreenToWidget(const nsRect& aOldRect, nsRect& aNewRect)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
gint x = 0, y = 0;
|
||||
|
||||
if (mContainer) {
|
||||
gdk_window_get_root_origin(GTK_WIDGET(mContainer)->window,
|
||||
&x, &y);
|
||||
}
|
||||
else if (mDrawingarea) {
|
||||
gdk_window_get_origin(mDrawingarea->inner_window, &x, &y);
|
||||
}
|
||||
|
||||
aNewRect.x = aOldRect.x - x;
|
||||
aNewRect.y = aOldRect.y - y;
|
||||
aNewRect.width = aOldRect.width;
|
||||
aNewRect.height = aOldRect.height;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
Loading…
x
Reference in New Issue
Block a user