I recently updated my blackbox to the latest CVS copy and while I was porting my switch menu patch (URL:https://sourceforge.net/tracker/index.php?func=detail&aid=708228&group_id=40696&atid=428682) i ran across a comment inside Toolbar.cc which I understood to be a TODO for adding the same fuctionality the my patch does, except under different conditions. The comment is (Toolbar.cc:662):
// XXX: current-workspace window-list menu with button 2 or 3 here..
So, I took the patch I made before and adjusted it to what I think satsifies these conditions. I closed my orginal patch submission and was going to post this one, but I wanted to have someone see if I understood the comment correctly or not before I did. The new patch is attached.
--
Keith Maika
http://kicken.mine.nu:8008/ - Personal Site.
http://wiser.kicks-ass.org:8008/ - Long-term Project.
http://www.fsf.org/philosophy/can-you-trust.html - Can you trust your computer?
http://www.fsf.org/philosophy/no-word-attachments.html - Support Free Communication.
--- blackbox_clean/src/Toolbar.cc Tue Apr 12 01:38:00 2005
+++ blackbox/src/Toolbar.cc Wed Apr 27 02:18:07 2005
@@ -23,6 +23,7 @@
// DEALINGS IN THE SOFTWARE.
#include "Toolbar.hh"
+#include "Workspace.hh"
#include "Iconmenu.hh"
#include "Screen.hh"
#include "Slit.hh"
@@ -34,6 +35,7 @@
#include <Pen.hh>
#include <PixmapCache.hh>
#include <Unicode.hh>
+#include <Menu.hh>
#include <X11/Xutil.h>
#include <sys/time.h>
@@ -660,6 +686,26 @@
_screen->prevFocus();
}
// XXX: current-workspace window-list menu with button 2 or 3 here..
+ if (event->button == 3){
+ Workspace *current_workspace =
_screen->findWorkspace(_screen->currentWorkspace());
+ if (current_workspace != NULL){
+ bt::Menu *client_menu = (bt::Menu*)current_workspace->menu();
+ if (client_menu != NULL){
+ client_menu->hideTitle();
+ client_menu->popup(event->x_root, event->y_root,
_screen->availableArea());
+ }
+#ifdef DEBUG
+ else {
+ fprintf(stderr, "Error: Toolbar::buttonPressEvent(): Unable to
get workspace client menu.\n");
+ }
+#endif //DEBUG
+ }
+#ifdef DEBUG
+ else {
+ fprintf(stderr, "Error: Toolbar::buttonPressEvent(): Unable to get
current workspace.\n");
+ }
+#endif
+ }
return;
}
