diff options
Diffstat (limited to 'src/fluxbox.cc')
-rw-r--r-- | src/fluxbox.cc | 62 |
1 files changed, 37 insertions, 25 deletions
diff --git a/src/fluxbox.cc b/src/fluxbox.cc index 887d0fd..f66a9c9 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.92 2003/01/12 18:50:27 fluxgen Exp $ | 25 | // $Id: fluxbox.cc,v 1.93 2003/02/02 16:32:40 rathnor Exp $ |
26 | 26 | ||
27 | 27 | ||
28 | #include "fluxbox.hh" | 28 | #include "fluxbox.hh" |
@@ -296,6 +296,7 @@ Fluxbox::Fluxbox(int m_argc, char **m_argv, const char *dpy_name, const char *rc | |||
296 | m_rc_tabs(m_resourcemanager, true, "session.tabs", "Session.Tabs"), | 296 | m_rc_tabs(m_resourcemanager, true, "session.tabs", "Session.Tabs"), |
297 | m_rc_iconbar(m_resourcemanager, true, "session.iconbar", "Session.Iconbar"), | 297 | m_rc_iconbar(m_resourcemanager, true, "session.iconbar", "Session.Iconbar"), |
298 | m_rc_colors_per_channel(m_resourcemanager, 4, "session.colorsPerChannel", "Session.ColorsPerChannel"), | 298 | m_rc_colors_per_channel(m_resourcemanager, 4, "session.colorsPerChannel", "Session.ColorsPerChannel"), |
299 | m_rc_numlayers(m_resourcemanager, 13, "session.numLayers", "Session.NumLayers"), | ||
299 | m_rc_stylefile(m_resourcemanager, "", "session.styleFile", "Session.StyleFile"), | 300 | m_rc_stylefile(m_resourcemanager, "", "session.styleFile", "Session.StyleFile"), |
300 | m_rc_menufile(m_resourcemanager, DEFAULTMENU, "session.menuFile", "Session.MenuFile"), | 301 | m_rc_menufile(m_resourcemanager, DEFAULTMENU, "session.menuFile", "Session.MenuFile"), |
301 | m_rc_keyfile(m_resourcemanager, DEFAULTKEYSFILE, "session.keyFile", "Session.KeyFile"), | 302 | m_rc_keyfile(m_resourcemanager, DEFAULTKEYSFILE, "session.keyFile", "Session.KeyFile"), |
@@ -701,7 +702,7 @@ void Fluxbox::handleEvent(XEvent * const e) { | |||
701 | win = tab->getWindow(); | 702 | win = tab->getWindow(); |
702 | if (win->getScreen()->isSloppyFocus() && (! win->isFocused()) && | 703 | if (win->getScreen()->isSloppyFocus() && (! win->isFocused()) && |
703 | (! no_focus)) { | 704 | (! no_focus)) { |
704 | win->getScreen()->getWorkspace(win->getWorkspaceNumber())->raiseWindow(win); | 705 | win->getScreen()->raiseWindow(win); |
705 | 706 | ||
706 | grab(); | 707 | grab(); |
707 | 708 | ||
@@ -1112,24 +1113,18 @@ void Fluxbox::handleKeyEvent(XKeyEvent &ke) { | |||
1112 | break; | 1113 | break; |
1113 | case Keys::NEXTWINDOW: //activate next window | 1114 | case Keys::NEXTWINDOW: //activate next window |
1114 | screen->nextFocus(key->getParam()); | 1115 | screen->nextFocus(key->getParam()); |
1115 | if (focused_window && focused_window->getTab()) | ||
1116 | focused_window->getTab()->raise(); | ||
1117 | break; | 1116 | break; |
1118 | case Keys::PREVWINDOW: //activate prev window | 1117 | case Keys::PREVWINDOW: //activate prev window |
1119 | screen->prevFocus(key->getParam()); | 1118 | screen->prevFocus(key->getParam()); |
1120 | if (focused_window && focused_window->getTab()) | ||
1121 | focused_window->getTab()->raise(); | ||
1122 | break; | 1119 | break; |
1123 | case Keys::NEXTTAB: | 1120 | case Keys::NEXTTAB: |
1124 | if (focused_window && focused_window->getTab()) { | 1121 | if (focused_window && focused_window->getTab()) { |
1125 | Tab *tab = focused_window->getTab(); | 1122 | Tab *tab = focused_window->getTab(); |
1126 | if (tab->next()) { | 1123 | if (tab->next()) { |
1127 | screen->getCurrentWorkspace()->raiseWindow( | 1124 | screen->raiseWindow(tab->next()->getWindow()); |
1128 | tab->next()->getWindow()); | ||
1129 | tab->next()->getWindow()->setInputFocus(); | 1125 | tab->next()->getWindow()->setInputFocus(); |
1130 | } else { | 1126 | } else { |
1131 | screen->getCurrentWorkspace()->raiseWindow( | 1127 | screen->raiseWindow(tab->first()->getWindow()); |
1132 | tab->first()->getWindow()); | ||
1133 | tab->first()->getWindow()->setInputFocus(); | 1128 | tab->first()->getWindow()->setInputFocus(); |
1134 | } | 1129 | } |
1135 | } | 1130 | } |
@@ -1138,12 +1133,10 @@ void Fluxbox::handleKeyEvent(XKeyEvent &ke) { | |||
1138 | if (focused_window && focused_window->getTab()) { | 1133 | if (focused_window && focused_window->getTab()) { |
1139 | Tab *tab = focused_window->getTab(); | 1134 | Tab *tab = focused_window->getTab(); |
1140 | if (tab->prev()) { | 1135 | if (tab->prev()) { |
1141 | screen->getCurrentWorkspace()->raiseWindow( | 1136 | screen->raiseWindow(tab->prev()->getWindow()); |
1142 | tab->prev()->getWindow()); | ||
1143 | tab->prev()->getWindow()->setInputFocus(); | 1137 | tab->prev()->getWindow()->setInputFocus(); |
1144 | } else { | 1138 | } else { |
1145 | screen->getCurrentWorkspace()->raiseWindow( | 1139 | screen->raiseWindow(tab->last()->getWindow()); |
1146 | tab->last()->getWindow()); | ||
1147 | tab->last()->getWindow()->setInputFocus(); | 1140 | tab->last()->getWindow()->setInputFocus(); |
1148 | } | 1141 | } |
1149 | } | 1142 | } |
@@ -1151,16 +1144,14 @@ void Fluxbox::handleKeyEvent(XKeyEvent &ke) { | |||
1151 | case Keys::FIRSTTAB: | 1144 | case Keys::FIRSTTAB: |
1152 | if (focused_window && focused_window->getTab()) { | 1145 | if (focused_window && focused_window->getTab()) { |
1153 | Tab *tab = focused_window->getTab(); | 1146 | Tab *tab = focused_window->getTab(); |
1154 | screen->getCurrentWorkspace()->raiseWindow( | 1147 | screen->raiseWindow(tab->first()->getWindow()); |
1155 | tab->first()->getWindow()); | ||
1156 | tab->first()->getWindow()->setInputFocus(); | 1148 | tab->first()->getWindow()->setInputFocus(); |
1157 | } | 1149 | } |
1158 | break; | 1150 | break; |
1159 | case Keys::LASTTAB: | 1151 | case Keys::LASTTAB: |
1160 | if (focused_window && focused_window->getTab()) { | 1152 | if (focused_window && focused_window->getTab()) { |
1161 | Tab *tab = focused_window->getTab(); | 1153 | Tab *tab = focused_window->getTab(); |
1162 | screen->getCurrentWorkspace()->raiseWindow( | 1154 | screen->raiseWindow(tab->last()->getWindow()); |
1163 | tab->last()->getWindow()); | ||
1164 | tab->last()->getWindow()->setInputFocus(); | 1155 | tab->last()->getWindow()->setInputFocus(); |
1165 | } | 1156 | } |
1166 | break; | 1157 | break; |
@@ -1180,6 +1171,11 @@ void Fluxbox::handleKeyEvent(XKeyEvent &ke) { | |||
1180 | 1171 | ||
1181 | } | 1172 | } |
1182 | break; | 1173 | break; |
1174 | case Keys::QUIT: | ||
1175 | { | ||
1176 | shutdown(); | ||
1177 | } | ||
1178 | break; | ||
1183 | case Keys::ROOTMENU: //show root menu | 1179 | case Keys::ROOTMENU: //show root menu |
1184 | { | 1180 | { |
1185 | ScreenList::iterator it = screenList.begin(); | 1181 | ScreenList::iterator it = screenList.begin(); |
@@ -1247,15 +1243,22 @@ void Fluxbox::doWindowAction(Keys::KeyAction action, const int param) { | |||
1247 | focused_window->iconify(); | 1243 | focused_window->iconify(); |
1248 | break; | 1244 | break; |
1249 | case Keys::RAISE: | 1245 | case Keys::RAISE: |
1250 | if (focused_window->hasTab()) | 1246 | focused_window->raise(); |
1251 | focused_window->getTab()->raise(); //raise the tabs if we have any | ||
1252 | focused_window->getScreen()->getWorkspace(focused_window->getWorkspaceNumber())->raiseWindow(focused_window); | ||
1253 | break; | 1247 | break; |
1254 | case Keys::LOWER: | 1248 | case Keys::LOWER: |
1255 | focused_window->getScreen()->getWorkspace(focused_window->getWorkspaceNumber())->lowerWindow(focused_window); | 1249 | focused_window->lower(); |
1256 | if (focused_window->hasTab()) | 1250 | break; |
1257 | focused_window->getTab()->lower(); //lower the tabs AND it's windows | 1251 | case Keys::RAISELAYER: |
1258 | 1252 | focused_window->getScreen()->raiseWindowLayer(focused_window); | |
1253 | break; | ||
1254 | case Keys::LOWERLAYER: | ||
1255 | focused_window->getScreen()->lowerWindowLayer(focused_window); | ||
1256 | break; | ||
1257 | case Keys::TOPLAYER: | ||
1258 | focused_window->getScreen()->moveWindowToLayer(focused_window,getBottomLayer()); | ||
1259 | break; | ||
1260 | case Keys::BOTTOMLAYER: | ||
1261 | focused_window->getScreen()->moveWindowToLayer(focused_window,getTopLayer()); | ||
1259 | break; | 1262 | break; |
1260 | case Keys::CLOSE: | 1263 | case Keys::CLOSE: |
1261 | focused_window->close(); | 1264 | focused_window->close(); |
@@ -1459,6 +1462,14 @@ void Fluxbox::update(FbTk::Subject *changedsub) { | |||
1459 | if (m_atomhandler[i]->update()) | 1462 | if (m_atomhandler[i]->update()) |
1460 | m_atomhandler[i]->updateState(win); | 1463 | m_atomhandler[i]->updateState(win); |
1461 | } | 1464 | } |
1465 | } else if ((&(win.layerSig())) == changedsub) { // layer signal | ||
1466 | #ifdef DEBUG | ||
1467 | cerr<<__FILE__<<"("<<__LINE__<<") WINDOW layer signal from "<<&win<<endl; | ||
1468 | #endif // DEBUG | ||
1469 | for (size_t i=0; i<m_atomhandler.size(); ++i) { | ||
1470 | if (m_atomhandler[i]->update()) | ||
1471 | m_atomhandler[i]->updateLayer(win); | ||
1472 | } | ||
1462 | } else if ((&(win.workspaceSig())) == changedsub) { // workspace signal | 1473 | } else if ((&(win.workspaceSig())) == changedsub) { // workspace signal |
1463 | #ifdef DEBUG | 1474 | #ifdef DEBUG |
1464 | cerr<<__FILE__<<"("<<__LINE__<<") WINDOW workspace signal from "<<&win<<endl; | 1475 | cerr<<__FILE__<<"("<<__LINE__<<") WINDOW workspace signal from "<<&win<<endl; |
@@ -1516,6 +1527,7 @@ void Fluxbox::attachSignals(FluxboxWindow &win) { | |||
1516 | win.hintSig().attach(this); | 1527 | win.hintSig().attach(this); |
1517 | win.stateSig().attach(this); | 1528 | win.stateSig().attach(this); |
1518 | win.workspaceSig().attach(this); | 1529 | win.workspaceSig().attach(this); |
1530 | win.layerSig().attach(this); | ||
1519 | for (size_t i=0; i<m_atomhandler.size(); ++i) { | 1531 | for (size_t i=0; i<m_atomhandler.size(); ++i) { |
1520 | m_atomhandler[i]->setupWindow(win); | 1532 | m_atomhandler[i]->setupWindow(win); |
1521 | } | 1533 | } |