Hi,
On Sun, May 07, 2006 at 04:20:50PM -0400, Vincent Povirk wrote:
I found a patch from about 3 years ago for implementing RegisterHotKey and UnregisterHotKey. I've updated it to apply to the current wine source tree and essentially copied what metacity does to cover any missing functionality.
The original patch is here: http://www.winehq.com/hypermail/wine-devel/2003/02/0636.html
Unfortunately, trying to register an in-use hotkey with this patch causes a crash:
X Error of failed request: BadAccess (attempt to access private resource denied) Major opcode of failed request: 33 (X_GrabKey) Serial number of failed request: 58 Current serial number in output stream: 62
RegisterHotKey is implemented as if XGrabKey returns 0 if it fails. Do I need to do something special to "watch" for the error?
I've been searching for X_GrabKey protocol error examples, but it wasn't too interesting. The only relatively interesting URL is http://archives.neohapsis.com/archives/openbsd/2004-06/0255.html where they say that x2vnc >= 1.5.1 has this issue fixed (either by installing a custom X error handler or perhaps by doing a good, clean direct approach). Thus you might want to research the changes in 1.5.1 to see what needs to be done here.
As I said, installing a custom X protocol error handler would also help (that way you would custom-handle the error instead of having it "crash" by default), and AFAIK Wine does that in quite some places already (X font handling in Wine comes to mind as being a major PITA with frequent errors).
Just Google "X11 custom error handler" or so for more info.
Thanks for tackling that, good luck!
Andreas Mohr