Add option in config menu for disabling mouse input with scroll lock.
Remove compile-time flag for event clobbering since this solves that problem for now.
AC_DEFINE(XFT,1,Enable support of the Xft extension)
fi
-dnl Check for the Slit
-SLIT=""
-AC_MSG_CHECKING([whether to include the Slit])
-AC_ARG_ENABLE(
- slit, [ --enable-slit include code for the Slit [default=yes]],
- if test x$enableval = "xyes"; then
- AC_MSG_RESULT([yes])
- SLIT="yes"
- else
- AC_MSG_RESULT([no])
- fi,
- AC_MSG_RESULT([yes])
- SLIT="yes"
-)
-if test x$SLIT = "xyes"; then
- AC_DEFINE(SLIT,1,Enable the Slit)
-fi
-
dnl Check for ordered 8bpp dithering
ORDEREDPSEUDO=""
AC_MSG_CHECKING([whether to include Pseudocolor ordered dithering code])
AC_DEFINE(ORDEREDPSEUDO,1,Enable pseudocolor ordered dithering)
fi
-dnl Check for event clobbering
-CLOBBER=""
-AC_MSG_CHECKING([whether to intercept mouse events to clients])
-AC_ARG_ENABLE(clobber,
-[ --enable-clobber intercept mouse events to clients when num lock
- or scroll lock are on [default=yes]],
- if test x$enableval = "xno"; then
- AC_MSG_RESULT([no])
- CLOBBER="no"
- else
- AC_MSG_RESULT([yes])
- fi,
- AC_MSG_RESULT([yes])
-)
-if test x$CLOBBER = "xno"; then
- AC_DEFINE(NOCLOBBER,1,Disable grabbing of mouse events when num/scoll lock is pressed)
-fi
-
dnl Check whether to include debugging code
DEBUG=""
AC_MSG_CHECKING([whether to include verbose debugging code])
# Window-To-Window Snapping
$ #WindowCornerSnap
# Window Corner Snapping
+$ #DisableBindings
+# Disable Mouse with Scroll Lock
$ #HideToolbar
# Hide Toolbar
$ #ClickToFocus
# Compile time options:\n\
Debugging\t\t\t%s\n\
Shape:\t\t\t%s\n\
- Slit:\t\t\t\t%s\n\
- Event Clobbering:\t\t%s\n\
8bpp Ordered Dithering:\t%s\n\n
# Fokus nyt vindue
$ #FocusLast
# Fokus vindue ved skrivebords ændring
+$ #DisableBindings
+# Deaktiver tastebindinger med Scroll Lock
$ #ClickToFocus
# Klik for fokus
$ #SloppyFocus
# Kompileret med:\n\
Debugging\t\t\t%s\n\
Shape:\t\t\t%s\n\
- Slit:\t\t\t\t%s\n\
- Event Clobbering:\t\t%s\n\
8bpp Ordered Dithering:\t%s\n\n
# Optionen zum Kompilationszeitpunkt:\n\
Debugging\t\t\t%s\n\
Shape:\t\t\t%s\n\
- Slit:\t\t\t\t%s\n\
- Event Clobbering:\t\t%s\n\
8bpp Ordered Dithering:\t%s\n\n
# Opciones durante la compilación:\n\
Información extra para depuración: %s\n\
Forma: %s\n\
- Slit: %s\n\
- Event Clobbering: %s\n\
8bpp simulación ordenada de colores en imágenes: %s\n\n
# Kompileerimisoptsioonid:\n\
Debuggimine\t\t\t%s\n\
Kuju:\t\t\t%s\n\
- Slit:\t\t\t\t%s\n\
- Event Clobbering:\t\t%s\n\
8bpp määratud teravustamine:\t%s\n\n
# Options de compilation:\n\
Debugage\t\t\t%s\n\
Shape:\t\t\t%s\n\
- Slit:\t\t\t\t%s\n\
- Event Clobbering:\t\t%s\n\
8bpp Lissage ordonné:\t%s\n\n
# Fordításnál állítható lehetõségek:\n\
Debugging\t\t\t%s\n\
Shape:\t\t\t%s\n\
- Slit:\t\t\t\t%s\n\
- Event Clobbering:\t\t%s\n\
8bpp Ordered Dithering:\t%s\n\n
# Opzioni in fase di compilazione:\n\
Debugging\t\t\t%s\n\
Shape:\t\t\t%s\n\
- Slit:\t\t\t\t%s\n\
- Event Clobbering:\t\t%s\n\
8bpp Ordered Dithering:\t%s\n\n
# ¥³¥ó¥Ñ¥¤¥ë»þ¥ª¥×¥·¥ç¥ó:\n\
Debugging\t\t\t%s\n\
Shape:\t\t\t%s\n\
- Slit:\t\t\t\t%s\n\
- Event Clobbering:\t\t%s\n\
8bpp Ordered Dithering:\t%s\n\n
$ #RCRequiresArg
# error: '-rc' requires an argument\n
+$ #MENURequiresArg
+# error: '-menu' requires an argument\n
$ #DISPLAYRequiresArg
# error: '-display' requires an argument\n
$ #WarnDisplaySet
# warning: could not set environment variable 'DISPLAY'\n
$ #Usage
-# Blackbox %s : (c) 2001 - 2002 Sean 'Shaleh' Perry\n\
- \t\t\t 1997 - 2000, 2002 Brad Hughes\n\n\
+# Openbox %s : (c) 2002 - 2002 Ben Jansens\n\
+ 2001 - 2002 Sean 'Shaleh' Perry\n\
+ 1997 - 2000, 2002 Brad Hughes\n\n\
-display <string>\t\tuse display connection.\n\
-rc <string>\t\t\tuse alternate resource file.\n\
-version\t\t\tdisplay version and exit.\n\
# Gecompileerd met instellingen:\n\
Debugging: %s\n\
Shape: %s\n\
- Slit:\t\t\t\t%s\n\
- Event Clobbering:\t\t%s\n\
8bpp Ordered Dithering: %s\n\n
$ #RCRequiresArg
# feil: '-rc' krever et argument\n
+$ #MENURequiresArg
+# feil: '-menu' krever et argument\n
$ #DISPLAYRequiresArg
# feil: '-display' krever et argument\n
$ #WarnDisplaySet
# advarsel: kunne ikke sette 'DISPLAY' miljøvariabelen\n
$ #Usage
-# Blackbox %s : (c) 2001 - 2002 Sean 'Shaleh' Perry\n\
- \t\t\t 1997 - 2000, 2002 Brad Hughes\n\n\
+# Openbox %s : (c) 2002 - 2002 Ben Jansens\n\
+ 2001 - 2002 Sean 'Shaleh' Perry\n\
+ 1997 - 2000, 2002 Brad Hughes\n\n\
-display <streng>\t\tbruk skjermtilkobling.\n\
-rc <streng>\t\t\tbrug alternativ ressursfil.\n\
-version\t\t\tvis versjonsnummeret og avslutt.\n\
# Opções em tempo de compilação:\n\
Informações extras para problemas:\t\t\t%s\n\
Forma:\t\t\t%s\n\
- Slit:\t\t\t\t%s\n\
- Event Clobbering:\t\t%s\n\
8bpp Simulação ordenada de cores em imagens:\t%s\n\n
$ #RCRequiresArg
# eroare: '-rc' necesita inca un parametru\n
+$ #MENURequiresArg
+# eroare: '-menu' necesita inca un parametru\n
$ #DISPLAYRequiresArg
# eroare: '-display' necesita inca un parametru\n
$ #WarnDisplaySet
# atentionare: nu am putut crea variabila de mediu 'DISPLAY'\n
$ #Usage
-# Blackbox %s : (c) 2001 - 2002 Sean 'Shaleh' Perry\n\
- \t\t\t 1997 - 2000, 2002 Brad Hughes\n\n\
+# Openbox %s : (c) 2002 - 2002 Ben Jansens\n\
+ 2001 - 2002 Sean 'Shaleh' Perry\n\
+ 1997 - 2000, 2002 Brad Hughes\n\n\
-display <sir>\t\tconexiunea la ecran.\n\
-rc <sir>\t\t\tfisier de configurare.\n\
-version\t\t\tafiseaza versiunea.\n\
# Compile time options:\n\
Debugging\t\t\t%s\n\
Shape:\t\t\t%s\n\
- Slit:\t\t\t\t%s\n\
- Event Clobbering:\t\t%s\n\
8bpp Ordered Dithering:\t%s\n\n
# Izbire pri prevajanju:\n\
Razhro¹èevanje\t\t\t%s\n\
Oblika:\t\t\t%s\n\
- Slit:\t\t\t\t%s\n\
- Event Clobbering:\t\t%s\n\
Osembitno stresanje barv:\t%s\n\n
# Kompilerad med:\n\
Avlusning\t\t\t%s\n\
Form:\t\t\t\t%s\n\
- Slit:\t\t\t\t%s\n\
- Event Clobbering:\t\t%s\n\
8bpp ordnad dithering:\t%s\n\n
# Denetleme seçenekleri :\n\
Bilgilendirme\t\t\t%s\n\
Gölgeleme:\t\t\t%s\n\
- Slit:\t\t\t\t%s\n\
- Event Clobbering:\t\t%s\n\
R8b'e göre týzla:\t%s\n\n
Debugging\t\t\t%s\n\
Interlacing:\t\t\t%s\n\
Shape:\t\t\t%s\n\
- Slit:\t\t\t\t%s\n\
- Event Clobbering:\t\t%s\n\
8bpp Ordered Dithering:\t%s\n\n
# ±àÒëÑ¡Ïî:\n\
Debugging\t\t\t%s\n\
Shape:\t\t\t%s\n\
- Slit:\t\t\t\t%s\n\
- Event Clobbering:\t\t%s\n\
8bpp Ordered Dithering:\t%s\n\n
# Compile time options:\n\
Debugging\t\t\t%s\n\
Shape:\t\t\t%s\n\
- Slit:\t\t\t\t%s\n\
- Event Clobbering:\t\t%s\n\
8bpp Ordered Dithering:\t%s\n\n
for (int i = 0; i < ScreenCount(display); ++i)
screenInfoList.push_back(ScreenInfo(this, i));
-#ifndef NOCLOBBER
NumLockMask = ScrollLockMask = 0;
const XModifierKeymap* const modmap = XGetModifierMapping(display);
MaskList[0] = 0;
MaskList[1] = LockMask;
MaskList[2] = NumLockMask;
- MaskList[3] = ScrollLockMask;
- MaskList[4] = LockMask | NumLockMask;
- MaskList[5] = NumLockMask | ScrollLockMask;
- MaskList[6] = LockMask | ScrollLockMask;
- MaskList[7] = LockMask | NumLockMask | ScrollLockMask;
+ MaskList[3] = LockMask | NumLockMask;
+ MaskList[4] = ScrollLockMask;
+ MaskList[5] = ScrollLockMask | LockMask;
+ MaskList[6] = ScrollLockMask | NumLockMask;
+ MaskList[7] = ScrollLockMask | LockMask | NumLockMask;
MaskListLength = sizeof(MaskList) / sizeof(MaskList[0]);
if (modmap) XFreeModifiermap(const_cast<XModifierKeymap*>(modmap));
-#else // NOCLOBBER
- NumLockMask = 0;
- ScrollLockMask = 0;
-#endif // NOCLOBBER
- gccache = 0;
+ gccache = (BGCCache *) 0;
}
/*
* 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.
+
+ * if allow_scroll_lock is true then only the top half of the lock mask
+ * table is used and scroll lock is ignored. This value defaults to false.
*/
void BaseDisplay::grabButton(unsigned int button, unsigned int modifiers,
Window grab_window, bool owner_events,
unsigned int event_mask, int pointer_mode,
int keyboard_mode, Window confine_to,
- Cursor cursor) const {
-#ifndef NOCLOBBER
- for (size_t cnt = 0; cnt < MaskListLength; ++cnt)
+ Cursor cursor, bool allow_scroll_lock) const {
+ unsigned int length = (allow_scroll_lock) ? MaskListLength / 2:
+ MaskListLength;
+ for (size_t cnt = 0; cnt < length; ++cnt)
XGrabButton(display, button, modifiers | MaskList[cnt], grab_window,
owner_events, event_mask, pointer_mode, keyboard_mode,
confine_to, cursor);
-#else // NOCLOBBER
- XGrabButton(display, button, modifiers, grab_window,
- owner_events, event_mask, pointer_mode, keyboard_mode,
- confine_to, cursor);
-#endif // NOCLOBBER
}
+
/*
* Releases the grab on a button, and ungrabs all possible combinations of the
* keyboard lock keys.
*/
void BaseDisplay::ungrabButton(unsigned int button, unsigned int modifiers,
Window grab_window) const {
-#ifndef NOCLOBBER
for (size_t cnt = 0; cnt < MaskListLength; ++cnt)
XUngrabButton(display, button, modifiers | MaskList[cnt], grab_window);
-#else // NOCLOBBER
- XUngrabButton(display, button, modifiers, grab_window);
-#endif // NOCLOBBER
}
}
-BGCCache *BaseDisplay::gcCache(void) const
-{
- if (! gccache) gccache = new BGCCache(this);
- return gccache;
+BGCCache* BaseDisplay::gcCache(void) const {
+ if (! gccache)
+ gccache = new BGCCache(this);
+
+ return gccache;
}
};
BShape shape;
-#ifndef NOCLOBBER
unsigned int MaskList[8];
size_t MaskListLength;
-#endif // NOCLOBBER
enum RunState { STARTUP, RUNNING, SHUTDOWN };
RunState run_state;
void grabButton(unsigned int button, unsigned int modifiers,
Window grab_window, bool owner_events,
unsigned int event_mask, int pointer_mode,
- int keyboard_mode, Window confine_to, Cursor cursor) const;
+ int keyboard_mode, Window confine_to, Cursor cursor,
+ bool allow_scroll_lock) const;
void ungrabButton(unsigned int button, unsigned int modifiers,
Window grab_window) const;
"Window-To-Window Snapping"), 6);
insert(i18n(ConfigmenuSet, ConfigmenuWindowCornerSnap,
"Window Corner Snapping"), 7);
+ insert(i18n(ConfigmenuSet, ConfigmenuDisableBindings,
+ "Disable Mouse with Scroll Lock"), 8);
insert(i18n(ConfigmenuSet, ConfigmenuHideToolbar,
- "Hide Toolbar"), 8);
+ "Hide Toolbar"), 9);
update();
setValues();
}
setItemSelected(8, getScreen()->getWindowCornerSnap());
setItemEnabled(8, getScreen()->getWindowToWindowSnap());
- setItemSelected(9, getScreen()->doHideToolbar());
+ setItemSelected(9, getScreen()->allowScrollLock());
+ setItemSelected(10, getScreen()->doHideToolbar());
}
delete placementmenu;
}
+
void Configmenu::itemSelected(int button, unsigned int index) {
if (button != 1)
return;
setItemSelected(index, getScreen()->getWindowCornerSnap());
break;
- case 8: // hide toolbar
+ case 8: // disable mouse bindings with Scroll Lock
+ getScreen()->saveAllowScrollLock(! getScreen()->allowScrollLock());
+ setItemSelected(index, getScreen()->allowScrollLock());
+ getScreen()->reconfigure();
+ break;
+
+ case 9: // hide toolbar
getScreen()->saveHideToolbar(! getScreen()->doHideToolbar());
setItemSelected(index, getScreen()->doHideToolbar());
break;
}
+void BScreen::saveAllowScrollLock(bool a) {
+ resource.allow_scroll_lock = a;
+ config->setValue(screenstr + "disableBindingsWithScrollLock",
+ resource.allow_scroll_lock);
+}
+
+
void BScreen::save_rc(void) {
saveSloppyFocus(resource.sloppy_focus);
saveAutoRaise(resource.auto_raise);
#endif // HAVE_STRFTIME
savePlaceIgnoreShaded(resource.ignore_shaded);
savePlaceIgnoreMaximized(resource.ignore_maximized);
+ saveAllowScrollLock(resource.allow_scroll_lock);
toolbar->save_rc();
slit->save_rc();
if (! config->getValue(screenstr + "placementIgnoreMaximized",
resource.ignore_maximized))
resource.ignore_maximized = true;
+
+ if (! config->getValue(screenstr + "disableBindingsWithScrollLock",
+ resource.allow_scroll_lock))
+ resource.allow_scroll_lock = false;
}
bool sloppy_focus, auto_raise, auto_edge_balance, ordered_dither,
opaque_move, full_max, focus_new, focus_last, click_raise,
- hide_toolbar, window_to_window_snap, window_corner_snap, aa_fonts,
- ignore_shaded, ignore_maximized;
+ allow_scroll_lock, hide_toolbar, window_to_window_snap,
+ window_corner_snap, aa_fonts, ignore_shaded, ignore_maximized;
BColor border_color;
unsigned int workspaces;
{ return resource.window_to_window_snap; }
inline bool getWindowCornerSnap(void) const
{ return resource.window_corner_snap; }
+ inline bool allowScrollLock(void) const { return resource.allow_scroll_lock; }
inline const GC &getOpGC(void) const { return opGC; }
void saveResizeZones(unsigned int z);
void savePlaceIgnoreShaded(bool i);
void savePlaceIgnoreMaximized(bool i);
+ void saveAllowScrollLock(bool a);
inline void iconUpdate(void) { iconmenu->update(); }
#ifdef HAVE_STRFTIME
void BlackboxWindow::grabButtons(void) {
- if ((! screen->isSloppyFocus()) || screen->doClickRaise())
+ if (! screen->isSloppyFocus() || screen->doClickRaise())
// grab button 1 for changing focus/raising
blackbox->grabButton(Button1, 0, frame.plate, True, ButtonPressMask,
- GrabModeSync, GrabModeSync, frame.plate, None);
-
+ GrabModeSync, GrabModeSync, frame.plate, None,
+ screen->allowScrollLock());
+
if (functions & Func_Move)
blackbox->grabButton(Button1, Mod1Mask, frame.window, True,
ButtonReleaseMask | ButtonMotionMask, GrabModeAsync,
- GrabModeAsync, frame.window,
- blackbox->getMoveCursor());
+ GrabModeAsync, frame.window, None,
+ screen->allowScrollLock());
if (functions & Func_Resize)
blackbox->grabButton(Button3, Mod1Mask, frame.window, True,
ButtonReleaseMask | ButtonMotionMask, GrabModeAsync,
- GrabModeAsync, frame.window, None);
+ GrabModeAsync, frame.window, None,
+ screen->allowScrollLock());
// alt+middle lowers the window
blackbox->grabButton(Button2, Mod1Mask, frame.window, True,
ButtonReleaseMask, GrabModeAsync, GrabModeAsync,
- frame.window, None);
+ frame.window, None,
+ screen->allowScrollLock());
}
"Compile time options:\n"
" Debugging:\t\t\t%s\n"
" Shape:\t\t\t%s\n"
- " Slit:\t\t\t\t%s\n"
- " Event Clobbering:\t\t%s\n"
" 8bpp Ordered Dithering:\t%s\n\n"),
#ifdef DEBUG
i18n(CommonSet, CommonYes, "yes"),
i18n(CommonSet, CommonNo, "no"),
#endif // SHAPE
-#ifdef SLIT
- i18n(CommonSet, CommonYes, "yes"),
-#else // !SLIT
- i18n(CommonSet, CommonNo, "no"),
-#endif // SLIT
-
-#ifndef NOCLOBBER
- i18n(CommonSet, CommonYes, "yes"),
-#else // !NOCLOBBER
- i18n(CommonSet, CommonNo, "no"),
-#endif // NOCLOBBER
-
#ifdef ORDEREDPSEUDO
i18n(CommonSet, CommonYes, "yes")
#else // !ORDEREDPSEUDO