]> Dogcows Code - chaz/openbox/blobdiff - src/screen.cc
80 cols
[chaz/openbox] / src / screen.cc
index 17a8c225849c875f717f4a658496ecf2eb947ccb..e2e701d3c5f4b404cf2cc418c05ab2188efcc951 100644 (file)
@@ -10,6 +10,7 @@
 #include "python.hh"
 #include "otk/display.hh"
 #include "otk/property.hh"
+#include "otk/util.hh"
 
 extern "C" {
 #ifdef    HAVE_UNISTD_H
@@ -39,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);
@@ -66,11 +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);
-  otk::display->renderControl(_number)->
-    drawRoot(*otk::RenderStyle::style(_number)->rootColor());
-
   // set up notification of netwm support
   changeSupportedAtoms();
 
@@ -81,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
@@ -669,7 +658,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);
This page took 0.024197 seconds and 4 git commands to generate.