On Sat, Mar 21, 2009 at 9:16 PM, Sven Neumann <s...@gimp.org> wrote: > Hi, > > On Sat, 2009-03-21 at 18:34 +0530, Srikanth Nori wrote: > >> I'm using GTK+ over DirectFB on an embedded device. I need to move the >> mouse pointer, and from the GDK docs it appears that the only function >> to do this is gdk_display_warp_pointer. However, this is not >> implemented in GDK-DirectFB. gdk_display_warp_pointer in >> gdkwindow-directfb.c prints "gdk_display_warp_pointer() not >> implemented" >> >> Is there any other way I can do move the mouse pointer? Any >> help/suggestions will be really helpful.. Thanks! > > Why don't you implement gdk_display_warp_pointer() in GDK-DirectFB using > IDirectFBDisplayLayer::WarpCursor ? Shouldn't be difficult and if you > send me the patch I can include it in upstream GTK+. > > > Sven
Sven Thanks a lot! I tried to implement gdk_display_warp_pointer using IDirectFBDisplayLayer::WarpCursor like so: void gdk_display_warp_pointer (GdkDisplay *display, GdkScreen *screen, gint x, gint y) { /* g_warning ("gdk_display_warp_pointer() not implemented.\n"); */ IDirectFBDisplayLayer *layer = _gdk_display->layer; DFBResult result = -1; result = layer->WarpCursor(layer, x, y); } But the WarpCursor function returned error since the IDirectFBDisplayLayer_WarpCursor function checks this if (data->level == DLSCL_SHARED) return DFB_ACCESSDENIED; This check was failing (i.e. data->level was set to DLSCL_SHARED) so it would return DFB_ACCESSDENIED I'm not very familiar with the internals of DirectFB, so I didn't know what this meant. However, as a quick and dirty hack, i removed this check, and I can see the pointer is moving! However, it still doesn't work completely. I was trying to move the pointer over a button, and get an event for that operation, but it appears that GTK/GDK is not recognizing the mouse movement event. What can I do to get GTK/GDK to recognize this mouse movement? Regards, Srikanth _______________________________________________ directfb-dev mailing list directfb-dev@directfb.org http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev