- _bg_pixmap = _texture->render(_rect.width(), _rect.height(), _bg_pixmap);
-
- if (_bg_pixmap)
- XSetWindowBackgroundPixmap(otk::OBDisplay::display, _window, _bg_pixmap);
- else {
- unsigned int pix = _texture->color().pixel();
- if (pix != _bg_pixel) {
- _bg_pixel = pix;
- XSetWindowBackground(otk::OBDisplay::display, _window, pix);
- }
- }
+ _surface = new Surface(_screen, _rect.size());
+ display->renderControl(_screen)->drawBackground(*_surface, *_texture);
+
+ if (dynamic_cast<FocusLabel*>(this))
+ printf("IM A FOCUSLABEL RENDERING\n");
+ renderForeground(); // for inherited types to render onto the _surface
+
+ XSetWindowBackgroundPixmap(**display, _window, _surface->pixmap());
+
+ delete s; // delete the old surface *after* its pixmap isn't in use anymore