Simon Budig wrote:
> If XGrabKey might fail you can wrap it similiar to this:
>
> gdk_error_trap_push ();
> XGrabKey (GDK_DISPLAY_XDISPLAY (data->display),
> data->hot_keycode,
> AnyModifier,
> GDK_WINDOW_XWINDOW (data->root),
> TRUE,
> GrabModeAsync,
> GrabModeAsync);
> gdk_flush ();
> if (gdk_error_trap_pop ())
> {
> g_printerr ("could not grab Hotkey. Aborting...\n");
> exit (1);
> }
Thanks for the hint. I tried wrapping the XGrabKey call in
a gdk_error_trap_push/pop pair, and it seems to do the trick.
(I don't see any reason for the plug-in to bail out just because
the ESC key can't be grabbed.)
>From the ChangeLog for HEAD:
2005-06-01 Bill Skaggs <[EMAIL PROTECTED]>
* plug-ins/common/screenshot.c: trap errors when running
XGrabKey, to prevent bail-out on BadAccess error as
reported by Jean-Luc Coulon on developers list; solution
suggested by Simon Budig.
It would probably have been better to do all this via Bugzilla, by
the way.
-- Bill
______________ ______________ ______________ ______________
Sent via the CNPRC Email system at primate.ucdavis.edu
_______________________________________________
Gimp-developer mailing list
[email protected]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer