mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-05 06:31:57 -07:00
@@ -2,7 +2,7 @@
|
||||
#include "../Compositor.hpp"
|
||||
#include "core/Output.hpp"
|
||||
|
||||
COutputPower::COutputPower(SP<CZwlrOutputPowerV1> resource_, CMonitor* pMonitor_) : resource(resource_), pMonitor(pMonitor_) {
|
||||
COutputPower::COutputPower(SP<CZwlrOutputPowerV1> resource_, PHLMONITOR pMonitor_) : resource(resource_), pMonitor(pMonitor_) {
|
||||
if (!resource->resource())
|
||||
return;
|
||||
|
||||
@@ -24,7 +24,7 @@ COutputPower::COutputPower(SP<CZwlrOutputPowerV1> resource_, CMonitor* pMonitor_
|
||||
resource->sendMode(pMonitor->dpmsStatus ? ZWLR_OUTPUT_POWER_V1_MODE_ON : ZWLR_OUTPUT_POWER_V1_MODE_OFF);
|
||||
|
||||
listeners.monitorDestroy = pMonitor->events.destroy.registerListener([this](std::any v) {
|
||||
pMonitor = nullptr;
|
||||
pMonitor.reset();
|
||||
resource->sendFailed();
|
||||
});
|
||||
|
||||
@@ -68,7 +68,7 @@ void COutputPowerProtocol::onGetOutputPower(CZwlrOutputPowerManagerV1* pMgr, uin
|
||||
}
|
||||
|
||||
const auto CLIENT = pMgr->client();
|
||||
const auto RESOURCE = m_vOutputPowers.emplace_back(std::make_unique<COutputPower>(makeShared<CZwlrOutputPowerV1>(CLIENT, pMgr->version(), id), OUTPUT->monitor.get())).get();
|
||||
const auto RESOURCE = m_vOutputPowers.emplace_back(std::make_unique<COutputPower>(makeShared<CZwlrOutputPowerV1>(CLIENT, pMgr->version(), id), OUTPUT->monitor.lock())).get();
|
||||
|
||||
if (!RESOURCE->good()) {
|
||||
pMgr->noMemory();
|
||||
|
Reference in New Issue
Block a user