From 9de2f4b9cc902f4e0fa1530249a6650501685b13 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Thu, 13 May 2010 16:09:49 +0200 Subject: [PATCH] directfb: get rid of abs_x,abs_y computation within the backend The computation of abs_x,abs_y is done by the generic code of GDK when events are raised. We don't care about that anymore. Signed-off-by: Lionel Landwerlin --- gdk/directfb/gdkevents-directfb.c | 3 -- gdk/directfb/gdkgeometry-directfb.c | 2 -- gdk/directfb/gdkprivate-directfb.h | 2 -- gdk/directfb/gdkwindow-directfb.c | 46 ++--------------------------- 4 files changed, 2 insertions(+), 51 deletions(-) diff --git a/gdk/directfb/gdkevents-directfb.c b/gdk/directfb/gdkevents-directfb.c index e979526a99..bf14104edc 100644 --- a/gdk/directfb/gdkevents-directfb.c +++ b/gdk/directfb/gdkevents-directfb.c @@ -722,7 +722,6 @@ gdk_event_translate (DFBWindowEvent *dfbevent, GDK_DRAWABLE_IMPL_DIRECTFB (private->impl)->height; } - _gdk_directfb_calc_abs (window); } break; @@ -766,8 +765,6 @@ gdk_event_translate (DFBWindowEvent *dfbevent, impl->width, impl->height); } - _gdk_directfb_calc_abs (window); - gdk_window_clear (window); gdk_window_invalidate_rect (window, NULL, TRUE); } diff --git a/gdk/directfb/gdkgeometry-directfb.c b/gdk/directfb/gdkgeometry-directfb.c index 01e52f7c8c..d3bd692467 100644 --- a/gdk/directfb/gdkgeometry-directfb.c +++ b/gdk/directfb/gdkgeometry-directfb.c @@ -136,8 +136,6 @@ _gdk_directfb_window_scroll (GdkWindow *window, obj_impl->height); } - _gdk_directfb_calc_abs (window); - if (invalidate_region) { gdk_window_invalidate_region (window, invalidate_region, TRUE); diff --git a/gdk/directfb/gdkprivate-directfb.h b/gdk/directfb/gdkprivate-directfb.h index d362473eb2..06e5ab32ec 100644 --- a/gdk/directfb/gdkprivate-directfb.h +++ b/gdk/directfb/gdkprivate-directfb.h @@ -170,8 +170,6 @@ void gdk_directfb_window_send_crossing_events (GdkWindow *src, GdkWindow *dest, GdkCrossingMode mode); -void _gdk_directfb_calc_abs (GdkWindow *window); - GdkWindow * gdk_directfb_window_find_toplevel (GdkWindow *window); diff --git a/gdk/directfb/gdkwindow-directfb.c b/gdk/directfb/gdkwindow-directfb.c index 1f6a5f613d..28b2fca31f 100644 --- a/gdk/directfb/gdkwindow-directfb.c +++ b/gdk/directfb/gdkwindow-directfb.c @@ -366,8 +366,6 @@ gdk_directfb_window_new (GdkWindow *parent, private->x = x; private->y = y; - _gdk_directfb_calc_abs (window); - impl->drawable.width = MAX (1, attributes->width); impl->drawable.height = MAX (1, attributes->height); @@ -559,8 +557,6 @@ _gdk_window_impl_new (GdkWindow *window, private->parent = parent_private; - _gdk_directfb_calc_abs (window); - impl->drawable.width = MAX (1, attributes->width); impl->drawable.height = MAX (1, attributes->height); @@ -1432,7 +1428,6 @@ gdk_directfb_window_move (GdkWindow *window, GdkRectangle old = { private->x, private->y,width,height }; _gdk_directfb_move_resize_child (window, x, y, width, height); - _gdk_directfb_calc_abs (window); if (GDK_WINDOW_IS_MAPPED (private)) { @@ -1525,7 +1520,6 @@ gdk_directfb_window_move_resize (GdkWindow *window, _gdk_directfb_move_resize_child (window, new.x, new.y, new.width, new.height); - _gdk_directfb_calc_abs (window); if (GDK_WINDOW_IS_MAPPED (private)) { @@ -1944,39 +1938,6 @@ gdk_directfb_window_get_geometry (GdkWindow *window, } } -void -_gdk_directfb_calc_abs (GdkWindow *window) -{ - GdkWindowObject *private; - GdkDrawableImplDirectFB *impl; - GList *list; - - g_return_if_fail (GDK_IS_WINDOW (window)); - - private = GDK_WINDOW_OBJECT (window); - impl = GDK_DRAWABLE_IMPL_DIRECTFB (private->impl); - - impl->abs_x = private->x; - impl->abs_y = private->y; - - if (private->parent) - { - GdkDrawableImplDirectFB *parent_impl = - GDK_DRAWABLE_IMPL_DIRECTFB (GDK_WINDOW_OBJECT (private->parent)->impl); - - impl->abs_x += parent_impl->abs_x; - impl->abs_y += parent_impl->abs_y; - } - - D_DEBUG_AT (GDKDFB_Window, "%s( %p ) -> %4d,%4d\n", G_STRFUNC, - window, impl->abs_x, impl->abs_y); - - for (list = private->children; list; list = list->next) - { - _gdk_directfb_calc_abs (list->data); - } -} - static gboolean gdk_directfb_window_get_deskrelative_origin (GdkWindow *window, gint *x, @@ -2597,7 +2558,8 @@ gdk_directfb_create_child_window (GdkWindow *parent, private->x = x; private->y = y; - _gdk_directfb_calc_abs (window); + private->abs_x = 0; + private->abs_y = 0; impl->drawable.width = w; impl->drawable.height = h; @@ -2683,10 +2645,6 @@ gdk_window_foreign_new_for_display (GdkDisplay* display, GdkNativeWindow anid) private->input_only = TRUE; impl->drawable.surface = NULL; } - /* - * Position ourselevs - */ - _gdk_directfb_calc_abs (window); /* We default to all events least surprise to the user * minus the poll for motion events