[gtk+/gtk-2-22] directfb: fix gdk_directfb_child_at



commit 4509240d0ef202c218e8b85b2229d326c9acf17c
Author: Lionel Landwerlin <llandwerlin gmail com>
Date:   Sat May 15 21:27:05 2010 +0200

    directfb: fix gdk_directfb_child_at
    
    When GDK looks for the window under pointer, the gdk-directfb backend
    looks at windows starting from the root window to the upper window in
    the stack. For this, it looks at window's size and position. This
    patch fix the assumption that windows are always natives windows from
    which we can retrieve backend's private data.
    
    Signed-off-by: Lionel Landwerlin <llandwerlin gmail com>

 gdk/directfb/gdkevents-directfb.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/gdk/directfb/gdkevents-directfb.c b/gdk/directfb/gdkevents-directfb.c
index 60048a7..fd32145 100644
--- a/gdk/directfb/gdkevents-directfb.c
+++ b/gdk/directfb/gdkevents-directfb.c
@@ -422,12 +422,13 @@ gdk_directfb_child_at (GdkWindow *window,
   for (list = private->children; list; list = list->next)
     {
       GdkWindowObject *win = list->data;
+      gint wx, wy, ww, wh;
+
+      gdk_window_get_geometry (GDK_WINDOW (win), &wx, &wy, &ww, &wh, NULL);
 
       if (GDK_WINDOW_IS_MAPPED (win) &&
-          *winx >= win->x  &&
-          *winx <  win->x + GDK_DRAWABLE_IMPL_DIRECTFB (win->impl)->width  &&
-          *winy >= win->y  &&
-          *winy <  win->y + GDK_DRAWABLE_IMPL_DIRECTFB (win->impl)->height)
+          *winx >= wx  && *winx <  wx + ww  &&
+          *winy >= wy  && *winy <  wy + wh)
         {
           *winx -= win->x;
           *winy -= win->y;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]