9fans / plan9port

Plan 9 from User Space
https://9fans.github.io/plan9port/
Other
1.62k stars 320 forks source link

rio: pass b2 and b3 to clients #542

Closed ghost closed 2 years ago

ghost commented 2 years ago

The existing call to XAllowClients to ReplayPointer is ineffective because the pointer is not frozen at the time.

To make it effective, we change XGrabTutton to grab the pointer synchronously. In order not to freeze the window manager though, we need to always call XAllowEvents after processing a mouse event. We use ReplayPointer if the button isn't b1.

References:

bladedvox commented 2 years ago

I think you want to add a call to top(c) between the XMapRaised(dpy, c->parent) and active(c) for b2 and b3 so that alt-tab works properly, but other than that this is wonderful!

ghost commented 2 years ago

Thanks for the feedback, I applied the change you suggested. To be sure I understand, the problem was that not calling top(c) caused the order of windows cycled through alt-tab to be incorrect?

Re: the patch, it's been working okay for me, but it's not perfect. Sometimes the X session seems to lock up for a few seconds. This happens to me only once a week or so, so I haven't invested in debugging.

bladedvox commented 2 years ago

Yes, eactly- you have to alt-tab twice to correct the order.

Hmm I'll keep a lookout for lockups, I've been using the patch for 36 hours or so and no ill effects yet!

ghost commented 2 years ago

Hey @bladedvox did you experience any (temporary) lockups? I came back here because it happened once today, and it's the first time since our last correspondence here. :)

bladedvox commented 2 years ago

@nicolagi none that I noticed yet; granted I am using this not on vanilla p9p rio but a heavily customized fork. The only thing I could think of that might make a difference in this situation is that my fork doesn't do the XGrabServer/XUngrabServer calls in grab.c. But in any case, it's working well for me.