diff options
author | Matt Keadle <mkeadle@gentoo.org> | 2002-10-26 05:19:06 +0000 |
---|---|---|
committer | Matt Keadle <mkeadle@gentoo.org> | 2002-10-26 05:19:06 +0000 |
commit | cf48ec65b9d9d2c20e038cc59fef54b828f77935 (patch) | |
tree | 3dea32a3230c6af2bf6298e492e2f269fd6acd02 /x11-wm | |
parent | Minor change to 0.1.12-r2 description (diff) | |
download | gentoo-2-cf48ec65b9d9d2c20e038cc59fef54b828f77935.tar.gz gentoo-2-cf48ec65b9d9d2c20e038cc59fef54b828f77935.tar.bz2 gentoo-2-cf48ec65b9d9d2c20e038cc59fef54b828f77935.zip |
Added mousewheel patch
Diffstat (limited to 'x11-wm')
-rw-r--r-- | x11-wm/blackbox/ChangeLog | 13 | ||||
-rw-r--r-- | x11-wm/blackbox/blackbox-0.65.0-r1.ebuild | 23 | ||||
-rw-r--r-- | x11-wm/blackbox/files/blackbox-0.65.0-mousewheel_focus-workspace.patch | 378 | ||||
-rw-r--r-- | x11-wm/blackbox/files/digest-blackbox-0.65.0-r1 | 1 |
4 files changed, 414 insertions, 1 deletions
diff --git a/x11-wm/blackbox/ChangeLog b/x11-wm/blackbox/ChangeLog index 0b9836b02958..4a850b56715a 100644 --- a/x11-wm/blackbox/ChangeLog +++ b/x11-wm/blackbox/ChangeLog @@ -1,6 +1,17 @@ # ChangeLog for x11-wm/blackbox # Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL -# $Header: /var/cvsroot/gentoo-x86/x11-wm/blackbox/ChangeLog,v 1.17 2002/09/19 11:12:28 spider Exp $ +# $Header: /var/cvsroot/gentoo-x86/x11-wm/blackbox/ChangeLog,v 1.18 2002/10/26 05:19:06 mkeadle Exp $ + +*blackbox-0.65.0-r1 (26 Oct 2002) + + 26 Oct 2002; Matt Keadle <mkeadle@gentoo.org> blackbox-0.65.0-r1 + files/digest-blackbox-0.65.0-r1 + + Added mouse wheel patch. You can either change window focus or change + workspaces with this one and you can use the configuration menu to set + it or reverse the scroll direction. Window shading included. + + Patch created by Michael Langley (ownx). *blackbox-0.65.0 (19 Sep 2002) diff --git a/x11-wm/blackbox/blackbox-0.65.0-r1.ebuild b/x11-wm/blackbox/blackbox-0.65.0-r1.ebuild new file mode 100644 index 000000000000..aebc03725c6d --- /dev/null +++ b/x11-wm/blackbox/blackbox-0.65.0-r1.ebuild @@ -0,0 +1,23 @@ +# Copyright 1999-2002 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/x11-wm/blackbox/blackbox-0.65.0-r1.ebuild,v 1.1 2002/10/26 05:19:06 mkeadle Exp $ + +IUSE="nls" + +inherit commonbox + +S=${WORKDIR}/${P} +DESCRIPTION="A small, fast, full-featured window manager for X" +SRC_URI="mirror://sourceforge/blackboxwm/${P}.tar.gz" +HOMEPAGE="http://blackboxwm.sf.net/" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~x86" + +mydoc="AUTHORS LICENSE README ChangeLog* TODO*" + +src_unpack() { + unpack ${P}.tar.gz + patch -p0 < ${FILESDIR}/blackbox-0.65.0-mousewheel_focus-workspace.patch +} diff --git a/x11-wm/blackbox/files/blackbox-0.65.0-mousewheel_focus-workspace.patch b/x11-wm/blackbox/files/blackbox-0.65.0-mousewheel_focus-workspace.patch new file mode 100644 index 000000000000..842c60fd6d01 --- /dev/null +++ b/x11-wm/blackbox/files/blackbox-0.65.0-mousewheel_focus-workspace.patch @@ -0,0 +1,378 @@ +diff -urN blackbox-0.65.0/nls/C/Configmenu.m blackbox-0.65.0-wheel/nls/C/Configmenu.m +--- blackbox-0.65.0/nls/C/Configmenu.m 2002-07-17 15:50:57.000000000 -0500 ++++ blackbox-0.65.0-wheel/nls/C/Configmenu.m 2002-09-23 17:51:52.000000000 -0500 +@@ -4,6 +4,14 @@ + # Config Options + $ #FocusModel + # Focus Model ++$ #MouseWheel ++# Mouse Wheel ++$ #ChangesFocus ++# Changes Focus ++$ #ChangesWorkspace ++# Changes Workspace ++$ #ReverseScroll ++# Reverse Scroll + $ #WindowPlacement + # Window Placement + $ #ImageDithering +diff -urN blackbox-0.65.0/src/Configmenu.cc blackbox-0.65.0-wheel/src/Configmenu.cc +--- blackbox-0.65.0/src/Configmenu.cc 2002-08-01 14:35:19.000000000 -0500 ++++ blackbox-0.65.0-wheel/src/Configmenu.cc 2002-09-25 00:46:25.000000000 -0500 +@@ -37,10 +37,13 @@ + setInternalMenu(); + + focusmenu = new Focusmenu(this); ++ wheelmenu = new Wheelmenu(this); + placementmenu = new Placementmenu(this); +- ++ + insert(i18n(ConfigmenuSet, ConfigmenuFocusModel, + "Focus Model"), focusmenu); ++ insert(i18n(ConfigmenuSet, ConfigmenuMouseWheel, ++ "Mouse Wheel"), wheelmenu); + insert(i18n(ConfigmenuSet, ConfigmenuWindowPlacement, + "Window Placement"), placementmenu); + insert(i18n(ConfigmenuSet, ConfigmenuImageDithering, +@@ -57,17 +60,18 @@ + "Disable Bindings with Scroll Lock"), 6); + update(); + +- setItemSelected(2, getScreen()->getImageControl()->doDither()); +- setItemSelected(3, getScreen()->doOpaqueMove()); +- setItemSelected(4, getScreen()->doFullMax()); +- setItemSelected(5, getScreen()->doFocusNew()); +- setItemSelected(6, getScreen()->doFocusLast()); +- setItemSelected(7, getScreen()->allowScrollLock()); ++ setItemSelected(3, getScreen()->getImageControl()->doDither()); ++ setItemSelected(4, getScreen()->doOpaqueMove()); ++ setItemSelected(5, getScreen()->doFullMax()); ++ setItemSelected(6, getScreen()->doFocusNew()); ++ setItemSelected(7, getScreen()->doFocusLast()); ++ setItemSelected(8, getScreen()->allowScrollLock()); + } + + + Configmenu::~Configmenu(void) { + delete focusmenu; ++ delete wheelmenu; + delete placementmenu; + } + +@@ -131,6 +135,7 @@ + + void Configmenu::reconfigure(void) { + focusmenu->reconfigure(); ++ wheelmenu->reconfigure(); + placementmenu->reconfigure(); + + Basemenu::reconfigure(); +@@ -194,6 +199,53 @@ + } + + ++Configmenu::Wheelmenu::Wheelmenu(Configmenu *cm) : Basemenu(cm->getScreen()) { ++ setLabel(i18n(ConfigmenuSet, ConfigmenuMouseWheel, "Mouse Wheel")); ++ setInternalMenu(); ++ ++ insert(i18n(ConfigmenuSet, ConfigmenuChangesFocus, "Changes Focus"), 1); ++ insert(i18n(ConfigmenuSet, ConfigmenuChangesWorkspace, "Changes Workspace"), 2); ++ insert(i18n(ConfigmenuSet, ConfigmenuReverseScroll, "Reverse Scroll"), 3); ++ update(); ++ ++ setItemSelected(0, getScreen()->isChangesFocus()); ++ setItemSelected(1, ! getScreen()->isChangesFocus()); ++ setItemSelected(2, getScreen()->isReverseScroll()); ++} ++ ++ ++void Configmenu::Wheelmenu::itemSelected(int button, unsigned int index) { ++ if (button != 1) ++ return; ++ ++ BasemenuItem *item = find(index); ++ ++ if (!item->function()) ++ return; ++ ++ switch (item->function()) { ++ case 1: // mouse wheel changes focus ++ getScreen()->toggleMouseWheel(BScreen::ChangesFocus); ++ break; ++ ++ case 2: // mouse wheel changes workspace ++ getScreen()->toggleMouseWheel(BScreen::ChangesWorkspace); ++ break; ++ ++ case 3: // reverse scroll direction ++ if (getScreen()->isReverseScroll()) ++ getScreen()->toggleScroll(BScreen::Normal); ++ else ++ getScreen()->toggleScroll(BScreen::Reverse); ++ break; ++ } ++ ++ setItemSelected(0, getScreen()->isChangesFocus()); ++ setItemSelected(1, ! getScreen()->isChangesFocus()); ++ setItemSelected(2, getScreen()->isReverseScroll()); ++} ++ ++ + Configmenu::Placementmenu::Placementmenu(Configmenu *cm): + Basemenu(cm->getScreen()) { + setLabel(i18n(ConfigmenuSet, ConfigmenuWindowPlacement, "Window Placement")); +diff -urN blackbox-0.65.0/src/Configmenu.hh blackbox-0.65.0-wheel/src/Configmenu.hh +--- blackbox-0.65.0/src/Configmenu.hh 2002-08-01 14:36:21.000000000 -0500 ++++ blackbox-0.65.0-wheel/src/Configmenu.hh 2002-09-23 03:08:31.000000000 -0500 +@@ -45,6 +45,18 @@ + Focusmenu(Configmenu *cm); + }; + ++ class Wheelmenu : public Basemenu { ++ private: ++ Wheelmenu(const Wheelmenu&); ++ Wheelmenu& operator=(const Wheelmenu&); ++ ++ protected: ++ virtual void itemSelected(int button, unsigned int index); ++ ++ public: ++ Wheelmenu(Configmenu *cm); ++ }; ++ + class Placementmenu : public Basemenu { + private: + Placementmenu(const Placementmenu&); +@@ -59,9 +71,11 @@ + }; + + Focusmenu *focusmenu; ++ Wheelmenu *wheelmenu; + Placementmenu *placementmenu; + + friend class Focusmenu; ++ friend class Wheelmenu; + friend class Placementmenu; + + Configmenu(const Configmenu&); +@@ -75,6 +89,7 @@ + virtual ~Configmenu(void); + + inline Basemenu *getFocusmenu(void) { return focusmenu; } ++ inline Basemenu *getWheelmenu(void) { return wheelmenu; } + inline Basemenu *getPlacementmenu(void) { return placementmenu; } + + void reconfigure(void); +diff -urN blackbox-0.65.0/src/Screen.cc blackbox-0.65.0-wheel/src/Screen.cc +--- blackbox-0.65.0/src/Screen.cc 2002-09-04 12:15:58.000000000 -0500 ++++ blackbox-0.65.0-wheel/src/Screen.cc 2002-09-25 02:49:54.000000000 -0500 +@@ -997,6 +997,7 @@ + *(session_stack + i++) = workspacemenu->getWindowID(); + + *(session_stack + i++) = configmenu->getFocusmenu()->getWindowID(); ++ *(session_stack + i++) = configmenu->getWheelmenu()->getWindowID(); + *(session_stack + i++) = configmenu->getPlacementmenu()->getWindowID(); + *(session_stack + i++) = configmenu->getWindowID(); + +@@ -1120,7 +1121,7 @@ + focused->getScreen()->getScreenNumber() == getScreenNumber() && + current_workspace->getCount() > 1) { + do { +- next = current_workspace->getNextWindowInList(next); ++ next = current_workspace->getPrevWindowInList(next); + } while(next != focused && ! next->setInputFocus()); + + if (next != focused) +@@ -1741,6 +1742,46 @@ + blackbox->checkMenu(); + rootmenu->show(); + } ++ ++ //mouse wheel up ++ } else if (xbutton->button == 4) { ++ if (this->isReverseScroll()) { ++ if (this->isChangesFocus()) ++ this->nextFocus(); ++ else ++ if (getCurrentWorkspaceID() >= getWorkspaceCount() - 1) ++ changeWorkspaceID(0); ++ else ++ changeWorkspaceID(getCurrentWorkspaceID() + 1); ++ } else { ++ if (this->isChangesFocus()) ++ this->prevFocus(); ++ else ++ if (getCurrentWorkspaceID() == 0) ++ changeWorkspaceID(getWorkspaceCount() - 1); ++ else ++ changeWorkspaceID(getCurrentWorkspaceID() - 1); ++ } ++ ++ // mouse wheel down ++ } else if (xbutton->button == 5) { ++ if (this->isReverseScroll()) { ++ if (this->isChangesFocus()) ++ this->prevFocus(); ++ else ++ if (getCurrentWorkspaceID() == 0) ++ changeWorkspaceID(getWorkspaceCount() - 1); ++ else ++ changeWorkspaceID(getCurrentWorkspaceID() - 1); ++ } else { ++ if (this->isChangesFocus()) ++ this->nextFocus(); ++ else ++ if (getCurrentWorkspaceID() >= getWorkspaceCount() - 1) ++ changeWorkspaceID(0); ++ else ++ changeWorkspaceID(getCurrentWorkspaceID() + 1); ++ } + } + } + +@@ -1762,6 +1803,26 @@ + } + + ++void BScreen::toggleMouseWheel(MouseWheel model) { ++ ++ if (model == ChangesFocus) { ++ saveChangesFocus(True); ++ } else { ++ saveChangesFocus(False); ++ } ++} ++ ++ ++void BScreen::toggleScroll(Scroll model) { ++ ++ if (model == Normal) { ++ saveReverseScroll(False); ++ } else { ++ saveReverseScroll(True); ++ } ++} ++ ++ + BTexture BScreen::readDatabaseTexture(const string &rname, + const string &rclass, + const string &default_color) { +diff -urN blackbox-0.65.0/src/Screen.hh blackbox-0.65.0-wheel/src/Screen.hh +--- blackbox-0.65.0/src/Screen.hh 2002-09-04 12:15:26.000000000 -0500 ++++ blackbox-0.65.0-wheel/src/Screen.hh 2002-09-25 00:52:15.000000000 -0500 +@@ -149,7 +149,8 @@ + + bool toolbar_on_top, toolbar_auto_hide, sloppy_focus, auto_raise, + auto_edge_balance, image_dither, ordered_dither, opaque_move, full_max, +- focus_new, focus_last, click_raise, allow_scroll_lock; ++ focus_new, focus_last, click_raise, allow_scroll_lock, changes_focus, ++ reverse_scroll; + BColor border_color; + XrmDatabase stylerc; + +@@ -200,6 +201,8 @@ + WindowShade, WindowIconify, WindowMaximize, WindowClose, WindowRaise, + WindowLower, WindowStick, WindowKill, SetStyle }; + enum FocusModel { SloppyFocus, ClickToFocus }; ++ enum MouseWheel { ChangesFocus, ChangesWorkspace }; ++ enum Scroll { Normal, Reverse }; + + BScreen(Blackbox *bb, unsigned int scrn); + ~BScreen(void); +@@ -210,6 +213,10 @@ + { return resource.toolbar_auto_hide; } + inline bool isSloppyFocus(void) const + { return resource.sloppy_focus; } ++ inline bool isChangesFocus(void) const ++ { return resource.changes_focus; } ++ inline bool isReverseScroll(void) const ++ { return resource.reverse_scroll; } + inline bool isRootColormapInstalled(void) const + { return root_colormap_installed; } + inline bool doAutoRaise(void) const { return resource.auto_raise; } +@@ -284,6 +291,8 @@ + + inline void setRootColormapInstalled(bool r) { root_colormap_installed = r; } + inline void saveSloppyFocus(bool s) { resource.sloppy_focus = s; } ++ inline void saveChangesFocus(bool s) { resource.changes_focus = s; } ++ inline void saveReverseScroll(bool s) { resource.reverse_scroll = s; } + inline void saveAutoRaise(bool a) { resource.auto_raise = a; } + inline void saveClickRaise(bool c) { resource.click_raise = c; } + inline void saveWorkspaces(unsigned int w) { resource.workspaces = w; } +@@ -352,6 +361,8 @@ + void raiseFocus(void) const; + void reconfigure(void); + void toggleFocusModel(FocusModel model); ++ void toggleMouseWheel(MouseWheel model); ++ void toggleScroll(Scroll model); + void rereadMenu(void); + void shutdown(void); + void showPosition(int x, int y); +diff -urN blackbox-0.65.0/src/Window.cc blackbox-0.65.0-wheel/src/Window.cc +--- blackbox-0.65.0/src/Window.cc 2002-09-17 10:23:35.000000000 -0500 ++++ blackbox-0.65.0-wheel/src/Window.cc 2002-09-25 02:54:17.000000000 -0500 +@@ -2663,6 +2663,12 @@ + XRaiseWindow(blackbox->getXDisplay(), + windowmenu->getSendToMenu()->getWindowID()); + } ++ } else if (be->button == 4) { //mouse wheel shade ++ if ((be->window == frame.label || be->window == frame.title) && ! flags.shaded) ++ shade(); ++ } else if (be->button == 5) { //mouse wheel unshade ++ if ((be->window == frame.label || be->window == frame.title) && flags.shaded) ++ shade(); + } + } + +diff -urN blackbox-0.65.0/src/blackbox.cc blackbox-0.65.0-wheel/src/blackbox.cc +--- blackbox-0.65.0/src/blackbox.cc 2002-08-25 05:05:45.000000000 -0500 ++++ blackbox-0.65.0-wheel/src/blackbox.cc 2002-09-24 18:16:57.000000000 -0500 +@@ -1068,6 +1068,20 @@ + fmodel.c_str()); + XrmPutLineResource(&new_blackboxrc, rc_string); + ++ string mwheel; ++ if (screen->isChangesFocus()) { ++ mwheel = "ChangesFocus"; ++ } else { ++ mwheel = "ChangesWorkspace"; ++ } ++ sprintf(rc_string, "session.screen%d.mouseWheel: %s", screen_number, ++ mwheel.c_str()); ++ XrmPutLineResource(&new_blackboxrc, rc_string); ++ ++ sprintf(rc_string, "session.screen%d.reverseScroll: %s", screen_number, ++ ((screen->isReverseScroll()) ? "True" : "False")); ++ XrmPutLineResource(&new_blackboxrc, rc_string); ++ + sprintf(rc_string, "session.screen%d.workspaces: %d", screen_number, + screen->getWorkspaceCount()); + XrmPutLineResource(&new_blackboxrc, rc_string); +@@ -1380,6 +1394,27 @@ + } + } + ++ sprintf(name_lookup, "session.screen%d.mouseWheel", screen_number); ++ sprintf(class_lookup, "Session.Screen%d.MouseWheel", screen_number); ++ screen->saveChangesFocus(True); ++ if (XrmGetResource(database, name_lookup, class_lookup, &value_type, ++ &value)) { ++ string mwheel = value.addr; ++ ++ if (mwheel.find("ChangesWorkspace") != string::npos) { ++ screen->saveChangesFocus(False); ++ } ++ } ++ ++ sprintf(name_lookup, "session.screen%d.reverseScroll", screen_number); ++ sprintf(class_lookup, "Session.Screen%d.ReverseScroll", screen_number); ++ screen->saveReverseScroll(False); ++ if (XrmGetResource(database, name_lookup, class_lookup, &value_type, ++ &value) && ++ ! strncasecmp(value.addr, "true", value.size)) { ++ screen->saveReverseScroll(True); ++ } ++ + sprintf(name_lookup, "session.screen%d.windowPlacement", screen_number); + sprintf(class_lookup, "Session.Screen%d.WindowPlacement", screen_number); + screen->savePlacementPolicy(BScreen::RowSmartPlacement); diff --git a/x11-wm/blackbox/files/digest-blackbox-0.65.0-r1 b/x11-wm/blackbox/files/digest-blackbox-0.65.0-r1 new file mode 100644 index 000000000000..ac23630d0dc1 --- /dev/null +++ b/x11-wm/blackbox/files/digest-blackbox-0.65.0-r1 @@ -0,0 +1 @@ +MD5 08560fa287c68d65fbe894696d04deaf blackbox-0.65.0.tar.gz 292950 |