gtk_widget_set_extension_events() is ignoring internal/input-only windows



Hi,

I've been looking into extension events a little bit more and I've come
to conclusion gtk_widget_set_extension_events() isn't quite working as
one would expect. Basically I have code something like this:

        for (GList *l = gdk_devices_list (); l ; l = l->next)
          {
            GdkDevice *device = l->data;
            if (device->source == GDK_SOURCE_PEN)
              gdk_device_set_mode (l->data, GDK_MODE_SCREEN);
          }
        
        button = gtk_button_new_with_label ("click");
        gtk_widget_set_extension_events (button, GDK_EXTENSION_EVENTS_ALL);
        
        view = gtk_text_view_new ();
        gtk_widget_set_extension_events (view, GDK_EXTENSION_EVENTS_ALL);


In "button-press-event" handlers for those widgets I'd expect to be able
to get the pressure information with gdk_event_get_axis () but I get
nothing.

>From what I can tell this is because the input events are delivered to a
GdkWindow which is different from widget->window
(GtkButton::event_window, GtkTextView::text_window::window, ...) and
thus the extension events are never enabled on the right window in
gtk_widget_realize.

Is this intentional? At least for me it would be more understandable if
gtk_widget_set_extension_events() worked without its current strange
restrictions.

As some of the windows are private this can not really be handled on
application side. Would a patch be acceptable which changes all widgets
that create internal windows for input events to set the extension
events for those windows as well?


Core events don't really provide any means for delivering pressure
information, which is why extended events are needed in the first place.
And the call to gdk_input_set_extension_events() needs to be added
somewhere.


-- 
Tommi Komulainen                            <tommi komulainen nokia com>



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