add workspace indicators
This commit is contained in:
17
src/app.cpp
17
src/app.cpp
@@ -1,5 +1,7 @@
|
||||
#include "app.hpp"
|
||||
|
||||
#include <exception>
|
||||
#include <iostream>
|
||||
#include <sigc++/sigc++.h>
|
||||
|
||||
App::App() {
|
||||
@@ -15,11 +17,18 @@ App::App() {
|
||||
auto monitor = std::dynamic_pointer_cast<Gdk::Monitor>(
|
||||
monitors->get_object(i));
|
||||
if (monitor) {
|
||||
auto hyprlanMonitor = this->hyprlandService.getMonitorById(i);
|
||||
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(), this->hyprlandService, hyprlandMonitor->id);
|
||||
this->hyprlandService.printMonitor(*hyprlandMonitor); // Debugging output
|
||||
|
||||
auto bar = new Bar(monitor->gobj(), hyprlanMonitor);
|
||||
this->hyprlandService.printMonitor(*hyprlanMonitor); // Debugging output
|
||||
|
||||
bar->set_application(app);
|
||||
bar->show();
|
||||
bars.push_back(bar);
|
||||
|
||||
Reference in New Issue
Block a user