]> Dogcows Code - chaz/openbox/blobdiff - src/frame.cc
speed up workspace switching by causing the minimal number of expose events (none...
[chaz/openbox] / src / frame.cc
index 3e1ba64aeb832c9f7e64d5fb6446d71895982c95..4e77d10636271fdad42f11fab7bc045f19ba83e7 100644 (file)
@@ -9,6 +9,7 @@ extern "C" {
 }
 
 #include "frame.hh"
+#include "config.hh"
 #include "openbox.hh"
 #include "otk/display.hh"
 #include "otk/surface.hh"
@@ -99,7 +100,8 @@ Frame::Frame(Client *client)
 
   applyStyle(*otk::RenderStyle::style(_client->screen()));
 
-  _layout = openbox->screen(_client->screen())->config().titlebar_layout;
+  _layout = "ITMC";
+  python_get_string("titlebar_layout", &_layout);
 
   // register all of the windows with the event dispatcher
   Window *w = allWindows();
@@ -446,16 +448,17 @@ void Frame::renderLabel()
     otk::pixel32 *dest = s->pixelData(), *src;
     int w = _title_sur->size().width();
   
-    src = _title_sur->pixelData() + w * (geom.bevel + 1) + geom.title_x;
+    src = _title_sur->pixelData() + w * geom.bevel + geom.title_x;
     
     // get the background under the label
-    for (int y = 0; y < geom.button_size; ++y, src += w - geom.button_size)
-      for (int x = 0; x < geom.button_size; ++x, ++dest, ++src)
+    int xd = s->size().width();
+    int yd = s->size().height();
+    for (int y = 0; y < yd; ++y, src += w - xd)
+      for (int x = 0; x < xd; ++x, ++dest, ++src)
         *dest = *src;
     control->drawImage(*s, 0, 0, 0); // no image but draw the new background
   } else
     control->drawBackground(*s, *tx);
-  control->drawBackground(*s, *tx);
 
   otk::ustring t = _client->title(); // the actual text to draw
   int x = geom.bevel;                // x coord for the text
@@ -815,7 +818,9 @@ void Frame::grabClient()
     _client->ignore_unmaps += 2;
 
   // select the event mask on the client's parent (to receive config/map req's)
-  XSelectInput(**otk::display, _plate, SubstructureRedirectMask);
+  // the ButtonPress is to catch clicks on the client border
+  XSelectInput(**otk::display, _plate, (SubstructureRedirectMask |
+                                        ButtonPressMask));
 
   // map the client so it maps when the frame does
   XMapWindow(**otk::display, _client->window());
This page took 0.021374 seconds and 4 git commands to generate.