aboutsummaryrefslogtreecommitdiff
path: root/src/FbCommands.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbCommands.cc')
-rw-r--r--src/FbCommands.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/FbCommands.cc b/src/FbCommands.cc
index b7ee941..f536fd8 100644
--- a/src/FbCommands.cc
+++ b/src/FbCommands.cc
@@ -25,6 +25,7 @@
25#include "fluxbox.hh" 25#include "fluxbox.hh"
26#include "Screen.hh" 26#include "Screen.hh"
27#include "CommandDialog.hh" 27#include "CommandDialog.hh"
28#include "FocusControl.hh"
28#include "Workspace.hh" 29#include "Workspace.hh"
29#include "Window.hh" 30#include "Window.hh"
30#include "Keys.hh" 31#include "Keys.hh"
@@ -279,6 +280,35 @@ void HideMenuCmd::execute() {
279 FbTk::Menu::shownMenu()->hide(); 280 FbTk::Menu::shownMenu()->hide();
280} 281}
281 282
283void ShowClientMenuCmd::execute() {
284 BScreen *screen = Fluxbox::instance()->mouseScreen();
285 if (screen == 0)
286 return;
287
288 // TODO: ClientMenu only accepts lists of FluxboxWindows for now
289 FocusControl::Focusables *win_list = 0;
290// if (m_option & FocusControl::CYCLEGROUPS) {
291 win_list = (m_option & FocusControl::CYCLELINEAR) ?
292 &screen->focusControl().creationOrderWinList() :
293 &screen->focusControl().focusedOrderWinList();
294/* } else {
295 win_list = (m_option & FocusControl::CYCLELINEAR) ?
296 &screen->focusControl().creationOrderList() :
297 &screen->focusControl().focusedOrderList();
298 } */
299
300 m_list.clear();
301 FocusControl::Focusables::iterator it = win_list->begin(),
302 it_end = win_list->end();
303 for (; it != it_end; ++it) {
304 if (typeid(**it) == typeid(FluxboxWindow) && m_pat.match(**it))
305 m_list.push_back(static_cast<FluxboxWindow *>(*it));
306 }
307
308 m_menu = new ClientMenu(*screen, m_list, 0);
309 ::showMenu(*screen, **m_menu);
310}
311
282ShowCustomMenuCmd::ShowCustomMenuCmd(const string &arguments) : custom_menu_file(arguments) {} 312ShowCustomMenuCmd::ShowCustomMenuCmd(const string &arguments) : custom_menu_file(arguments) {}
283 313
284void ShowCustomMenuCmd::execute() { 314void ShowCustomMenuCmd::execute() {