diff options
author | fluxgen <fluxgen> | 2004-09-11 20:29:29 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2004-09-11 20:29:29 (GMT) |
commit | b4daf0f80848bf6c0a2a77f646fa5f474710b9d7 (patch) | |
tree | 1c60098d49f80cae06884338e641ad2ca230190c /src | |
parent | 323f5188fdcf9aa5fbdbd9182ab310c8f9a7ca97 (diff) | |
download | fluxbox-b4daf0f80848bf6c0a2a77f646fa5f474710b9d7.zip fluxbox-b4daf0f80848bf6c0a2a77f646fa5f474710b9d7.tar.bz2 |
using ShowMenu commands for buttonPress event
Diffstat (limited to 'src')
-rw-r--r-- | src/fluxbox.cc | 50 |
1 files changed, 5 insertions, 45 deletions
diff --git a/src/fluxbox.cc b/src/fluxbox.cc index 320aa93..b973227 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc | |||
@@ -22,7 +22,7 @@ | |||
22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | // DEALINGS IN THE SOFTWARE. | 23 | // DEALINGS IN THE SOFTWARE. |
24 | 24 | ||
25 | // $Id: fluxbox.cc,v 1.254 2004/09/11 13:38:58 fluxgen Exp $ | 25 | // $Id: fluxbox.cc,v 1.255 2004/09/11 20:29:29 fluxgen Exp $ |
26 | 26 | ||
27 | #include "fluxbox.hh" | 27 | #include "fluxbox.hh" |
28 | 28 | ||
@@ -1104,51 +1104,11 @@ void Fluxbox::handleButtonEvent(XButtonEvent &be) { | |||
1104 | screen->getRootmenu().hide(); | 1104 | screen->getRootmenu().hide(); |
1105 | 1105 | ||
1106 | } else if (be.button == 2) { | 1106 | } else if (be.button == 2) { |
1107 | int borderw = screen->getWorkspacemenu().fbwindow().borderWidth(); | 1107 | FbCommands::ShowWorkspaceMenuCmd cmd; |
1108 | int head = screen->getHead(be.x_root, be.y_root); | 1108 | cmd.execute(); |
1109 | |||
1110 | pair<int, int> m = | ||
1111 | screen->clampToHead(head, | ||
1112 | be.x_root - (screen->getWorkspacemenu().width() / 2), | ||
1113 | be.y_root - (screen->getWorkspacemenu().titleWindow().height() / 2), | ||
1114 | screen->getWorkspacemenu().width() + 2*borderw, | ||
1115 | screen->getWorkspacemenu().height() + 2*borderw); | ||
1116 | screen->getWorkspacemenu().move(m.first, m.second); | ||
1117 | screen->getWorkspacemenu().setScreen(screen->getHeadX(head), | ||
1118 | screen->getHeadY(head), | ||
1119 | screen->getHeadWidth(head), | ||
1120 | screen->getHeadHeight(head)); | ||
1121 | |||
1122 | if (! screen->getWorkspacemenu().isVisible()) { | ||
1123 | screen->getWorkspacemenu().removeParent(); | ||
1124 | screen->getWorkspacemenu().show(); | ||
1125 | screen->getWorkspacemenu().grabInputFocus(); | ||
1126 | } | ||
1127 | } else if (be.button == 3) { | 1109 | } else if (be.button == 3) { |
1128 | //calculate placement of root menu | 1110 | FbCommands::ShowRootMenuCmd cmd; |
1129 | //and show/hide it | 1111 | cmd.execute(); |
1130 | |||
1131 | int borderw = screen->getRootmenu().fbwindow().borderWidth(); | ||
1132 | int head = screen->getHead(be.x_root, be.y_root); | ||
1133 | |||
1134 | pair<int, int> m = | ||
1135 | screen->clampToHead(head, | ||
1136 | be.x_root - (screen->getRootmenu().width() / 2), | ||
1137 | be.y_root - (screen->getRootmenu().titleWindow().height() / 2), | ||
1138 | screen->getRootmenu().width() + 2*borderw, | ||
1139 | screen->getRootmenu().height() + 2*borderw); | ||
1140 | |||
1141 | screen->getRootmenu().move(m.first, m.second); | ||
1142 | screen->getRootmenu().setScreen(screen->getHeadX(head), | ||
1143 | screen->getHeadY(head), | ||
1144 | screen->getHeadWidth(head), | ||
1145 | screen->getHeadHeight(head)); | ||
1146 | |||
1147 | if (! screen->getRootmenu().isVisible()) { | ||
1148 | checkMenu(); | ||
1149 | screen->getRootmenu().show(); | ||
1150 | screen->getRootmenu().grabInputFocus(); | ||
1151 | } | ||
1152 | } else if (screen->isDesktopWheeling() && be.button == 4) { | 1112 | } else if (screen->isDesktopWheeling() && be.button == 4) { |
1153 | screen->nextWorkspace(1); | 1113 | screen->nextWorkspace(1); |
1154 | } else if (screen->isDesktopWheeling() && be.button == 5) { | 1114 | } else if (screen->isDesktopWheeling() && be.button == 5) { |