]> Dogcows Code - chaz/openbox/blobdiff - otk/screeninfo.cc
labels are not the size of buttons
[chaz/openbox] / otk / screeninfo.cc
index 087f4efdcfb5d301e18eaf10d3dfbad64cdca5b8..689837d0202a969d41e7191d1e803ada401829d8 100644 (file)
@@ -1,8 +1,6 @@
 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
 
-#ifdef    HAVE_CONFIG_H
-#  include "../config.h"
-#endif // HAVE_CONFIG_H
+#include "config.h"
 
 extern "C" {
 #include <X11/Xlib.h>
@@ -17,13 +15,15 @@ using std::string;
 
 namespace otk {
 
-ScreenInfo::ScreenInfo(unsigned int num) {
+ScreenInfo::ScreenInfo(int num) {
+  assert(num >= 0 && num < ScreenCount(**display));
+  
   _screen = num;
 
   _root_window = RootWindow(**display, _screen);
 
-  _rect.setSize(WidthOfScreen(ScreenOfDisplay(**display,
-                                              _screen)),
+  _size = Size(WidthOfScreen(ScreenOfDisplay(**display,
+                                             _screen)),
                HeightOfScreen(ScreenOfDisplay(**display,
                                               _screen)));
   /*
@@ -80,7 +80,7 @@ ScreenInfo::ScreenInfo(unsigned int num) {
 
   _display_string = string("DISPLAY=") + default_string + '.' +
     itostring(static_cast<unsigned long>(_screen));
-  
+
 #if 0 //def    XINERAMA
   _xinerama_active = False;
 
@@ -112,12 +112,16 @@ ScreenInfo::ScreenInfo(unsigned int num) {
 
           // if we can't find any xinerama regions, then we act as if it is not
           // active, even though it said it was
-          _xinerama_active = True;
+          _xinerama_active = true;
         }
       }
     }
   }
+#else
+  _xinerama_active = false;
 #endif // XINERAMA
+  if (!_xinerama_active)
+    _xinerama_areas.push_back(Rect(Point(0, 0), _size));
 }
 
 }
This page took 0.02644 seconds and 4 git commands to generate.