[gdk/directfb] Wrong GDK events delivered sometimes


i recently noticed the directfb backend delivers, in some cases, different gdk events from the x11 backend.
The attached app exploits the issue by packing a widget inside a gtkwindow.

With gdk/x11 the toplevel gdkwindow is sent these events when the cursor moves from the toplevel gdkwindow to the textview's window and back to the toplevel gdkwindow

- moving cursor on textview
2 gdkwindow 134614304 receives event GDK_LEAVE_NOTIFY

- moving cursor back to toplevel gdkwindow
3 gdkwindow 134614304 receives event GDK_ENTER_NOTIFY

and this is what i get with gtk/dfb

- moving cursor on textview
5 gdkwindow 134814896 receives event GDK_ENTER_NOTIFY

- moving cursor back to toplevel gdkwindow
6 gdkwindow 134814896 receives event GDK_LEAVE_NOTIFY

As you can see, gdk events are swapped if compared to gtk/x11: is this something expected or a is this a bug ? This causes nasty vusual effect, like the cursor to remain "I" shaped even after leaving a gtkentry or gtktextview. Moreover, if the gtkentry is replaced with a textview, a flood of enter/leave events is generated, which does not happen with gtk/x11.
Shall i start to dig into this?


#include <gtk/gtk.h>

int static evtcnt = 0;

static gboolean expose_event_callback(GtkWidget *widget, GdkEvent *event, void *data)

	if (event->type == GDK_ENTER_NOTIFY || event->type == GDK_LEAVE_NOTIFY ) {
		printf ("%d ", evtcnt);
		if (event->type == GDK_ENTER_NOTIFY)
			printf("gdkwindow %d receives event GDK_ENTER_NOTIFY\n", (int)widget->window);
		if (event->type ==  GDK_LEAVE_NOTIFY)
			printf("gdkwindow %d receives event GDK_LEAVE_NOTIFY\n", (int)widget->window);	
	return FALSE;

int main ( int   argc, char *argv[] )
    GtkWidget *window, *hbox, *vbox, *widget;
    gtk_init (&argc, &argv);
    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    gtk_widget_set_size_request (window, 400, 300);
    widget = gtk_entry_new();
//    widget = gtk_text_view_new();
	hbox = gtk_hbox_new (TRUE, 0);
	vbox = gtk_vbox_new (TRUE, 0);
	gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 50);
	gtk_box_pack_start (GTK_BOX (vbox), widget, TRUE, TRUE, 50);
	gtk_container_add (GTK_CONTAINER (window), hbox);
    g_signal_connect_after (G_OBJECT (window), "event", G_CALLBACK (expose_event_callback), NULL);
    gtk_widget_show_all (window);
    gtk_main ();

    return 0;

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