From: Dana Jansens Date: Sat, 25 May 2002 03:46:25 +0000 (+0000) Subject: make use of the --enable-clobber option X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=2f65b6533c41e392a72ccfd70ba486214cd9ee36;p=chaz%2Fopenbox make use of the --enable-clobber option --- diff --git a/src/BaseDisplay.cc b/src/BaseDisplay.cc index 6726cbac..0fde13d7 100644 --- a/src/BaseDisplay.cc +++ b/src/BaseDisplay.cc @@ -239,6 +239,7 @@ 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); @@ -276,6 +277,10 @@ BaseDisplay::BaseDisplay(const char *app_name, const char *dpy_name) { MaskListLength = sizeof(MaskList) / sizeof(MaskList[0]); if (modmap) XFreeModifiermap(const_cast(modmap)); +#else // NOCLOBBER + NumLockMask = 0; + ScrollLockMask = 0; +#endif // NOCLOBBER gccache = 0; } @@ -366,11 +371,16 @@ void BaseDisplay::grabButton(unsigned int button, unsigned int modifiers, unsigned int event_mask, int pointer_mode, int keyboard_mode, Window confine_to, Cursor cursor) const { - for (size_t cnt = 0; cnt < MaskListLength; ++cnt) { +#ifndef NOCLOBBER + for (size_t cnt = 0; cnt < MaskListLength; ++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 } /* @@ -379,9 +389,12 @@ void BaseDisplay::grabButton(unsigned int button, unsigned int modifiers, */ void BaseDisplay::ungrabButton(unsigned int button, unsigned int modifiers, Window grab_window) const { - for (size_t cnt = 0; cnt < MaskListLength; ++cnt) { +#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 } diff --git a/src/BaseDisplay.hh b/src/BaseDisplay.hh index 7a6251da..921f6ecd 100644 --- a/src/BaseDisplay.hh +++ b/src/BaseDisplay.hh @@ -77,8 +77,10 @@ private: }; BShape shape; +#ifndef NOCLOBBER unsigned int MaskList[8]; size_t MaskListLength; +#endif // NOCLOBBER enum RunState { STARTUP, RUNNING, SHUTDOWN }; RunState run_state;