x11: Get rid of gdk_drawable_get_size() usage

This commit is contained in:
Benjamin Otte
2010-09-20 12:52:26 +02:00
parent 6c971ac479
commit e8e657725c
4 changed files with 24 additions and 24 deletions

View File

@ -102,15 +102,16 @@ gdk_test_simulate_key (GdkWindow *window,
g_return_val_if_fail (window != NULL, FALSE);
if (!GDK_WINDOW_IS_MAPPED (window))
return FALSE;
screen = gdk_window_get_screen (window);
priv = (GdkWindowObject *)window;
if (x < 0 && y < 0)
{
gdk_drawable_get_size (window, &x, &y);
x /= 2;
y /= 2;
x = priv->width / 2;
y = priv->height / 2;
}
priv = (GdkWindowObject *)window;
/* Convert to impl coordinates */
x = x + priv->abs_x;
y = y + priv->abs_y;
@ -208,15 +209,16 @@ gdk_test_simulate_button (GdkWindow *window,
if (!GDK_WINDOW_IS_MAPPED (window))
return FALSE;
screen = gdk_window_get_screen (window);
priv = (GdkWindowObject *)window;
if (x < 0 && y < 0)
{
gdk_drawable_get_size (window, &x, &y);
x /= 2;
y /= 2;
x = priv->width / 2;
y = priv->height / 2;
}
priv = (GdkWindowObject *)window;
/* Convert to impl coordinates */
x = x + priv->abs_x;
y = y + priv->abs_y;