diff options
author | fluxgen <fluxgen> | 2002-04-09 09:42:16 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2002-04-09 09:42:16 (GMT) |
commit | 4d6f6ba54f34c8465d0b3179fe0fbd42d935edf2 (patch) | |
tree | a4327e889256f0816630c965c43fe3da60991f26 /src | |
parent | b7ca86795e60c0d5f11a75c7ac1b1235f7d3b4fe (diff) | |
download | fluxbox_paul-4d6f6ba54f34c8465d0b3179fe0fbd42d935edf2.zip fluxbox_paul-4d6f6ba54f34c8465d0b3179fe0fbd42d935edf2.tar.bz2 |
added action RootMenu
Diffstat (limited to 'src')
-rw-r--r-- | src/fluxbox.cc | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/src/fluxbox.cc b/src/fluxbox.cc index 3d7cc2d..f183851 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.46 2002/04/08 22:36:30 fluxgen Exp $ | 25 | // $Id: fluxbox.cc,v 1.47 2002/04/09 09:42:16 fluxgen Exp $ |
26 | 26 | ||
27 | //Use some GNU extensions | 27 | //Use some GNU extensions |
28 | #ifndef _GNU_SOURCE | 28 | #ifndef _GNU_SOURCE |
@@ -282,7 +282,7 @@ getString() { | |||
282 | Fluxbox *Fluxbox::singleton=0; | 282 | Fluxbox *Fluxbox::singleton=0; |
283 | 283 | ||
284 | //------------ instance --------------------- | 284 | //------------ instance --------------------- |
285 | //returns singleton object of blackbox class | 285 | //returns singleton object of Fluxbox class |
286 | //since we only need to create one instance of Fluxbox | 286 | //since we only need to create one instance of Fluxbox |
287 | //------------------------------------------- | 287 | //------------------------------------------- |
288 | Fluxbox *Fluxbox::instance(int m_argc, char **m_argv, char *dpy_name, char *rc) { | 288 | Fluxbox *Fluxbox::instance(int m_argc, char **m_argv, char *dpy_name, char *rc) { |
@@ -1269,6 +1269,47 @@ void Fluxbox::handleKeyEvent(XKeyEvent &ke) { | |||
1269 | 1269 | ||
1270 | } | 1270 | } |
1271 | break; | 1271 | break; |
1272 | case Keys::ROOTMENU: //show root menu | ||
1273 | { | ||
1274 | LinkedListIterator<BScreen> it(screenList); | ||
1275 | |||
1276 | for (; it.current(); it++) { | ||
1277 | |||
1278 | BScreen *screen = it.current(); | ||
1279 | if (ke.window != screen->getRootWindow()) | ||
1280 | continue; | ||
1281 | |||
1282 | //calculate placement of workspace menu | ||
1283 | //and show/hide it | ||
1284 | int mx = ke.x_root - | ||
1285 | (screen->getRootmenu()->width() / 2); | ||
1286 | int my = ke.y_root - | ||
1287 | (screen->getRootmenu()->titleHeight() / 2); | ||
1288 | |||
1289 | if (mx < 0) mx = 0; | ||
1290 | if (my < 0) my = 0; | ||
1291 | |||
1292 | if (mx + screen->getRootmenu()->width() > screen->getWidth()) { | ||
1293 | mx = screen->getWidth() - | ||
1294 | screen->getRootmenu()->width() - | ||
1295 | screen->getBorderWidth(); | ||
1296 | } | ||
1297 | |||
1298 | if (my + screen->getRootmenu()->height() > | ||
1299 | screen->getHeight()) { | ||
1300 | my = screen->getHeight() - | ||
1301 | screen->getRootmenu()->height() - | ||
1302 | screen->getBorderWidth(); | ||
1303 | } | ||
1304 | screen->getRootmenu()->move(mx, my); | ||
1305 | |||
1306 | if (! screen->getRootmenu()->isVisible()) { | ||
1307 | checkMenu(); | ||
1308 | screen->getRootmenu()->show(); | ||
1309 | } | ||
1310 | } | ||
1311 | } | ||
1312 | break; | ||
1272 | default: //try to see if its a window action | 1313 | default: //try to see if its a window action |
1273 | doWindowAction(action, key->getParam()); | 1314 | doWindowAction(action, key->getParam()); |
1274 | } | 1315 | } |