aboutsummaryrefslogtreecommitdiff
path: root/src/ClientMenu.cc
diff options
context:
space:
mode:
authorHenrik Kinnunen <fluxgen@fluxbox.org>2008-09-21 18:45:01 (GMT)
committerHenrik Kinnunen <fluxgen@fluxbox.org>2008-09-21 18:45:01 (GMT)
commited53f3c623e7c3ae35672b33ae3b52759dc1a6ed (patch)
treed7ad6a0b4aa4b5540b5c89bf1817194a3f1daf4f /src/ClientMenu.cc
parent52e22a0304ef108e036cecc7c8808dc0bcf8d77b (diff)
downloadfluxbox-ed53f3c623e7c3ae35672b33ae3b52759dc1a6ed.zip
fluxbox-ed53f3c623e7c3ae35672b33ae3b52759dc1a6ed.tar.bz2
Changed icon list signal in BScreen to use the new signal system
Diffstat (limited to 'src/ClientMenu.cc')
-rw-r--r--src/ClientMenu.cc19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/ClientMenu.cc b/src/ClientMenu.cc
index f5af305..0da3773 100644
--- a/src/ClientMenu.cc
+++ b/src/ClientMenu.cc
@@ -1,5 +1,5 @@
1// ClientMenu.hh 1// ClientMenu.hh
2// Copyright (c) 2007 Fluxbox Team (fluxgen at fluxbox dot org) 2// Copyright (c) 2007-2008 Fluxbox Team (fluxgen at fluxbox dot org)
3// 3//
4// Permission is hereby granted, free of charge, to any person obtaining a 4// Permission is hereby granted, free of charge, to any person obtaining a
5// copy of this software and associated documentation files (the "Software"), 5// copy of this software and associated documentation files (the "Software"),
@@ -28,6 +28,7 @@
28#include <X11/keysym.h> 28#include <X11/keysym.h>
29 29
30#include "FbTk/MenuItem.hh" 30#include "FbTk/MenuItem.hh"
31#include "FbTk/MemFun.hh"
31 32
32namespace { // anonymous 33namespace { // anonymous
33 34
@@ -79,14 +80,16 @@ private:
79}; // end anonymous namespace 80}; // end anonymous namespace
80 81
81ClientMenu::ClientMenu(BScreen &screen, Focusables &clients, 82ClientMenu::ClientMenu(BScreen &screen, Focusables &clients,
82 FbTk::Subject *refresh): 83 bool listen_for_iconlist_changes):
83 FbMenu(screen.menuTheme(), screen.imageControl(), 84 FbMenu(screen.menuTheme(), screen.imageControl(),
84 *screen.layerManager().getLayer(Layer::MENU)), 85 *screen.layerManager().getLayer(Layer::MENU)),
85 m_list(clients), 86 m_list(clients) {
86 m_refresh_sig(refresh) { 87
88 if (listen_for_iconlist_changes) {
89 m_slots.join(screen.iconListSig(),
90 FbTk::MemFun(*this, &ClientMenu::updateClientList));
91 }
87 92
88 if (refresh)
89 refresh->attach(this);
90 refreshMenu(); 93 refreshMenu();
91 94
92} 95}
@@ -116,9 +119,7 @@ void ClientMenu::refreshMenu() {
116} 119}
117 120
118void ClientMenu::update(FbTk::Subject *subj) { 121void ClientMenu::update(FbTk::Subject *subj) {
119 if (subj == m_refresh_sig) 122 if (subj && typeid(*subj) == typeid(Focusable::FocusSubject)) {
120 refreshMenu();
121 else if (subj && typeid(*subj) == typeid(Focusable::FocusSubject)) {
122 123
123 Focusable::FocusSubject *fsubj = static_cast<Focusable::FocusSubject *>(subj); 124 Focusable::FocusSubject *fsubj = static_cast<Focusable::FocusSubject *>(subj);
124 Focusable &win = fsubj->win(); 125 Focusable &win = fsubj->win();