all repos — openbox @ 9a64438a5a53624e5f5c7c3dbb5123e246693e5e

openbox fork - make it a bit more like ryudo

set the root window, to a color for now
Dana Jansens danakj@orodu.net
commit

9a64438a5a53624e5f5c7c3dbb5123e246693e5e

parent

bf3a40ad66d20b85c21233fce909c22f8dcf0bf8

M otk/display.ccotk/display.cc

@@ -197,7 +197,7 @@ XCloseDisplay(_display);

} -const ScreenInfo* Display::screenInfo(int snum) +const ScreenInfo* Display::screenInfo(int snum) const { assert(snum >= 0); assert(snum < (signed) ScreenCount(_display));

@@ -205,7 +205,7 @@ return _screeninfo_list[snum];

} -const ScreenInfo* Display::findScreen(Window root) +const ScreenInfo* Display::findScreen(Window root) const { for (int i = 0; i < ScreenCount(_display); ++i) if (_screeninfo_list[i]->rootWindow() == root)

@@ -214,7 +214,7 @@ return 0;

} -const RenderControl *Display::renderControl(int snum) +const RenderControl *Display::renderControl(int snum) const { assert(snum >= 0); assert(snum < (signed) ScreenCount(_display));
M otk/display.hhotk/display.hh

@@ -94,13 +94,13 @@ display.

@param snum The screen number of the screen to retrieve info on @return Info on the requested screen, in a ScreenInfo class */ - const ScreenInfo* screenInfo(int snum); + const ScreenInfo* screenInfo(int snum) const; //! Find a ScreenInfo based on a root window - const ScreenInfo* findScreen(Window root); + const ScreenInfo* findScreen(Window root) const; //! Gets the RenderControl for a screen - const RenderControl *renderControl(int snum); + const RenderControl *renderControl(int snum) const; //! Returns if the display has the xkb extension available inline bool xkb() const { return _xkb; }
M otk/rendercontrol.ccotk/rendercontrol.cc

@@ -60,6 +60,13 @@

} +void RenderControl::drawRoot(const RenderColor &color) const +{ + Window root = display->screenInfo(_screen)->rootWindow(); + XSetWindowBackground(**display, root, color.pixel()); + XClearWindow(**display, root); +} + void RenderControl::drawString(Surface& sf, const Font &font, int x, int y, const RenderColor &color, const ustring &string) const
M otk/rendercontrol.hhotk/rendercontrol.hh

@@ -71,14 +71,16 @@ virtual ~RenderControl();

static RenderControl *getRenderControl(int screen); + virtual void drawRoot(const RenderColor &color) const; + //! Draws a string onto a Surface - virtual void drawString(Surface& sf, const Font& font, int x, int y, - const RenderColor& color, - const ustring& string) const; + virtual void drawString(Surface &sf, const Font &font, int x, int y, + const RenderColor &color, + const ustring &string) const; //! Draws a background onto a Surface, as specified by a RenderTexture - virtual void drawBackground(Surface& sf, - const RenderTexture& texture) const = 0; + virtual void drawBackground(Surface &sf, + const RenderTexture &texture) const = 0; }; }
M otk/renderstyle.ccotk/renderstyle.cc

@@ -14,6 +14,8 @@ RenderStyle::RenderStyle(int screen, const std::string &stylefile)

: _screen(screen), _file(stylefile) { + _root_color = new RenderColor(_screen, 0x272a2f); + _text_color_focus = new RenderColor(_screen, 0x272a2f); _text_color_unfocus = new RenderColor(_screen, 0x676869);

@@ -220,6 +222,8 @@ }

RenderStyle::~RenderStyle() { + delete _root_color; + delete _text_color_focus; delete _text_color_unfocus;
M otk/renderstyle.hhotk/renderstyle.hh

@@ -27,6 +27,8 @@

private: int _screen; std::string _file; + + RenderColor *_root_color; RenderColor *_text_color_focus; RenderColor *_text_color_unfocus;

@@ -74,6 +76,8 @@ RenderStyle(int screen, const std::string &stylefile);

virtual ~RenderStyle(); inline int screen() const { return _screen; } + + inline RenderColor *rootColor() const { return _root_color; } inline RenderColor *textFocusColor() const { return _text_color_focus; } inline RenderColor *textUnfocusColor() const { return _text_color_unfocus; }
M src/screen.ccsrc/screen.cc

@@ -89,6 +89,7 @@ }

} _style.load(sconfig); */ + otk::display->renderControl(_number)->drawRoot(*_style.rootColor()); // set up notification of netwm support changeSupportedAtoms();