base function of indicators work again
This commit is contained in:
27
src/app.cpp
27
src/app.cpp
@@ -5,10 +5,11 @@
|
||||
#include <sigc++/sigc++.h>
|
||||
|
||||
App::App() {
|
||||
this->app = Gtk::Application::create("org.example.mybar");
|
||||
|
||||
this->setupServices();
|
||||
this->notificationService.intialize();
|
||||
|
||||
this->app = Gtk::Application::create("org.example.mybar");
|
||||
this->hyprlandService = HyprlandService::getInstance();
|
||||
|
||||
app->signal_activate().connect([&]() {
|
||||
auto display = Gdk::Display::get_default();
|
||||
@@ -16,23 +17,15 @@ App::App() {
|
||||
|
||||
for (guint i = 0; i < monitors->get_n_items(); ++i) {
|
||||
auto monitor = std::dynamic_pointer_cast<Gdk::Monitor>(
|
||||
monitors->get_object(i));
|
||||
monitors->get_object(i)
|
||||
);
|
||||
|
||||
if (monitor) {
|
||||
HyprlandService::Monitor *hyprlandMonitor = nullptr;
|
||||
|
||||
try {
|
||||
hyprlandMonitor =
|
||||
this->hyprlandService->getMonitorByIndex(i);
|
||||
} catch (const std::exception &ex) {
|
||||
std::cerr << "[App] Failed to fetch Hyprland monitor: "
|
||||
<< ex.what() << std::endl;
|
||||
continue;
|
||||
}
|
||||
|
||||
auto bar = new Bar(monitor->gobj(), hyprlandMonitor->id);
|
||||
auto bar = new Bar(monitor->gobj());
|
||||
|
||||
bar->set_application(app);
|
||||
bar->show();
|
||||
bar->addLeftWidget(hyprlandService->getWorkspaceIndicatorsForMonitor(i));
|
||||
bars.push_back(bar);
|
||||
}
|
||||
}
|
||||
@@ -50,10 +43,6 @@ App::App() {
|
||||
}
|
||||
|
||||
void App::setupServices() {
|
||||
this->hyprlandService->socketEventSignal.connect(sigc::mem_fun(
|
||||
*this->hyprlandService, &HyprlandService::on_hyprland_event));
|
||||
|
||||
this->hyprlandService->start();
|
||||
this->trayService->start();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user