gtk is grabbing my input, how do I stop it...



I have an app which I'm porting over to use Gnome/gtk+, using glade as a
gui builder.  The GUI is actually pretty simple, just a couple of menus
and a couple of dialog boxes.

The app was originally written using OpenLook, then ported to Motif,
and is now being re-ported to Gnome.  Each port has been painful due
to the way the various toolkits get ingrained into the application...

My intent this time is to do sort of a skins approach, where the behavior
of the application is done independently of the GUI used (in as much as
that is possible), and that the GUI should be easily replacable, or even
removable entirely.  The app requires mouse and keyboard input on it's top
level window.  So far I have the app running with no GUI, and I've come 
up with a very simple Gnome gui using glade.  I simply want to reparent 
my application window inside of the Gnome Application Window, and have my
app manage all it's own cursor and keyboard input, while it's in my window.
When I move outside my window, into the Gnome App Window with the menus,
etc, then gtk should handle events.

I don't want to use grabs if I can help it.  I don't think they'd
work for this problem even if I did try using them.

I'm currently doing select in my code, and depending on where data
is coming from (my app X11 connection, gtk's X11 connection, or other
open file descriptors) I dispatch the events appropriately...  

When I have my app window and the Gnome App Window both be a child of 
the root (i.e. peers) everything works correctly in each window.  I get
input to my app, and gtk gets it's input, menus work, etc...

However, when I reparent my app window into the Gnome App Window it
seems that when I enter the Gnome App Window gtk is doing some sort
of grab.  I get an enter then a leave and FocusOut event on my window, 
with no other kbd/mouse input, ever...  gtk seems to be eating it on me...

How do I make it stop this behavior?  I've tried making the widgets
insensitive, but that doesn't seem to work...  I don't want to use the
socket and plug mechanism, because of the extra overhead/latency of 
forwarding events through the X server, and I really don't want to
have gtk running the show for me, dispatching requests, again because
of the extra overhead, although if I have to I will.

Suggestions?

--Al Amaral--



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