From 74454c8f2a8f1fcae493930a5a00cafab0959a4c Mon Sep 17 00:00:00 2001 From: pekdon Date: Fri, 18 Jan 2002 18:28:17 +0000 Subject: Fixed lower/raise of windows when using keybindings/windowmenu --- ChangeLog | 2 ++ src/Tab.cc | 23 ++++++++++++++++++++++- src/Tab.hh | 3 ++- src/Window.cc | 6 ++++-- src/Windowmenu.cc | 6 +++++- src/fluxbox.cc | 11 ++++++++--- 6 files changed, 43 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index fb7d990..6422eb9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,8 @@ Changes for 0.1.7: * Fixed indent in Window.hh *02/01/15: * Fixed exception in FluxboxWindow::FluxboxWindow + * Fixed lower/raise of windows when using windowmenu/keybinding + so now tabs should follow. (Claes Nästén) *02/01/14: * Fixed throw statement in FluxboxWindow diff --git a/src/Tab.cc b/src/Tab.cc index 975c2d9..d05d7d5 100644 --- a/src/Tab.cc +++ b/src/Tab.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Tab.cc,v 1.14 2002/01/09 14:11:20 fluxgen Exp $ +// $Id: Tab.cc,v 1.15 2002/01/18 18:28:17 pekdon Exp $ #include "Tab.hh" @@ -157,6 +157,27 @@ void Tab::raise() { m_win->getScreen()->raiseWindows(&first->m_tabwin, 1); } +//-------------- lower -------------------- +// Lowers the tabs in the tablist AND +// the windows the tabs relate to +//----------------------------------------- +void Tab::lower() { + Tab *current = this; + FluxboxWindow *win = 0; //convinence + //this have to be done in the correct order, otherwise we'll switch the window + //beeing ontop in the group + do { + XLowerWindow(m_display, current->m_tabwin); //lower tabwin and tabs window + win = current->getWindow(); + win->getScreen()->getWorkspace(win->getWorkspaceNumber())->lowerWindow(win); + + current = current->next(); //get next + if (current == 0) + current = getFirst(this); //there weren't any after, get the first + + } while (current != this); +} + //-------------- loadTheme ----------------- // loads the texture with the correct // width and height, this is necessary in diff --git a/src/Tab.hh b/src/Tab.hh index 53a3227..a0e3737 100644 --- a/src/Tab.hh +++ b/src/Tab.hh @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Tab.hh,v 1.6 2002/01/11 09:44:35 fluxgen Exp $ +// $Id: Tab.hh,v 1.7 2002/01/18 18:28:17 pekdon Exp $ #ifndef _TAB_HH_ #define _TAB_HH_ @@ -55,6 +55,7 @@ public: void deiconify(); void iconify(); void raise(); + void lower(); void withdraw(); void stick(); void resize(); diff --git a/src/Window.cc b/src/Window.cc index a7997c9..212a1c2 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Window.cc,v 1.20 2002/01/18 01:25:58 fluxgen Exp $ +// $Id: Window.cc,v 1.21 2002/01/18 18:28:17 pekdon Exp $ // stupid macros needed to access some functions in version 2 of the GNU C // library @@ -2834,13 +2834,15 @@ void FluxboxWindow::buttonPressEvent(XButtonEvent *be) { if (windowmenu && windowmenu->isVisible()) windowmenu->hide(); //raise tab first if there is any - if (tab) + if (hasTab()) tab->raise(); screen->getWorkspace(workspace_number)->raiseWindow(this); } } else if (be->button == 2 && be->window == frame.label) { screen->getWorkspace(workspace_number)->lowerWindow(this); + if (hasTab()) + getTab()->lower(); //lower the tab AND it's windows } else if (windowmenu && be->button == 3 && (frame.title == be->window || frame.label == be->window || diff --git a/src/Windowmenu.cc b/src/Windowmenu.cc index c776981..dcf6bd6 100644 --- a/src/Windowmenu.cc +++ b/src/Windowmenu.cc @@ -200,12 +200,16 @@ void Windowmenu::itemSelected(int button, int index) { case BScreen::WINDOWRAISE: hide(); + if (window->hasTab()) + window->getTab()->raise(); //raise tabs screen->getWorkspace(window->getWorkspaceNumber())->raiseWindow(window); break; case BScreen::WINDOWLOWER: hide(); - screen->getWorkspace(window->getWorkspaceNumber())->lowerWindow(window); + screen->getWorkspace(window->getWorkspaceNumber())->lowerWindow(window); + if (window->hasTab()) + window->getTab()->lower(); //lower tabs AND all it's windows break; case BScreen::WINDOWSTICK: diff --git a/src/fluxbox.cc b/src/fluxbox.cc index 1eea987..11df79c 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: fluxbox.cc,v 1.21 2002/01/18 01:23:54 fluxgen Exp $ +// $Id: fluxbox.cc,v 1.22 2002/01/18 18:28:17 pekdon Exp $ // stupid macros needed to access some functions in version 2 of the GNU C // library @@ -1154,10 +1154,15 @@ void Fluxbox::doWindowAction(Keys::KeyAction action) { focused_window->iconify(); break; case Keys::RAISE: - focused_window->getScreen()->getWorkspace(focused_window->getWorkspaceNumber())->raiseWindow(focused_window); + if (focused_window->hasTab()) + focused_window->getTab()->raise(); //raise the tabs if we have any + focused_window->getScreen()->getWorkspace(focused_window->getWorkspaceNumber())->raiseWindow(focused_window); break; case Keys::LOWER: - XLowerWindow(getXDisplay(), focused_window->getFrameWindow()); + focused_window->getScreen()->getWorkspace(focused_window->getWorkspaceNumber())->lowerWindow(focused_window); + if (focused_window->hasTab()) + focused_window->getTab()->lower(); //lower the tabs AND it's windows + break; case Keys::CLOSE: focused_window->close(); -- cgit v0.11.2