X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fscreen.cc;h=3f507afbe51ca89efd06df7edf073d09f1f5f391;hb=e3f6e0ff8195e73f2fa8c9db431941e171dd0041;hp=039d82050fa770004a9f2ff93ef877ba7353d33d;hpb=7c32ac2b3f0bfd02a1efea1d67e5ad1c3c5be93f;p=chaz%2Fopenbox diff --git a/src/screen.cc b/src/screen.cc index 039d8205..3f507afb 100644 --- a/src/screen.cc +++ b/src/screen.cc @@ -66,21 +66,8 @@ Screen::Screen(int screen) XDefineCursor(**otk::display, _info->rootWindow(), openbox->cursors().session); - // XXX: initialize the screen's style - /* - otk::ustring stylepath; - python_get_string("THEME", &stylepath); - otk::Configuration sconfig(false); - sconfig.setFile(otk::expandTilde(stylepath.c_str())); - if (!sconfig.load()) { - sconfig.setFile(otk::expandTilde(DEFAULTSTYLE)); - if (!sconfig.load()) { - printf(_("Unable to load default style: %s. Aborting.\n"), DEFAULTSTYLE); - ::exit(1); - } - } - _style.load(sconfig); - */ + // initialize the screen's style + otk::RenderStyle::setStyle(_number, _config.theme); otk::display->renderControl(_number)-> drawRoot(*otk::RenderStyle::style(_number)->rootColor()); @@ -95,19 +82,15 @@ Screen::Screen(int screen) otk::Property::atoms.cardinal, geometry, 2); // Set the net_desktop_names property - std::vector names; - python_get_stringlist("DESKTOP_NAMES", &names); otk::Property::set(_info->rootWindow(), otk::Property::atoms.net_desktop_names, - otk::Property::utf8, 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; - - if (!python_get_long("NUMBER_OF_DESKTOPS", (long*)&_num_desktops)) - _num_desktops = 1; - changeNumDesktops(_num_desktops); // set the hint + + changeNumDesktops(_config.num_desktops); // set the hint changeDesktop(0); // set the hint @@ -686,7 +669,7 @@ void Screen::unmanageWindow(Client *client) client->_modal = false; // unfocus the client (calls the focus callbacks) - client->unfocus(); + if (client->focused()) client->unfocus(); #ifdef DEBUG printf("Unmanaged window 0x%lx frame 0x%lx\n", client->window(), framewin);