Paul Tomblin wrote:
>
> Olivier Roulet wrote:
> >
> > Hello ,
> >
> > Yesterday I convinced a friend to use blackbox. She
> > liked how fast it started but after 2 minutes she came
> > back complaining that ClickTofocus do not work.
> > She had the NumLock ON and it was impossible to get a
> > window focused by clicking in the middle of it. This
> > only works with NumLock OFF.
> > This is a quite old bug, still here with the 61.1
> > Does someone know a by-pass ?
> >
> > What do you, people, think ? Is it a bug or do I
> > misunderstand something ?
Well, it's not a bug, it's a feature... Seriously. Though often
I suspect I'm the only one who thinks of it that way... Anyway,
there's a tentative fix below.
> I haven't delved into the code very deeply, but based on what I remember from
> fixing similar problems in my own code, I think what you want to do is find
> places where the XButtonEvent's "state" is compared to a value, such as in
> line 2416 in Window.cc, and mask out the modifier keys. I don't think that
> particular example is the culprit in this case, but for example, if you
> replace:
> } else if (be->button == 1 || (be->button == 3 && be->state == Mod1Mask)) {
> with
> } else if (be->button == 1 || (be->button == 3 && (be->state &
> (Mod1Mask|Mod2Mask|Mod3Mask) == Mod1Mask)) {
> It won't be screwed up by the other things that can be in the state variable,
> like the current state of caps-lock, num-lock and scroll-lock keys.
Unfortunately, that won't work, because blackbox has to handle clicks on
the
client window with an explicit button grab. Instead, go to around lines
281
and 811 and change them to be
if (! screen->isSloppyFocus())
XGrabButton(display, Button1, AnyModifier, frame.plate, True,
ButtonPressMask, GrabModeSync, GrabModeSync, None,
None);
[The arguments to XGrabButton should originally have been
XGrabButton(display, Button1, 0, ...)
Just change the 0 to AnyModifier.]
That should hopefully work without any unfortunate side-effects, but I
haven't really tested it much. If it doesn't give folks any problems I
guess I might as well put this into cvs when I get home...
Jeff Raven