X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2FClientmenu.cc;h=07f70439106fe0957ad725b8265e267b4842fc2f;hb=87e63d53af67d5ea98f55a27007663d4c9c8fc6c;hp=c43bce58ec9a33e2ef164603e117f1d42baed2b6;hpb=351f1d03315b84887b7532c35bdd8a49bdce1d43;p=chaz%2Fopenbox diff --git a/src/Clientmenu.cc b/src/Clientmenu.cc index c43bce58..07f70439 100644 --- a/src/Clientmenu.cc +++ b/src/Clientmenu.cc @@ -1,5 +1,6 @@ -// Clientmenu.cc for Openbox -// Copyright (c) 2001 Sean 'Shaleh' Perry +// -*- mode: C++; indent-tabs-mode: nil; -*- +// Clientmenu.cc for Blackbox - an X11 Window manager +// Copyright (c) 2001 - 2002 Sean 'Shaleh' Perry // Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) // // Permission is hereby granted, free of charge, to any person obtaining a @@ -20,44 +21,39 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// stupid macros needed to access some functions in version 2 of the GNU C -// library -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif // _GNU_SOURCE - #ifdef HAVE_CONFIG_H # include "../config.h" #endif // HAVE_CONFIG_H -#include "openbox.h" -#include "Clientmenu.h" -#include "Screen.h" -#include "Window.h" -#include "Workspace.h" -#include "Workspacemenu.h" +#include "blackbox.hh" +#include "Clientmenu.hh" +#include "Screen.hh" +#include "Window.hh" +#include "Workspace.hh" +#include "Workspacemenu.hh" + +Clientmenu::Clientmenu(Workspace *ws) : Basemenu(ws->getScreen()) { + wkspc = ws; -Clientmenu::Clientmenu(Workspace &ws) : Basemenu(*ws.getScreen()), - screen(*ws.getScreen()), wkspc(ws) -{ setInternalMenu(); } -void Clientmenu::itemSelected(int button, int index) { +void Clientmenu::itemSelected(int button, unsigned int index) { if (button > 2) return; - OpenboxWindow *win = wkspc.getWindow(index); + BlackboxWindow *win = wkspc->getWindow(index); if (win) { if (button == 1) { - if (! wkspc.isCurrent()) wkspc.setCurrent(); + if (! wkspc->isCurrent()) wkspc->setCurrent(); } else if (button == 2) { - if (! wkspc.isCurrent()) win->deiconify(True, False); + if (! wkspc->isCurrent()) win->deiconify(True, False); } - wkspc.raiseWindow(win); + wkspc->raiseWindow(win); win->setInputFocus(); } - if (! (screen.getWorkspacemenu()->isTorn() || isTorn())) hide(); + Workspacemenu* wkspcmenu = wkspc->getScreen()->getWorkspacemenu(); + if (! (wkspcmenu->isTorn() || isTorn())) hide(); }