]> Dogcows Code - chaz/openbox/commitdiff
use a solid color for the default background
authorDana Jansens <danakj@orodu.net>
Mon, 10 Feb 2003 02:30:52 +0000 (02:30 +0000)
committerDana Jansens <danakj@orodu.net>
Mon, 10 Feb 2003 02:30:52 +0000 (02:30 +0000)
otk/widget.cc

index 30b03bc83839922e9575a0ecbfa41b54a9bb0560..eccbb5212392079238fb5894610ec5fa4a8a6d2a 100644 (file)
@@ -37,7 +37,6 @@ Widget::Widget(int screen, EventDispatcher *ed, Direction direction, int bevel,
 {
   createWindow(overrideredir);
   _dispatcher->registerHandler(_window, this);
-  styleChanged(*RenderStyle::style(_screen));
 }
 
 Widget::Widget(Widget *parent, Direction direction, int bevel)
@@ -485,7 +484,14 @@ void Widget::layoutVert()
 
 void Widget::render()
 {
-  if (!_texture || !_dirty) return;
+  if (!_dirty) return;
+  if (!_texture) {
+    // set a solid color as the default background
+    XSetWindowBackground(**display, _window,
+                         RenderStyle::style(_screen)->
+                         titlebarUnfocusBackground()->color().pixel());
+    return;
+  }
   if (_borderwidth * 2 > _area.width() ||
       _borderwidth * 2 > _area.height())
     return; // no surface to draw on
@@ -514,9 +520,9 @@ void Widget::renderChildren()
     (*it)->render();
 }
 
-void Widget::styleChanged(const RenderStyle &style)
+void Widget::styleChanged(const RenderStyle &)
 {
-  _texture = style.titlebarUnfocusBackground();
+  refresh();
 }
 
 void Widget::exposeHandler(const XExposeEvent &e)
This page took 0.029042 seconds and 4 git commands to generate.