aboutsummaryrefslogtreecommitdiff
path: root/src/Screen.cc
diff options
context:
space:
mode:
authorrathnor <rathnor>2003-02-09 14:11:14 (GMT)
committerrathnor <rathnor>2003-02-09 14:11:14 (GMT)
commite3b99d4e485591df52b2398fce9adbcece2b9917 (patch)
tree44c14c5160e07e1af0671e141ae99cc1f2e66609 /src/Screen.cc
parent1a04cf1ce2649400d41c43024bd163a059cc426d (diff)
downloadfluxbox_pavel-e3b99d4e485591df52b2398fce9adbcece2b9917.zip
fluxbox_pavel-e3b99d4e485591df52b2398fce9adbcece2b9917.tar.bz2
fixing up of layer code
Diffstat (limited to 'src/Screen.cc')
-rw-r--r--src/Screen.cc156
1 files changed, 5 insertions, 151 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index 39cfa7b..33fca08 100644
--- a/src/Screen.cc
+++ b/src/Screen.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: Screen.cc,v 1.102 2003/02/03 13:52:31 fluxgen Exp $ 25// $Id: Screen.cc,v 1.103 2003/02/09 14:11:12 rathnor Exp $
26 26
27 27
28#include "Screen.hh" 28#include "Screen.hh"
@@ -1087,7 +1087,7 @@ void BScreen::updateNetizenConfigNotify(XEvent *e) {
1087FluxboxWindow *BScreen::createWindow(Window client) { 1087FluxboxWindow *BScreen::createWindow(Window client) {
1088 FluxboxWindow *win = new FluxboxWindow(client, this, getScreenNumber(), *getImageControl(), 1088 FluxboxWindow *win = new FluxboxWindow(client, this, getScreenNumber(), *getImageControl(),
1089 winFrameTheme(), *menuTheme(), 1089 winFrameTheme(), *menuTheme(),
1090 *layerManager().getLayer(0)); 1090 *layerManager().getLayer(Fluxbox::instance()->getNormalLayer()));
1091 1091
1092#ifdef SLIT 1092#ifdef SLIT
1093 if (win->initialState() == WithdrawnState) 1093 if (win->initialState() == WithdrawnState)
@@ -1326,7 +1326,7 @@ void BScreen::nextFocus(int opts) {
1326 } while (*it != focused); 1326 } while (*it != focused);
1327 1327
1328 if (*it != focused && it != wins.end()) 1328 if (*it != focused && it != wins.end())
1329 raiseWindow(*it); 1329 (*it)->raise();
1330 1330
1331 } 1331 }
1332 1332
@@ -1369,7 +1369,7 @@ void BScreen::prevFocus(int opts) {
1369 } while (*it != focused); 1369 } while (*it != focused);
1370 1370
1371 if (*it != focused && it != wins.end()) 1371 if (*it != focused && it != wins.end())
1372 raiseWindow(*it); 1372 (*it)->raise();
1373 1373
1374 } 1374 }
1375} 1375}
@@ -1390,7 +1390,7 @@ void BScreen::raiseFocus() {
1390 } 1390 }
1391 1391
1392 if ((getCurrentWorkspace()->getCount() > 1) && have_focused) 1392 if ((getCurrentWorkspace()->getCount() > 1) && have_focused)
1393 raiseWindow(fb->getFocusedWindow()); 1393 fb->getFocusedWindow()->raise();
1394} 1394}
1395 1395
1396void BScreen::initMenu() { 1396void BScreen::initMenu() {
@@ -1938,157 +1938,11 @@ void BScreen::hideGeometry() {
1938 } 1938 }
1939} 1939}
1940 1940
1941void BScreen::raise(FbTk::XLayerItem &item) {
1942 item.raise();
1943}
1944
1945void BScreen::lower(FbTk::XLayerItem &item) {
1946 item.lower();
1947}
1948
1949void BScreen::setLayer(FbTk::XLayerItem &item, int layernum) { 1941void BScreen::setLayer(FbTk::XLayerItem &item, int layernum) {
1950 m_layermanager.moveToLayer(item, layernum); 1942 m_layermanager.moveToLayer(item, layernum);
1951} 1943}
1952 1944
1953 1945
1954void BScreen::raiseWindow(FluxboxWindow *w) {
1955 if (w == 0)
1956 return;
1957
1958 FluxboxWindow *win = w;
1959
1960 while (win->getTransientFor()) {
1961 win = win->getTransientFor();
1962 assert(win != win->getTransientFor());
1963 }
1964
1965 if (win == 0)
1966 win = w;
1967
1968 if (!win->isIconic()) {
1969 updateNetizenWindowRaise(win->getClientWindow());
1970 win->getLayerItem().raise();
1971 }
1972
1973 std::list<FluxboxWindow *>::const_iterator it = win->getTransients().begin();
1974 std::list<FluxboxWindow *>::const_iterator it_end = win->getTransients().end();
1975 for (; it != it_end; ++it) {
1976 if (!(*it)->isIconic()) {
1977 updateNetizenWindowRaise((*it)->getClientWindow());
1978 (*it)->getLayerItem().raise();
1979 }
1980 }
1981}
1982
1983void BScreen::lowerWindow(FluxboxWindow *w) {
1984 FluxboxWindow *win = (FluxboxWindow *) 0, *bottom = w;
1985
1986 while (bottom->getTransientFor()) {
1987 bottom = bottom->getTransientFor();
1988 assert(bottom != bottom->getTransientFor());
1989 }
1990
1991 win = bottom;
1992
1993 if (!win->isIconic()) {
1994 updateNetizenWindowLower(win->getClientWindow());
1995 win->getLayerItem().lower();
1996 }
1997 std::list<FluxboxWindow *>::const_iterator it = win->getTransients().begin();
1998 std::list<FluxboxWindow *>::const_iterator it_end = win->getTransients().end();
1999 for (; it != it_end; ++it) {
2000 if (!(*it)->isIconic()) {
2001 updateNetizenWindowLower((*it)->getClientWindow());
2002 (*it)->getLayerItem().lower();
2003 }
2004 }
2005
2006}
2007
2008void BScreen::raiseWindowLayer(FluxboxWindow *w) {
2009 FluxboxWindow *win = w;
2010
2011 while (win->getTransientFor()) {
2012 win = win->getTransientFor();
2013 assert(win != win->getTransientFor());
2014 }
2015
2016 if (!win->isIconic()) {
2017 updateNetizenWindowRaise(win->getClientWindow());
2018 win->getLayerItem().raise();
2019 win->setLayerNum(win->getLayerNum()-1);
2020 }
2021
2022 std::list<FluxboxWindow *>::const_iterator it = win->getTransients().begin();
2023 std::list<FluxboxWindow *>::const_iterator it_end = win->getTransients().end();
2024 for (; it != it_end; ++it) {
2025 if (!(*it)->isIconic()) {
2026 updateNetizenWindowRaise((*it)->getClientWindow());
2027 (*it)->getLayerItem().raise();
2028 (*it)->setLayerNum((*it)->getLayerNum()-1);
2029 }
2030 }
2031}
2032
2033void BScreen::lowerWindowLayer(FluxboxWindow *w) {
2034 FluxboxWindow *win = (FluxboxWindow *) 0, *bottom = w;
2035
2036 while (bottom->getTransientFor()) {
2037 bottom = bottom->getTransientFor();
2038 assert(bottom != bottom->getTransientFor());
2039 }
2040
2041 win = bottom;
2042
2043 if (!win->isIconic()) {
2044 updateNetizenWindowLower(win->getClientWindow());
2045 win->getLayerItem().lower();
2046 win->setLayerNum(win->getLayerNum()+1);
2047 }
2048 std::list<FluxboxWindow *>::const_iterator it = win->getTransients().begin();
2049 std::list<FluxboxWindow *>::const_iterator it_end = win->getTransients().end();
2050 for (; it != it_end; ++it) {
2051 if (!(*it)->isIconic()) {
2052 updateNetizenWindowLower((*it)->getClientWindow());
2053 (*it)->getLayerItem().lower();
2054 (*it)->setLayerNum((*it)->getLayerNum()+1);
2055 }
2056 }
2057
2058}
2059
2060void BScreen::moveWindowToLayer(FluxboxWindow *win, int layernum) {
2061 Fluxbox * fluxbox = Fluxbox::instance();
2062
2063 // don't let it set its layer into menu area
2064 if (layernum <= fluxbox->getMenuLayer()) {
2065 layernum = fluxbox->getMenuLayer() + 1;
2066 }
2067
2068 while (win->getTransientFor()) {
2069 win = win->getTransientFor();
2070 assert(win != win->getTransientFor());
2071 }
2072
2073 if (!win->isIconic()) {
2074 updateNetizenWindowRaise(win->getClientWindow());
2075 //!! TODO
2076 //anager->moveToLayer(*win->getLayerItem(),layernum);
2077 win->setLayerNum(layernum);
2078 }
2079 std::list<FluxboxWindow *>::const_iterator it = win->getTransients().begin();
2080 std::list<FluxboxWindow *>::const_iterator it_end = win->getTransients().end();
2081 for (; it != it_end; ++it) {
2082 if (!(*it)->isIconic()) {
2083 updateNetizenWindowRaise((*it)->getClientWindow());
2084 //!! TODO
2085 //m_layermanager->moveToLayer(*(*it)->getLayerItem(), layernum);
2086 (*it)->setLayerNum(layernum);
2087 }
2088 }
2089}
2090
2091
2092/** 1946/**
2093 Goes to the workspace "right" of the current 1947 Goes to the workspace "right" of the current
2094*/ 1948*/