I am working on a pointer grab again and i am investigating serious
perfomance issues when grabbing ihe pointer or keyboard to receive the
events.
I am using the following construct to handle the events passed to my
application after grabbing the pointer (please see attached file for
complete demo):
----snip----
while(1){
while(!$done && Gtk2::Gdk->events_pending){
print "inner iteration\n";
my $event = $disp->get_event;
----snip----
After grabbing the pointer my app is eating up 50% of the cpu cycles (on
a slow machine up to 100%).
Can anyone give me a hint on how to use the grab-function more properly
and more effectively? Is this the normal way to receive events after a
pointer grab?
Thanks
Mario
Attachment:
screeny.pl
Description: Perl program