fix bar crashing on monitor add/remove

This commit is contained in:
2026-02-09 13:49:52 +01:00
parent a90d1c2f6c
commit e1217305a5
30 changed files with 1186 additions and 247 deletions

View File

@@ -1,31 +1,36 @@
#pragma once
#include <vector>
#include <memory>
#include "bar/bar.hpp"
#include "connection/dbus/notification.hpp"
#include "connection/dbus/tray.hpp"
#include "services/hyprland.hpp"
#include "widgets/wallpaperWindow.hpp"
#include "services/notificationController.hpp"
#include "gdkmm/monitor.h"
#include "glibmm/refptr.h"
#include "gtkmm/application.h"
class MprisController;
class App {
public:
struct BarMonitorPair {
std::shared_ptr<Bar> bar;
std::shared_ptr<Gdk::Monitor> window;
};
App();
int run();
private:
Glib::RefPtr<Gtk::Application> app;
std::vector<std::shared_ptr<Bar>> bars;
std::vector<std::shared_ptr<WallpaperWindow>> wallpaperWindows;
std::shared_ptr<NotificationService> notificationService = nullptr;
std::shared_ptr<MprisController> mprisController = nullptr;
HyprlandService *hyprlandService = nullptr;
std::map<std::string, BarMonitorPair> bars;
std::shared_ptr<NotificationService> notificationService = NotificationService::getInstance();
std::shared_ptr<NotificationController> notificationController = NotificationController::getInstance();
std::shared_ptr<MprisController> mprisController = MprisController::getInstance();
std::shared_ptr<HyprlandService> hyprlandService = HyprlandService::getInstance();
TrayService *trayService = TrayService::getInstance();
void setupServices();