Re: Problems in GdkWindow Events with Gtk - DirectFb backend



Hi Attilioa,

As the sample program mentioned below I am creating a GdkWindow.
While porting Gtk for DirectFb, Is  gdk_window_new() and
gdk_window_add_filter() are not proted to support DirectFb?

The problem of Events not working on GdkWindow, is this issue related
to Gtk code or DirectFb code or ported code?
Please give me your ideas to solve the issue.


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,
Sreenivas
On Nov 27, 2007 7:02 PM, Attilio Fiandrotti
<attilio fiandrotti gmail com> wrote:
> Sreenivas Chowdary wrote:
> > 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.
>
> The code in the DirectFB backends that produces the GDK events works
> reasonably well in many cases, while there are cases where some
> functionalities are still unimplemented/broken.
> You should file a BR [1] against the directfb component and you may have
> a look at the code in the DirectFB backend [2] and try to produce a
> patch for the unimplemented/broken functionalities.
>
> regards
>
> Attilio Fiandrotti
>
> [1]
> http://bugzilla.gnome.org/buglist.cgi?query=component%3Adirectfb+product%3Agtk%2B+
> [2]
> http://svn.gnome.org/viewvc/gtk%2B/trunk/gdk/directfb/gdkevents-directfb.c?view=markup
>


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