wayland/output: avoid sending events to dead outputs

ref #6835
This commit is contained in:
Vaxry
2024-07-22 16:56:51 +02:00
parent 83a5395eaa
commit 5bae7f150b
3 changed files with 12 additions and 7 deletions

View File

@@ -8,6 +8,7 @@
#include "../../helpers/signal/Signal.hpp"
class CMonitor;
class CWLOutputProtocol;
class CWLOutputResource {
public:
@@ -20,7 +21,7 @@ class CWLOutputResource {
void updateState();
WP<CMonitor> monitor;
WP<CWLOutputProtocol> owner;
WP<CWLOutputResource> self;
private:
@@ -40,6 +41,7 @@ class CWLOutputProtocol : public IWaylandProtocol {
void sendDone();
WP<CMonitor> monitor;
WP<CWLOutputProtocol> self;
// will mark the protocol for removal, will be removed when no. of bound outputs is 0 (or when overwritten by a new global)
void remove();
@@ -61,5 +63,5 @@ class CWLOutputProtocol : public IWaylandProtocol {
};
namespace PROTO {
inline std::unordered_map<std::string, UP<CWLOutputProtocol>> outputs;
inline std::unordered_map<std::string, SP<CWLOutputProtocol>> outputs;
};