ratpoison-devel
[Top][All Lists]
Advanced

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

Re: [RP] xgrabkeyboard race/fail patch


From: twb
Subject: Re: [RP] xgrabkeyboard race/fail patch
Date: Tue Nov 25 02:36:02 2003

Quoth Shawn Betts <address@hidden> on or about Sun, 23 Nov 2003 12:58:28 -0800:
> twb <address@hidden> writes:
> 
> > +#define XGRABKEYBOARD_LOOP_DEPTH 10
> > +#define XGRABKEYBOARD_UDELAY 10000 
> > +#define rp_xgrabkeyboard(display, grab_window, owner_events, pointer_mode, 
> > keyboard_mode, time) \
> > +        int XGrabKeyboardError=0; \
> > +        int XGrabKeyboardLoop=0; \
> > +        while (XGrabKeyboardError = XGrabKeyboard (display, grab_window, 
> > owner_events, pointer_mode, keyboard_mode, time) \
> > +          && XGrabKeyboardLoop < XGRABKEYBOARD_LOOP_DEPTH) { \
> > +     PRINT_DEBUG(("Couldn't grab the keyboard!  Retry in 0.01 
> > seconds.\n")); \
> > +     ++XGrabKeyboardLoop; \
> > +     usleep(XGRABKEYBOARD_UDELAY); \
> > +        } \
> > +        if (XGrabKeyboardError) 
> > +
> > +
> 
> Why is rp_xgrabkeyboard a macro? Why not a function?
> 
> Shawn

Sorry, sending from my webmail interface pretends to be a different user; my 
last 5 msgs failed.  Bloody telco+isp.

Shawn, I only did it as a macro in order to mask the final `if'.  I'm quite 
happy to cede to your experience.
-trent

-- 
There is more to life than increasing its speed.  -- Mahatma Gandhi



reply via email to

[Prev in Thread] Current Thread [Next in Thread]