Hi, this is my code:
img_struct->image_area = gtk_drawing_area_new();
gtk_container_add(GTK_CONTAINER(vbox), img_struct->image_area);
gtk_widget_set_size_request(img_struct->image_area, 800, 450);
gtk_widget_set_hexpand(img_struct->image_area, TRUE);
gtk_widget_set_vexpand(img_struct->image_area, TRUE);
gtk_widget_set_halign(img_struct->image_area, GTK_ALIGN_CENTER);
gtk_widget_set_valign(img_struct->image_area, GTK_ALIGN_CENTER);
gtk_widget_set_events(img_struct->image_area,
GDK_KEY_PRESS_MASK
| GDK_BUTTON_PRESS_MASK
| GDK_BUTTON_RELEASE_MASK
| GDK_POINTER_MOTION_MASK);
gtk_widget_set_can_focus(img_struct->image_area, TRUE);
gtk_widget_grab_focus(img_struct->image_area);
g_signal_connect(img_struct->image_area , "draw", G_CALLBACK( img_on_draw_event ), img_struct );
g_signal_connect(img_struct->image_area , "button-press-event", G_CALLBACK( img_image_area_button_press ), img_struct );
g_signal_connect(img_struct->image_area , "button-release-event",G_CALLBACK( img_image_area_button_release ), img_struct );
g_signal_connect(img_struct->image_area , "motion-notify-event", G_CALLBACK( img_image_area_motion ), img_struct);
g_signal_connect(img_struct->image_area , "key-press-event", G_CALLBACK(img_image_area_key_press), img_struct);
This code is part of a bigger application with accel group and another key-press-event set on the main window which contains the drawing area. Removing such event and the accel didn’t solve the problem.
Can anyone point me how to debug this annoying issue? It’s driving me nuts.