aboutsummaryrefslogtreecommitdiff
path: root/src/FbCommands.cc
diff options
context:
space:
mode:
authorMathias Gumz <akira at fluxbox dot org>2011-02-24 10:21:16 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2011-02-24 10:21:16 (GMT)
commitf0ffaf890f65d9902ba23e2cd019de5ddba071c5 (patch)
treeecfbba4c6b1f60f5f3d259c8d9e2ef77ec261d54 /src/FbCommands.cc
parent49623390b623bcf4851e5cdd972e4c37d5103ecf (diff)
downloadfluxbox-f0ffaf890f65d9902ba23e2cd019de5ddba071c5.zip
fluxbox-f0ffaf890f65d9902ba23e2cd019de5ddba071c5.tar.bz2
moved Menu placement into ScreenPlacement::placeAndShowMenu()
Diffstat (limited to 'src/FbCommands.cc')
-rw-r--r--src/FbCommands.cc40
1 files changed, 12 insertions, 28 deletions
diff --git a/src/FbCommands.cc b/src/FbCommands.cc
index 4dffd8d..be52e47 100644
--- a/src/FbCommands.cc
+++ b/src/FbCommands.cc
@@ -22,6 +22,7 @@
22#include "FbCommands.hh" 22#include "FbCommands.hh"
23#include "fluxbox.hh" 23#include "fluxbox.hh"
24#include "Screen.hh" 24#include "Screen.hh"
25#include "ScreenPlacement.hh"
25#include "CommandDialog.hh" 26#include "CommandDialog.hh"
26#include "FocusControl.hh" 27#include "FocusControl.hh"
27#include "Workspace.hh" 28#include "Workspace.hh"
@@ -71,7 +72,7 @@ using std::ios;
71 72
72namespace { 73namespace {
73 74
74void showMenu(const BScreen &screen, FbTk::Menu &menu) { 75void showMenu(BScreen &screen, FbTk::Menu &menu) {
75 76
76 // check if menu has changed 77 // check if menu has changed
77 if (typeid(menu) == typeid(FbMenu)) { 78 if (typeid(menu) == typeid(FbMenu)) {
@@ -82,36 +83,19 @@ void showMenu(const BScreen &screen, FbTk::Menu &menu) {
82 83
83 FbMenu::setWindow(FocusControl::focusedFbWindow()); 84 FbMenu::setWindow(FocusControl::focusedFbWindow());
84 85
85 Window root_ret; // not used 86 Window ignored_w;
86 Window window_ret; // not used 87 int ignored_i;
88 unsigned int ignored_ui;
87 89
88 int rx = 0, ry = 0; 90 int x = 0;
89 int wx, wy; // not used 91 int y = 0;
90 unsigned int mask; // not used
91 92
92 XQueryPointer(menu.fbwindow().display(), 93 XQueryPointer(menu.fbwindow().display(),
93 screen.rootWindow().window(), &root_ret, &window_ret, 94 screen.rootWindow().window(), &ignored_w, &ignored_w,
94 &rx, &ry, &wx, &wy, &mask); 95 &x, &y, &ignored_i, &ignored_i, &ignored_ui);
95 96
96 int borderw = menu.fbwindow().borderWidth(); 97 screen.placementStrategy()
97 int head = screen.getHead(rx, ry); 98 .placeAndShowMenu(menu, x, y, false);
98
99 menu.updateMenu();
100 pair<int, int> m =
101 screen.clampToHead(head,
102 rx - menu.width() / 2,
103 ry - menu.titleWindow().height() / 2,
104 menu.width() + 2*borderw,
105 menu.height() + 2*borderw);
106
107 menu.move(m.first, m.second);
108 menu.setScreen(screen.getHeadX(head),
109 screen.getHeadY(head),
110 screen.getHeadWidth(head),
111 screen.getHeadHeight(head));
112
113 menu.show();
114 menu.grabInputFocus();
115} 99}
116 100
117} 101}