X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fscreen.cc;h=11f0f5d371ce4bebca2c033650e0d1b8fdb33eb4;hb=361303715b6eb54d77ed8e1c9ad8f35e44e4ede1;hp=6eaa5cc577190461a0ca2fd6022b5705ddfe758e;hpb=7fe3301e7ea905a8a76d54c22751f3d8a346e28b;p=chaz%2Fopenbox diff --git a/src/screen.cc b/src/screen.cc index 6eaa5cc5..11f0f5d3 100644 --- a/src/screen.cc +++ b/src/screen.cc @@ -40,7 +40,8 @@ namespace ob { Screen::Screen(int screen) - : _number(screen) + : _number(screen), + _config(screen) { assert(screen >= 0); assert(screen < ScreenCount(**otk::display)); _info = otk::display->screenInfo(screen); @@ -67,12 +68,6 @@ Screen::Screen(int screen) XDefineCursor(**otk::display, _info->rootWindow(), openbox->cursors().session); - // initialize the screen's style - otk::RenderStyle::setStyle(_number, _config.theme); - // draw the root window - otk::bexec("obsetroot " + otk::RenderStyle::style(_number)->rootArgs(), - _info->displayString()); - // set up notification of netwm support changeSupportedAtoms(); @@ -83,17 +78,9 @@ Screen::Screen(int screen) otk::Property::atoms.net_desktop_geometry, otk::Property::atoms.cardinal, geometry, 2); - // Set the net_desktop_names property - otk::Property::set(_info->rootWindow(), - otk::Property::atoms.net_desktop_names, - otk::Property::utf8, _config.desktop_names); - // the above set() will cause the updateDesktopNames to fire right away so - // we have a list of desktop names - _desktop = 0; - changeNumDesktops(_config.num_desktops); // set the hint - + changeNumDesktops(1); // set the hint changeDesktop(0); // set the hint // don't start in showing-desktop mode @@ -267,7 +254,7 @@ void Screen::updateStruts() for (sit = _struts.begin(); sit != send; ++sit) sit->left = sit->right = sit->top = sit->bottom = 0; - ClientList::const_iterator it, end = clients.end(); + std::list::const_iterator it, end = clients.end(); for (it = clients.begin(); it != end; ++it) { if ((*it)->iconic()) continue; // these dont count in the strut @@ -331,7 +318,7 @@ void Screen::changeWorkArea() */ if (old_area != _area[i]) { // the area has changed, adjust all the maximized windows - ClientList::iterator it, end = clients.end(); + std::list::iterator it, end = clients.end(); for (it = clients.begin(); it != end; ++it) if (i < _num_desktops) { if ((*it)->desktop() == i) @@ -455,8 +442,8 @@ void Screen::changeClientList() windows = new Window[size]; win_it = windows; - ClientList::const_iterator it = clients.begin(); - const ClientList::const_iterator end = clients.end(); + std::list::const_iterator it = clients.begin(); + const std::list::const_iterator end = clients.end(); for (; it != end; ++it, ++win_it) *win_it = (*it)->window(); } else @@ -486,8 +473,8 @@ void Screen::changeStackingList() windows = new Window[size]; win_it = windows; - ClientList::const_reverse_iterator it = _stacking.rbegin(); - const ClientList::const_reverse_iterator end = _stacking.rend(); + std::list::const_reverse_iterator it = _stacking.rbegin(); + const std::list::const_reverse_iterator end = _stacking.rend(); for (; it != end; ++it, ++win_it) *win_it = (*it)->window(); } else @@ -689,8 +676,8 @@ void Screen::lowerWindow(Client *client) assert(!_stacking.empty()); // this would be bad - ClientList::iterator it = --_stacking.end(); - const ClientList::iterator end = _stacking.begin(); + std::list::iterator it = --_stacking.end(); + const std::list::iterator end = _stacking.begin(); if (client->modal() && client->transientFor()) { // don't let a modal window lower below its transient_for @@ -698,7 +685,8 @@ void Screen::lowerWindow(Client *client) assert(it != _stacking.end()); wins[0] = (it == _stacking.begin() ? _focuswindow : - ((*(--ClientList::const_iterator(it)))->frame->window())); + ((*(--std::list::const_iterator(it)))-> + frame->window())); wins[1] = client->frame->window(); if (wins[0] == wins[1]) return; // already right above the window @@ -732,8 +720,8 @@ void Screen::raiseWindow(Client *client) // remove the client before looking so we can't run into ourselves _stacking.remove(client); - ClientList::iterator it = _stacking.begin(); - const ClientList::iterator end = _stacking.end(); + std::list::iterator it = _stacking.begin(); + const std::list::iterator end = _stacking.end(); // the stacking list is from highest to lowest for (; it != end && ((*it)->layer() > client->layer() || m == *it); ++it); @@ -743,7 +731,7 @@ void Screen::raiseWindow(Client *client) otherwise, we want to stack under the previous window in the stack. */ wins[0] = (it == _stacking.begin() ? _focuswindow : - ((*(--ClientList::const_iterator(it)))->frame->window())); + ((*(--std::list::const_iterator(it)))->frame->window())); wins[1] = client->frame->window(); _stacking.insert(it, client); @@ -768,7 +756,7 @@ void Screen::changeDesktop(unsigned int desktop) if (old == _desktop) return; - ClientList::iterator it, end = clients.end(); + std::list::iterator it, end = clients.end(); for (it = clients.begin(); it != end; ++it) (*it)->showhide(); @@ -784,7 +772,7 @@ void Screen::changeNumDesktops(unsigned int num) if (!(num > 0)) return; // move windows on desktops that will no longer exist! - ClientList::iterator it, end = clients.end(); + std::list::iterator it, end = clients.end(); for (it = clients.begin(); it != end; ++it) { unsigned int d = (*it)->desktop(); if (d >= num && d != 0xffffffff) { @@ -887,7 +875,7 @@ void Screen::showDesktop(bool show) _showing_desktop = show; - ClientList::iterator it, end = clients.end(); + std::list::iterator it, end = clients.end(); for (it = clients.begin(); it != end; ++it) { if ((*it)->type() == Client::Type_Desktop) { if (show)