diff options
author | fluxgen <fluxgen> | 2002-05-07 14:09:32 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2002-05-07 14:09:32 (GMT) |
commit | e027cad57de13c089b03df53ecfb2b31edb5d437 (patch) | |
tree | ad51deecfdcdda0287e5af0eaf08bb39fe3494f2 /src/Clientmenu.cc | |
parent | 0ec9f1a21dba10a3f7dab273a0ba485d5cb9cb41 (diff) | |
download | fluxbox-e027cad57de13c089b03df53ecfb2b31edb5d437.zip fluxbox-e027cad57de13c089b03df53ecfb2b31edb5d437.tar.bz2 |
minor cleaning
Diffstat (limited to 'src/Clientmenu.cc')
-rw-r--r-- | src/Clientmenu.cc | 53 |
1 files changed, 28 insertions, 25 deletions
diff --git a/src/Clientmenu.cc b/src/Clientmenu.cc index 68b6173..c7fe7a9 100644 --- a/src/Clientmenu.cc +++ b/src/Clientmenu.cc | |||
@@ -1,3 +1,5 @@ | |||
1 | // Clientmenu.cc for Fluxbox | ||
2 | // Copyright (c) 2001 - 2002 Henrik Kinnunen (fluxgen@linuxmail.org) | ||
1 | // Clientmenu.cc for Blackbox - an X11 Window manager | 3 | // Clientmenu.cc for Blackbox - an X11 Window manager |
2 | // Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) | 4 | // Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) |
3 | // | 5 | // |
@@ -19,14 +21,13 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 22 | // DEALINGS IN THE SOFTWARE. |
21 | 23 | ||
22 | // stupid macros needed to access some functions in version 2 of the GNU C | 24 | //use GNU extensions |
23 | // library | 25 | #ifndef _GNU_SOURCE |
24 | #ifndef _GNU_SOURCE | 26 | #define _GNU_SOURCE |
25 | #define _GNU_SOURCE | ||
26 | #endif // _GNU_SOURCE | 27 | #endif // _GNU_SOURCE |
27 | 28 | ||
28 | #ifdef HAVE_CONFIG_H | 29 | #ifdef HAVE_CONFIG_H |
29 | # include "../config.h" | 30 | # include "../config.h" |
30 | #endif // HAVE_CONFIG_H | 31 | #endif // HAVE_CONFIG_H |
31 | 32 | ||
32 | #include "fluxbox.hh" | 33 | #include "fluxbox.hh" |
@@ -37,27 +38,29 @@ | |||
37 | #include "Workspacemenu.hh" | 38 | #include "Workspacemenu.hh" |
38 | 39 | ||
39 | 40 | ||
40 | Clientmenu::Clientmenu(Workspace *ws) : Basemenu(ws->getScreen()) { | 41 | Clientmenu::Clientmenu(Workspace *ws) : Basemenu(ws->getScreen()), |
41 | wkspc = ws; | 42 | m_wkspc(ws) { |
42 | screen = wkspc->getScreen(); | 43 | setInternalMenu(); |
43 | |||
44 | setInternalMenu(); | ||
45 | } | 44 | } |
46 | 45 | ||
47 | 46 | ||
48 | void Clientmenu::itemSelected(int button, unsigned int index) { | 47 | void Clientmenu::itemSelected(int button, unsigned int index) { |
49 | if (button > 2) return; | 48 | if (button > 2) |
50 | 49 | return; | |
51 | FluxboxWindow *win = wkspc->getWindow(index); | 50 | //get the window with index of the item we selected |
52 | if (win) { | 51 | FluxboxWindow *win = m_wkspc->getWindow(index); |
53 | if (button == 1) { | 52 | if (win) { |
54 | if (! wkspc->isCurrent()) wkspc->setCurrent(); | 53 | if (button == 1) { |
55 | } else if (button == 2) { | 54 | if (! m_wkspc->isCurrent()) |
56 | if (! wkspc->isCurrent()) win->deiconify(True, False); | 55 | m_wkspc->setCurrent(); |
57 | } | 56 | } else if (button == 2) { |
58 | wkspc->raiseWindow(win); | 57 | if (! m_wkspc->isCurrent()) |
59 | win->setInputFocus(); | 58 | win->deiconify(true, false); |
60 | } | 59 | } |
61 | 60 | m_wkspc->raiseWindow(win); | |
62 | if (! (screen->getWorkspacemenu()->isTorn() || isTorn())) hide(); | 61 | win->setInputFocus(); |
62 | } | ||
63 | |||
64 | if (! (screen()->getWorkspacemenu()->isTorn() || isTorn())) | ||
65 | hide(); | ||
63 | } | 66 | } |