Re: Subsribing to unknown events



redhog@mini.dhs.org wrote:
> 
> The question:
> 
> Is it possible for an application to be noticed about X-events for windows
> that are not widgets?
> 
>  From what I can see, reading the source of the main-loop, all events
> coming from a non-widget window, are sent to the selection-code. If it
> finds it's not a dlete-property event, it discards it.
> 
>  Is this true? Is there a possibility to hook in somewhere, getting those
> events?
> 
>  I need this, while I have an application that gtk_socket_steal():s other
> application's main windows into it. And if those applications dies (Their
> windows are destroyed), I want to be notified, so that my application can
> remove some widgets, create some widgets or possibly exit...
> With best regards,
> Egil Möller
> 

I believe that the way to do this is to make a gdk window
corresponding to the other application's main window, using
gdk_window_foreign_new(). You can then call gdk_window_add_filter() on
that window to register a filter function which will see all events,
and can allow processing as normal, or discard the events, as
required. (The code which implements this is in gdkevents.c)

Simon.

 
> 
> --
>          To unsubscribe: mail gtk-devel-list-request@redhat.com with
>                        "unsubscribe" as the Subject.



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