diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Screen.cc | 8 | ||||
-rw-r--r-- | src/Window.cc | 89 |
2 files changed, 15 insertions, 82 deletions
diff --git a/src/Screen.cc b/src/Screen.cc index a50d1ba..30cc4d3 100644 --- a/src/Screen.cc +++ b/src/Screen.cc | |||
@@ -1131,13 +1131,11 @@ void BScreen::changeWorkspaceID(unsigned int id) { | |||
1131 | 1131 | ||
1132 | currentWorkspace()->showAll(); | 1132 | currentWorkspace()->showAll(); |
1133 | 1133 | ||
1134 | if (focused && focused->isMoving()) | 1134 | if (focused && focused->isMoving()) { |
1135 | focused->setInputFocus(); | 1135 | focused->setInputFocus(); |
1136 | else | ||
1137 | FocusControl::revertFocus(*this); | ||
1138 | |||
1139 | if (focused && focused->isMoving()) | ||
1140 | focused->resumeMoving(); | 1136 | focused->resumeMoving(); |
1137 | } else | ||
1138 | FocusControl::revertFocus(*this); | ||
1141 | 1139 | ||
1142 | updateNetizenCurrentWorkspace(); | 1140 | updateNetizenCurrentWorkspace(); |
1143 | FbTk::App::instance()->sync(false); | 1141 | FbTk::App::instance()->sync(false); |
diff --git a/src/Window.cc b/src/Window.cc index 4bfa452..5634f8f 100644 --- a/src/Window.cc +++ b/src/Window.cc | |||
@@ -1986,81 +1986,11 @@ void FluxboxWindow::tempRaise() { | |||
1986 | 1986 | ||
1987 | 1987 | ||
1988 | void FluxboxWindow::raiseLayer() { | 1988 | void FluxboxWindow::raiseLayer() { |
1989 | // don't let it up to menu layer | 1989 | moveToLayer(m_layernum-1); |
1990 | if (layerNum() == ::Layer::MENU + 1) | ||
1991 | return; | ||
1992 | |||
1993 | if (!m_initialized) { | ||
1994 | m_layernum++; | ||
1995 | return; | ||
1996 | } | ||
1997 | |||
1998 | // get root window | ||
1999 | WinClient *client = getRootTransientFor(m_client); | ||
2000 | |||
2001 | // if we don't have any root window use this as root | ||
2002 | if (client == 0) | ||
2003 | client = m_client; | ||
2004 | |||
2005 | FluxboxWindow *win = client->fbwindow(); | ||
2006 | if (!win) return; | ||
2007 | |||
2008 | if (!win->isIconic()) | ||
2009 | screen().updateNetizenWindowRaise(client->window()); | ||
2010 | |||
2011 | win->layerItem().raiseLayer(); | ||
2012 | |||
2013 | // remember number just in case a transient happens to revisit this window | ||
2014 | int layer_num = win->layerItem().getLayerNum(); | ||
2015 | win->setLayerNum(layer_num); | ||
2016 | |||
2017 | WinClient::TransientList::const_iterator it = client->transientList().begin(); | ||
2018 | WinClient::TransientList::const_iterator it_end = client->transientList().end(); | ||
2019 | for (; it != it_end; ++it) { | ||
2020 | win = (*it)->fbwindow(); | ||
2021 | if (win && !win->isIconic()) { | ||
2022 | screen().updateNetizenWindowRaise((*it)->window()); | ||
2023 | win->layerItem().moveToLayer(layer_num); | ||
2024 | win->setLayerNum(layer_num); | ||
2025 | } | ||
2026 | } | ||
2027 | } | 1990 | } |
2028 | 1991 | ||
2029 | void FluxboxWindow::lowerLayer() { | 1992 | void FluxboxWindow::lowerLayer() { |
2030 | if (!m_initialized) { | 1993 | moveToLayer(m_layernum+1); |
2031 | if (m_layernum > 0) | ||
2032 | m_layernum--; | ||
2033 | return; | ||
2034 | } | ||
2035 | |||
2036 | // get root window | ||
2037 | WinClient *client = getRootTransientFor(m_client); | ||
2038 | |||
2039 | // if we don't have any root window use this as root | ||
2040 | if (client == 0) | ||
2041 | client = m_client; | ||
2042 | |||
2043 | FluxboxWindow *win = client->fbwindow(); | ||
2044 | if (!win) return; | ||
2045 | |||
2046 | if (!win->isIconic()) { | ||
2047 | screen().updateNetizenWindowLower(client->window()); | ||
2048 | } | ||
2049 | win->layerItem().lowerLayer(); | ||
2050 | // remember number just in case a transient happens to revisit this window | ||
2051 | int layer_num = win->layerItem().getLayerNum(); | ||
2052 | win->setLayerNum(layer_num); | ||
2053 | |||
2054 | WinClient::TransientList::const_iterator it = client->transientList().begin(); | ||
2055 | WinClient::TransientList::const_iterator it_end = client->transientList().end(); | ||
2056 | for (; it != it_end; ++it) { | ||
2057 | win = (*it)->fbwindow(); | ||
2058 | if (win && !win->isIconic()) { | ||
2059 | screen().updateNetizenWindowLower((*it)->window()); | ||
2060 | win->layerItem().moveToLayer(layer_num); | ||
2061 | win->setLayerNum(layer_num); | ||
2062 | } | ||
2063 | } | ||
2064 | } | 1994 | } |
2065 | 1995 | ||
2066 | 1996 | ||
@@ -2070,14 +2000,16 @@ void FluxboxWindow::moveToLayer(int layernum) { | |||
2070 | #endif // DEBUG | 2000 | #endif // DEBUG |
2071 | 2001 | ||
2072 | // don't let it set its layer into menu area | 2002 | // don't let it set its layer into menu area |
2073 | if (layernum <= ::Layer::MENU) { | 2003 | if (layernum <= ::Layer::MENU) |
2074 | layernum = ::Layer::MENU + 1; | 2004 | layernum = ::Layer::MENU + 1; |
2075 | } | 2005 | else if (layernum >= Fluxbox::instance()->getNumberOfLayers()) |
2006 | layernum = Fluxbox::instance()->getNumberOfLayers()-1; | ||
2076 | 2007 | ||
2077 | if (!m_initialized) { | 2008 | if (!m_initialized) |
2078 | m_layernum = layernum; | 2009 | m_layernum = layernum; |
2010 | |||
2011 | if (m_layernum == layernum) | ||
2079 | return; | 2012 | return; |
2080 | } | ||
2081 | 2013 | ||
2082 | // get root window | 2014 | // get root window |
2083 | WinClient *client = getRootTransientFor(m_client); | 2015 | WinClient *client = getRootTransientFor(m_client); |
@@ -2090,7 +2022,10 @@ void FluxboxWindow::moveToLayer(int layernum) { | |||
2090 | if (!win) return; | 2022 | if (!win) return; |
2091 | 2023 | ||
2092 | if (!win->isIconic()) { | 2024 | if (!win->isIconic()) { |
2093 | screen().updateNetizenWindowRaise(client->window()); | 2025 | if (layernum > m_layernum) |
2026 | screen().updateNetizenWindowRaise(client->window()); | ||
2027 | else | ||
2028 | screen().updateNetizenWindowLower(client->window()); | ||
2094 | } | 2029 | } |
2095 | win->layerItem().moveToLayer(layernum); | 2030 | win->layerItem().moveToLayer(layernum); |
2096 | // remember number just in case a transient happens to revisit this window | 2031 | // remember number just in case a transient happens to revisit this window |