]> Dogcows Code - chaz/openbox/blobdiff - otk/style.cc
handle unmaps better. all thanks to acroread sending wacky unmap events
[chaz/openbox] / otk / style.cc
index 5aeef434a249532cc35ef213d08a44d034189249..fe34bbf41ec1c5e92f931e6470e2b5ac63f761ab 100644 (file)
@@ -66,13 +66,21 @@ void Style::load(const Configuration &style) {
 
   b_focus = readDatabaseTexture("window.button.focus", "white", style);
   b_unfocus = readDatabaseTexture("window.button.unfocus", "black", style);
-  b_pressed = readDatabaseTexture("window.button.pressed", "black", style);
 
   //if neither of these can be found, we will use the previous resource
   b_pressed_focus = readDatabaseTexture("window.button.pressed.focus",
                                         "black", style, true);
+  if (b_pressed_focus.texture() == BTexture::NoTexture) {
+    b_pressed_focus = readDatabaseTexture("window.button.pressed", "black",
+                                          style);
+  }
+    
   b_pressed_unfocus = readDatabaseTexture("window.button.pressed.unfocus",
                                           "black", style, true);
+  if (b_pressed_unfocus.texture() == BTexture::NoTexture) {
+    b_pressed_unfocus = readDatabaseTexture("window.button.pressed", "black",
+                                            style);
+  }
 
   if (close_button.mask != None)
     XFreePixmap(OBDisplay::display, close_button.mask);
@@ -165,10 +173,8 @@ void Style::readDatabaseMask(const std::string &rname, PixmapMask &pixmapMask,
   int hx, hy; //ignored
   int ret = BitmapOpenFailed; //default to failure.
   
-  if (style.getValue(rname, s))
-  {
-    if (s[0] != '/' && s[0] != '~')
-    {
+  if (style.getValue(rname, s)) {
+    if (s[0] != '/' && s[0] != '~') {
       std::string xbmFile = std::string("~/.openbox/buttons/") + s;
       ret = XReadBitmapFile(OBDisplay::display, root_window,
                             expandTilde(xbmFile).c_str(), &pixmapMask.w,
This page took 0.024519 seconds and 4 git commands to generate.