aboutsummaryrefslogtreecommitdiff
path: root/src/ClientMenu.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/ClientMenu.cc')
-rw-r--r--src/ClientMenu.cc22
1 files changed, 3 insertions, 19 deletions
diff --git a/src/ClientMenu.cc b/src/ClientMenu.cc
index 08acd40..1bb3ad1 100644
--- a/src/ClientMenu.cc
+++ b/src/ClientMenu.cc
@@ -40,27 +40,11 @@ public:
40 ~ClientMenuItem() { m_client.titleSig().detach(menu()); } 40 ~ClientMenuItem() { m_client.titleSig().detach(menu()); }
41 41
42 void click(int button, int time) { 42 void click(int button, int time) {
43 if (m_client.fbwindow() == 0) 43 FluxboxWindow *fbwin = m_client.fbwindow();
44 if (fbwin == 0)
44 return; 45 return;
45 FluxboxWindow &win = *m_client.fbwindow();
46
47 if (win.screen().currentWorkspaceID() != win.workspaceNumber() &&
48 !win.isStuck()) {
49 win.menu().hide();
50 BScreen::FollowModel model = win.screen().getUserFollowModel();
51 if (model == BScreen::IGNORE_OTHER_WORKSPACES)
52 return;
53 // fetch the window to the current workspace
54 else if ((button == 3) ^ (model == BScreen::FETCH_ACTIVE_WINDOW ||
55 win.isIconic() && model == BScreen::SEMIFOLLOW_ACTIVE_WINDOW)) {
56 win.screen().sendToWorkspace(win.screen().currentWorkspaceID(), &win, true);
57 return;
58 }
59 // warp to the workspace of the window
60 win.screen().changeWorkspaceID(win.workspaceNumber());
61 }
62 m_client.focus(); 46 m_client.focus();
63 win.raise(); 47 fbwin->raise();
64 } 48 }
65 49
66 const std::string &label() const { return m_client.title(); } 50 const std::string &label() const { return m_client.title(); }