fix bar crashing on monitor add/remove
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user