Here is a cleaner patch. All that needs to be done is add the
appropriate rules to configure.in to allow
--disable-clobber-events. In the interim, you can set
CXXFLAGS="-DNOCLOBBEREVENTS" and be happy when you can toggle whether
blackbox thinks it is the only application on your desktop that needs
Alt+click.

-- 
Scott Moynes
diff -urN blackbox-0.62.0pre3/src/BaseDisplay.cc 
blackbox-0.62.0pre3-no-clobber-events/src/BaseDisplay.cc
--- blackbox-0.62.0pre3/src/BaseDisplay.cc      Tue Jan  8 01:48:31 2002
+++ blackbox-0.62.0pre3-no-clobber-events/src/BaseDisplay.cc    Thu Jan 10 15:01:37 
+2002
@@ -338,7 +338,7 @@
     ScreenInfo *screeninfo = new ScreenInfo(this, i);
     screenInfoList->insert(screeninfo);
   }
-
+#ifndef NOCLOBBEREVENTS
   // get the values of the keyboard lock modifiers
   KeyCode num_lock_code = XKeysymToKeycode(display, XK_Num_Lock);
   KeyCode caps_lock_code = XKeysymToKeycode(display, XK_Caps_Lock);
@@ -376,6 +376,7 @@
       MaskListLength = 1;
     }
   }
+#endif
 }
 
 
@@ -579,14 +580,22 @@
  * Grabs a button, but also grabs the button in every possible combination with
  * the keyboard lock keys, so that they do not cancel out the event.
  */
+
+/* why a window manager is clobbering events that clients want without an
+   option to turn off that "feature" is a mystery to man, woman, and beast. */
 void BaseDisplay::grabButton(unsigned int button, unsigned int modifiers,
     Window grab_window, Bool owner_events, unsigned int event_mask,
-    int pointer_mode, int keybaord_mode, Window confine_to, Cursor cursor) const
+    int pointer_mode, int keyboard_mode, Window confine_to, Cursor cursor) const
 {
+#ifndef NOCLOBBEREVENTS  
   for (unsigned int cnt = 0; cnt < MaskListLength; cnt++)
     XGrabButton(display, button, modifiers | MaskList[cnt], grab_window,
-        owner_events, event_mask, pointer_mode, keybaord_mode, confine_to,
+        owner_events, event_mask, pointer_mode, keyboard_mode, confine_to,
         cursor);
+#else
+  XGrabButton(display, button, modifiers, grab_window, owner_events,
+             event_mask, pointer_mode, keyboard_mode, confine_to, cursor);
+#endif
 }
 /*
  * Releases the grab on a button, and ungrabs all possible combinations of the
@@ -594,6 +603,10 @@
  */
 void BaseDisplay::ungrabButton(unsigned int button, unsigned int modifiers,
     Window grab_window) const {
+#ifndef NOCLOBBEREVENTS
   for (unsigned int cnt = 0; cnt < MaskListLength; cnt++)
     XUngrabButton(display, button, modifiers | MaskList[cnt], grab_window);
+#else
+  XUngrabButton(display, button, modifiers , grab_window);
+#endif
 }
diff -urN blackbox-0.62.0pre3/src/BaseDisplay.hh 
blackbox-0.62.0pre3-no-clobber-events/src/BaseDisplay.hh
--- blackbox-0.62.0pre3/src/BaseDisplay.hh      Tue Jan  8 11:40:36 2002
+++ blackbox-0.62.0pre3-no-clobber-events/src/BaseDisplay.hh    Thu Jan 10 14:57:24 
+2002
@@ -80,8 +80,9 @@
     int event_basep, error_basep;
   } shape;
 
+#ifndef NOCLOBBEREVENTS
   unsigned int MaskList[8], MaskListLength;
-  
+#endif  
   Atom xa_wm_colormap_windows, xa_wm_protocols, xa_wm_state,
     xa_wm_delete_window, xa_wm_take_focus, xa_wm_change_state,
     motif_wm_hints;

Attachment: msg04842/pgp00000.pgp
Description: PGP signature

Reply via email to