Can't respond to keypresses in title bar

Geoff Kuenning <[email protected]> Sat, 11 Sep 2021 14:21:10 -0700
Newsgroups gmane.comp.window-managers.sawfish
Message-ID <[email protected]>
I'm trying to set up some bindings that will let me fine-tune a 
window's position by pressing the arrow keys while pointing at the 
title bar.  For debugging, I've created the following command:

(defun db-nudge nil (display-message "Debug nudge"))
(define-command 'db-nudge db-nudge)

Then I used the customize menu to bind that to "Right" in the 
title bar keymap.  If I point at the title bar of my emacs window 
and press the right-arrow key, I don't get my debug message; 
instead emacs moves my cursor to the right.

If I edit the binding to use something like C-M-Button1 instead, 
it works.  As far as I can tell, button presses are being 
recognized in the title bar but key presses are not.  Key-press 
bindings work in other keymaps (e.g. the window keymap), though.

I found this in the code:

sawfish.h:

#define FRAME_EVENTS (ButtonPressMask | ButtonReleaseMask | 
 KeyPressMask \
                      | ButtonMotionMask | PointerMotionHintMask \
                      | EnterWindowMask | LeaveWindowMask | 
                      ExposureMask \
                      | FocusChangeMask | SubstructureRedirectMask 
                      \
                      | VisibilityChangeMask)

windows.c:

void
install_window_frame (Lisp_Window *w)
{
    DB(("install_window_frame (%s)\n", rep_STR(w->name)));
    if (!w->reparented && w->frame != 0 && !WINDOW_IS_GONE_P (w))
    {
        XSetWindowAttributes wa;

        XSelectInput (dpy, w->frame, FRAME_EVENTS);

Given that code, I don't see why button events are recognized in 
the title bar but not keypress events.

Any hints would be appreciated.
-- 
    Geoff Kuenning   [email protected] 
    http://www.cs.hmc.edu/~geoff/

The DMCA criminalizes curiosity.  It would put Susie in jail for
taking her stereo apart to see how it works.

-- 
Sawfish ML