Fix gdk_window_get_geometry for native children with non-native parent

gdk_window_get_geometry calls the native function for all non-native
windows. This returns coords relative to the native parent. We need
to convert this to be relative to the client side parent.

This fixes DnD coordinates in firefox (bug 588437).
This commit is contained in:
Alexander Larsson 2009-08-16 22:24:00 +02:00
parent 03018f1d01
commit 528546733f

View File

@ -7272,7 +7272,7 @@ gdk_window_get_geometry (GdkWindow *window,
gint *height,
gint *depth)
{
GdkWindowObject *private;
GdkWindowObject *private, *parent;
if (!window)
{
@ -7289,9 +7289,19 @@ gdk_window_get_geometry (GdkWindow *window,
if (!GDK_WINDOW_DESTROYED (window))
{
if (gdk_window_has_impl (private))
GDK_WINDOW_IMPL_GET_IFACE (private->impl)->get_geometry (window, x, y,
width, height,
depth);
{
GDK_WINDOW_IMPL_GET_IFACE (private->impl)->get_geometry (window, x, y,
width, height,
depth);
/* This reports the position wrt to the native parent, we need to convert
it to be relative to the client side parent */
parent = private->parent;
if (!gdk_window_has_impl (parent))
{
*x -= parent->abs_x;
*y -= parent->abs_y;
}
}
else
{
if (x)