mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-17 21:13:48 -07:00
@@ -49,7 +49,7 @@ SP<CWlOutput> CWLOutputResource::getResource() {
|
||||
}
|
||||
|
||||
void CWLOutputResource::updateState() {
|
||||
if (!monitor)
|
||||
if (!monitor || (owner && owner->defunct))
|
||||
return;
|
||||
|
||||
if (resource->version() >= 2)
|
||||
@@ -83,7 +83,8 @@ void CWLOutputProtocol::bindManager(wl_client* client, void* data, uint32_t ver,
|
||||
return;
|
||||
}
|
||||
|
||||
RESOURCE->self = RESOURCE;
|
||||
RESOURCE->self = RESOURCE;
|
||||
RESOURCE->owner = self;
|
||||
}
|
||||
|
||||
void CWLOutputProtocol::destroyResource(CWLOutputResource* resource) {
|
||||
|
@@ -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;
|
||||
};
|
||||
|
Reference in New Issue
Block a user