Problems in GdkWindow Events with Gtk - DirectFb backend



Hi,

I am facing an issue to get events on GdkWindow which was built with
Gtk DirectFb backend.

In sample program i am creating a toplevel GdkWindow and creating a
child Gdkwindow.
While creating GdkWindow i have added events mask, and used
gdk_window_add_filter() function to add event handler callback to
GdkWindow.
While running executable I am not getting any events (Key press,
expose, button press etc..).
With same program we are getting events on Gtk - X11 backend.

Is Events handling implementation for GdkWindow with DirectFb backend
implemented or not?
Please suggest me how to get events on GdkWindow with DFB backend.


Sample program is this-
--------------------------------------------------------------------------------
#include <gtk/gtk.h>
#include <gdk/gdk.h>

GdkFilterReturn child_handle_event( void *event1, GdkEvent *event2,
gpointer userdata )
{
        g_printf("child_handle_event\n");
}


int main(int argc, char* argv[])
{

        GdkWindow *parent, *child;
        GdkWindowAttr attr;

        gtk_init(&argc, &argv);

        attr.event_mask = GDK_VISIBILITY_NOTIFY_MASK | GDK_EXPOSURE_MASK |
        GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK |
GDK_BUTTON_PRESS_MASK |
        GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK |
        GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK ;
        attr.x = 100;
        attr.y = 100;
        attr.width = 800;
        attr.height = 600;
        attr.window_type = GDK_WINDOW_TOPLEVEL;
        attr.wclass = GDK_INPUT_OUTPUT;
        parent = gdk_window_new (NULL, &attr, GDK_WA_X | GDK_WA_Y);

        attr.event_mask = GDK_VISIBILITY_NOTIFY_MASK | GDK_EXPOSURE_MASK |
        GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK |
GDK_BUTTON_PRESS_MASK |
        GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK |
        GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK;
        attr.x = 200;
        attr.y = 200;
        attr.width = 400;
        attr.height = 300;
        attr.window_type = GDK_WINDOW_CHILD;
        attr.wclass = GDK_INPUT_OUTPUT;
        child = gdk_window_new (parent, &attr, GDK_WA_X | GDK_WA_Y);

        gdk_window_add_filter (child, child_handle_event, NULL);

        gdk_window_show (child);
        gdk_window_show (parent);

        gtk_main();
        
}
-------------------------------------------------------------------------------------------


Thanks & Regards
Sreenivas

Attachment: gdkwinevents.c
Description: Text document



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