From bd7f9481590d79ba81c03d3d22ba190826921194 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sun, 21 Jul 2002 09:56:18 +0000 Subject: [PATCH] sync with bb-cvs. 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. --- configure.in | 36 --------------------------------- nls/C/Configmenu.m | 2 ++ nls/C/main.m | 2 -- nls/da_DK/Configmenu.m | 2 ++ nls/da_DK/main.m | 2 -- nls/de_DE/main.m | 2 -- nls/es_ES/main.m | 2 -- nls/et_EE/main.m | 2 -- nls/fr_FR/main.m | 2 -- nls/hu_HU/main.m | 2 -- nls/it_IT/main.m | 2 -- nls/ja_JP/main.m | 2 -- nls/ko_KR/main.m | 7 +++++-- nls/nl_NL/main.m | 2 -- nls/no_NO/main.m | 7 +++++-- nls/pt_BR/main.m | 2 -- nls/ro_RO/main.m | 7 +++++-- nls/ru_RU/main.m | 2 -- nls/sl_SI/main.m | 2 -- nls/sv_SE/main.m | 2 -- nls/tr_TR/main.m | 2 -- nls/uk_UA/main.m | 2 -- nls/zh_CN/main.m | 2 -- nls/zh_TW/main.m | 2 -- src/BaseDisplay.cc | 46 +++++++++++++++++------------------------- src/BaseDisplay.hh | 5 ++--- src/Configmenu.cc | 16 ++++++++++++--- src/Screen.cc | 12 +++++++++++ src/Screen.hh | 6 ++++-- src/Window.cc | 17 +++++++++------- src/main.cc | 14 ------------- 31 files changed, 79 insertions(+), 134 deletions(-) diff --git a/configure.in b/configure.in index b3ecf4b4..962e67e3 100644 --- a/configure.in +++ b/configure.in @@ -112,24 +112,6 @@ if test x$XFT = "xyes"; then 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]) @@ -148,24 +130,6 @@ if test x$ORDEREDPSEUDO = "xyes"; then 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]) diff --git a/nls/C/Configmenu.m b/nls/C/Configmenu.m index 16279d94..5f6bc1af 100644 --- a/nls/C/Configmenu.m +++ b/nls/C/Configmenu.m @@ -20,6 +20,8 @@ $ #WindowToWindowSnap # Window-To-Window Snapping $ #WindowCornerSnap # Window Corner Snapping +$ #DisableBindings +# Disable Mouse with Scroll Lock $ #HideToolbar # Hide Toolbar $ #ClickToFocus diff --git a/nls/C/main.m b/nls/C/main.m index acc29ec4..79474952 100644 --- a/nls/C/main.m +++ b/nls/C/main.m @@ -21,6 +21,4 @@ $ #CompileOptions # 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 diff --git a/nls/da_DK/Configmenu.m b/nls/da_DK/Configmenu.m index a8ce6715..1e18a2e3 100644 --- a/nls/da_DK/Configmenu.m +++ b/nls/da_DK/Configmenu.m @@ -16,6 +16,8 @@ $ #FocusNew # Fokus nyt vindue $ #FocusLast # Fokus vindue ved skrivebords ændring +$ #DisableBindings +# Deaktiver tastebindinger med Scroll Lock $ #ClickToFocus # Klik for fokus $ #SloppyFocus diff --git a/nls/da_DK/main.m b/nls/da_DK/main.m index 0089ffab..e95a8243 100644 --- a/nls/da_DK/main.m +++ b/nls/da_DK/main.m @@ -21,6 +21,4 @@ $ #CompileOptions # 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 diff --git a/nls/de_DE/main.m b/nls/de_DE/main.m index 92d83123..41cfd572 100644 --- a/nls/de_DE/main.m +++ b/nls/de_DE/main.m @@ -21,6 +21,4 @@ $ #CompileOptions # 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 diff --git a/nls/es_ES/main.m b/nls/es_ES/main.m index c314be9f..bf9d4b61 100644 --- a/nls/es_ES/main.m +++ b/nls/es_ES/main.m @@ -21,6 +21,4 @@ $ #CompileOptions # 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 diff --git a/nls/et_EE/main.m b/nls/et_EE/main.m index 7115f7af..4ca75cd6 100644 --- a/nls/et_EE/main.m +++ b/nls/et_EE/main.m @@ -21,6 +21,4 @@ $ #CompileOptions # 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 diff --git a/nls/fr_FR/main.m b/nls/fr_FR/main.m index 8c36b82f..f33f2f13 100644 --- a/nls/fr_FR/main.m +++ b/nls/fr_FR/main.m @@ -21,6 +21,4 @@ $ #CompileOptions # 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 diff --git a/nls/hu_HU/main.m b/nls/hu_HU/main.m index da240973..bc622345 100644 --- a/nls/hu_HU/main.m +++ b/nls/hu_HU/main.m @@ -21,6 +21,4 @@ $ #CompileOptions # 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 diff --git a/nls/it_IT/main.m b/nls/it_IT/main.m index 23fe6a8c..b63b7371 100644 --- a/nls/it_IT/main.m +++ b/nls/it_IT/main.m @@ -21,6 +21,4 @@ $ #CompileOptions # 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 diff --git a/nls/ja_JP/main.m b/nls/ja_JP/main.m index 91ad47a7..63532de4 100644 --- a/nls/ja_JP/main.m +++ b/nls/ja_JP/main.m @@ -21,6 +21,4 @@ $ #CompileOptions # ¥³¥ó¥Ñ¥¤¥ë»þ¥ª¥×¥·¥ç¥ó:\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 diff --git a/nls/ko_KR/main.m b/nls/ko_KR/main.m index b8d2baf6..65206ed2 100644 --- a/nls/ko_KR/main.m +++ b/nls/ko_KR/main.m @@ -2,13 +2,16 @@ $set 14 #main $ #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 \t\tuse display connection.\n\ -rc \t\t\tuse alternate resource file.\n\ -version\t\t\tdisplay version and exit.\n\ diff --git a/nls/nl_NL/main.m b/nls/nl_NL/main.m index d6d4fc95..010049d3 100644 --- a/nls/nl_NL/main.m +++ b/nls/nl_NL/main.m @@ -21,6 +21,4 @@ $ #CompileOptions # 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 diff --git a/nls/no_NO/main.m b/nls/no_NO/main.m index 60436986..f4e073fa 100644 --- a/nls/no_NO/main.m +++ b/nls/no_NO/main.m @@ -2,13 +2,16 @@ $set 14 #main $ #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 \t\tbruk skjermtilkobling.\n\ -rc \t\t\tbrug alternativ ressursfil.\n\ -version\t\t\tvis versjonsnummeret og avslutt.\n\ diff --git a/nls/pt_BR/main.m b/nls/pt_BR/main.m index 45b12bb1..0946aeed 100644 --- a/nls/pt_BR/main.m +++ b/nls/pt_BR/main.m @@ -21,6 +21,4 @@ $ #CompileOptions # 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 diff --git a/nls/ro_RO/main.m b/nls/ro_RO/main.m index b5a40e5b..9babaaec 100644 --- a/nls/ro_RO/main.m +++ b/nls/ro_RO/main.m @@ -2,13 +2,16 @@ $set 14 #main $ #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 \t\tconexiunea la ecran.\n\ -rc \t\t\tfisier de configurare.\n\ -version\t\t\tafiseaza versiunea.\n\ diff --git a/nls/ru_RU/main.m b/nls/ru_RU/main.m index b9e32f0d..c3dcf324 100644 --- a/nls/ru_RU/main.m +++ b/nls/ru_RU/main.m @@ -21,6 +21,4 @@ $ #CompileOptions # 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 diff --git a/nls/sl_SI/main.m b/nls/sl_SI/main.m index c77a4ab4..c24ddb91 100644 --- a/nls/sl_SI/main.m +++ b/nls/sl_SI/main.m @@ -21,6 +21,4 @@ $ #CompileOptions # 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 diff --git a/nls/sv_SE/main.m b/nls/sv_SE/main.m index 81bdd1bb..98ba3512 100644 --- a/nls/sv_SE/main.m +++ b/nls/sv_SE/main.m @@ -21,6 +21,4 @@ $ #CompileOptions # 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 diff --git a/nls/tr_TR/main.m b/nls/tr_TR/main.m index f382efb4..18bef84d 100644 --- a/nls/tr_TR/main.m +++ b/nls/tr_TR/main.m @@ -21,6 +21,4 @@ $ #CompileOptions # 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 diff --git a/nls/uk_UA/main.m b/nls/uk_UA/main.m index 9e5b1a39..7132dd7c 100644 --- a/nls/uk_UA/main.m +++ b/nls/uk_UA/main.m @@ -22,6 +22,4 @@ $ #CompileOptions 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 diff --git a/nls/zh_CN/main.m b/nls/zh_CN/main.m index f1b2d3b9..142e0042 100644 --- a/nls/zh_CN/main.m +++ b/nls/zh_CN/main.m @@ -21,6 +21,4 @@ $ #CompileOptions # ±àÒëÑ¡Ïî:\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 diff --git a/nls/zh_TW/main.m b/nls/zh_TW/main.m index acc29ec4..79474952 100644 --- a/nls/zh_TW/main.m +++ b/nls/zh_TW/main.m @@ -21,6 +21,4 @@ $ #CompileOptions # 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 diff --git a/src/BaseDisplay.cc b/src/BaseDisplay.cc index aa2d974e..6bf290e2 100644 --- a/src/BaseDisplay.cc +++ b/src/BaseDisplay.cc @@ -238,7 +238,6 @@ BaseDisplay::BaseDisplay(const char *app_name, const char *dpy_name) { 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); @@ -268,20 +267,16 @@ BaseDisplay::BaseDisplay(const char *app_name, const char *dpy_name) { 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(modmap)); -#else // NOCLOBBER - NumLockMask = 0; - ScrollLockMask = 0; -#endif // NOCLOBBER - gccache = 0; + gccache = (BGCCache *) 0; } @@ -359,36 +354,32 @@ void BaseDisplay::removeTimer(BTimer *timer) { /* * 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 } @@ -399,10 +390,11 @@ const ScreenInfo* BaseDisplay::getScreenInfo(unsigned int s) const { } -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; } diff --git a/src/BaseDisplay.hh b/src/BaseDisplay.hh index 921f6ecd..3ebe6e61 100644 --- a/src/BaseDisplay.hh +++ b/src/BaseDisplay.hh @@ -77,10 +77,8 @@ private: }; BShape shape; -#ifndef NOCLOBBER unsigned int MaskList[8]; size_t MaskListLength; -#endif // NOCLOBBER enum RunState { STARTUP, RUNNING, SHUTDOWN }; RunState run_state; @@ -139,7 +137,8 @@ public: 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; diff --git a/src/Configmenu.cc b/src/Configmenu.cc index e73ae327..c5c58d91 100644 --- a/src/Configmenu.cc +++ b/src/Configmenu.cc @@ -57,8 +57,10 @@ Configmenu::Configmenu(BScreen *scr) : Basemenu(scr) { "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(); } @@ -75,7 +77,8 @@ void Configmenu::setValues(void) { setItemSelected(8, getScreen()->getWindowCornerSnap()); setItemEnabled(8, getScreen()->getWindowToWindowSnap()); - setItemSelected(9, getScreen()->doHideToolbar()); + setItemSelected(9, getScreen()->allowScrollLock()); + setItemSelected(10, getScreen()->doHideToolbar()); } @@ -84,6 +87,7 @@ Configmenu::~Configmenu(void) { delete placementmenu; } + void Configmenu::itemSelected(int button, unsigned int index) { if (button != 1) return; @@ -130,7 +134,13 @@ void Configmenu::itemSelected(int button, unsigned int index) { 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; diff --git a/src/Screen.cc b/src/Screen.cc index f1ba429c..6b895644 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -526,6 +526,13 @@ void BScreen::savePlaceIgnoreMaximized(bool i) { } +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); @@ -552,6 +559,7 @@ void BScreen::save_rc(void) { #endif // HAVE_STRFTIME savePlaceIgnoreShaded(resource.ignore_shaded); savePlaceIgnoreMaximized(resource.ignore_maximized); + saveAllowScrollLock(resource.allow_scroll_lock); toolbar->save_rc(); slit->save_rc(); @@ -686,6 +694,10 @@ void BScreen::load_rc(void) { 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; } diff --git a/src/Screen.hh b/src/Screen.hh index f17c6f54..c16bd077 100644 --- a/src/Screen.hh +++ b/src/Screen.hh @@ -144,8 +144,8 @@ private: 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; @@ -214,6 +214,7 @@ public: { 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; } @@ -285,6 +286,7 @@ public: 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 diff --git a/src/Window.cc b/src/Window.cc index 8899ff16..316bbf1a 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -819,24 +819,27 @@ void BlackboxWindow::reconfigure(void) { 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()); } diff --git a/src/main.cc b/src/main.cc index c06543a1..47debac1 100644 --- a/src/main.cc +++ b/src/main.cc @@ -77,8 +77,6 @@ static void showHelp(int exitval) { "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"), @@ -92,18 +90,6 @@ static void showHelp(int exitval) { 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 -- 2.45.2