X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=otk%2Fapplication.cc;h=94842ca5848dd96617e84a91d6cb20ed54cbfc52;hb=1e58c863bbaddd2f2dbebfde740ca842e8837a1c;hp=e4de62c16bc8cf36e83b2a126d73be55b5bec761;hpb=033e9843bcec8340c9e657fe0f0519f86075424b;p=chaz%2Fopenbox diff --git a/otk/application.cc b/otk/application.cc index e4de62c1..94842ca5 100644 --- a/otk/application.cc +++ b/otk/application.cc @@ -1,15 +1,13 @@ // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*- -#ifdef HAVE_CONFIG_H -# include "../config.h" -#endif +#include "config.h" #include "application.hh" #include "eventhandler.hh" -#include "widget.hh" #include "timer.hh" #include "property.hh" #include "rendercolor.hh" +#include "renderstyle.hh" extern "C" { #ifdef HAVE_STDLIB_H @@ -30,17 +28,19 @@ Application::Application(int argc, char **argv) (void)argc; (void)argv; + _screen = DefaultScreen(*_display); + Timer::initialize(); RenderColor::initialize(); + RenderStyle::initialize(); Property::initialize(); - _style = new RenderStyle(DefaultScreen(*_display), ""); // XXX: get a path! loadStyle(); } Application::~Application() { - delete _style; + RenderStyle::destroy(); RenderColor::destroy(); Timer::destroy(); } @@ -63,6 +63,8 @@ void Application::run(void) while (_appwidget_count > 0) { dispatchEvents(); + if (_appwidget_count <= 0) + break; Timer::dispatchTimers(); // fire pending events } }