On Tue, Jun 05, 2001 at 03:00:16PM -0500, Eric Hanson wrote:
> Hello everybody,
> I was looking to make a slight alteration to blackbox's behavior. I
> wanted to make blackbox raise a window on a right click. Only if the
> window is already raised will blackbox pass the even through.
>
> So I figured look at blackbox.cc. I was poking around in
> Blackbox::process_event. I was wondering if anyone could enlighten
> or point me in the right direction.
>
> I figure I just have to figure out where blackbox decides it doesn't
> need the button event and passes it to the window to deal with (i.e.
> if you right click on a gnome terminal it pops up a window).
>
> I think I found where blackbox gets the right click (line 345 ish).
> Any help is greatly appreciated,
> Eric H. (not Dr. Nick)
You want to look at Window.cc. In order to do what you want you
need to intercept the button click so it doesn't reach the app,
which means you'll want to do an XGrabButton a la line 282's
if (! screen->isSloppyFocus())
XGrabButton(display, Button1, 0, frame.plate, True,
ButtonPressMask, GrabModeSync, GrabModeSync,
None, None);
(Though on Button3, of course). Then you'll need to add code to
BlackboxWindow::buttonPressEvent() (for similar code with a slightly
different intent look around line 2424), and add code that will call
XAllowEvents if the window is already focused, but otherwise focus it.
Jeff Raven