diff --git a/apps/2048.cpp b/apps/2048.cpp index 27090f95..de2111b7 100644 --- a/apps/2048.cpp +++ b/apps/2048.cpp @@ -360,7 +360,5 @@ Result luna_main(int argc, char** argv) window->set_main_widget(game); game.reset(); - window->draw(); - return app.run(); } diff --git a/apps/about.cpp b/apps/about.cpp index 4bd95ef1..d1c4e099 100644 --- a/apps/about.cpp +++ b/apps/about.cpp @@ -42,7 +42,5 @@ Result luna_main(int argc, char** argv) ui::Label kernel_version(kernel_version_text.view()); version_info.add_widget(kernel_version); - window->draw(); - return app.run(); } diff --git a/apps/taskbar.cpp b/apps/taskbar.cpp index 1555f3e5..5a7eff56 100644 --- a/apps/taskbar.cpp +++ b/apps/taskbar.cpp @@ -48,6 +48,7 @@ Result luna_main(int argc, char** argv) auto window = TRY(ui::Window::create(bar, ui::WindowType::System)); app.set_main_window(window); + window->set_background(TASKBAR_COLOR); ui::HorizontalLayout layout(ui::Margins { 0, 0, 0, 0 }, ui::AdjustHeight::Yes, ui::AdjustWidth::No); @@ -65,7 +66,5 @@ Result luna_main(int argc, char** argv) StringView clock_command[] = { "/usr/bin/clock" }; TRY(create_widget_group_for_app(layout, { clock_command, 1 }, "/usr/share/icons/32x32/app-clock.tga")); - window->draw(); - return app.run(); } diff --git a/libui/src/App.cpp b/libui/src/App.cpp index 26c71f54..fd3e9f3d 100644 --- a/libui/src/App.cpp +++ b/libui/src/App.cpp @@ -59,6 +59,8 @@ namespace ui Result App::run() { + TRY(m_main_window->draw()); + return m_loop.run(); }