summaryrefslogtreecommitdiff
path: root/src/protocols/OutputPower.cpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2024-06-08 10:07:59 +0200
committerGitHub <noreply@github.com>2024-06-08 10:07:59 +0200
commit6967a31450441fc5605c05db6f65505dace4b263 (patch)
tree255a3cff7f3e2eb8a50c952eab9b270a7937561d /src/protocols/OutputPower.cpp
parentc31d9ef4172452f6f219f91d9b87a24d91f0cf3a (diff)
wayland/core: move to new impl (#6268)
* wayland/core/dmabuf: move to new impl it's the final countdown
Diffstat (limited to 'src/protocols/OutputPower.cpp')
-rw-r--r--src/protocols/OutputPower.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/protocols/OutputPower.cpp b/src/protocols/OutputPower.cpp
index db241048..ef287cfa 100644
--- a/src/protocols/OutputPower.cpp
+++ b/src/protocols/OutputPower.cpp
@@ -1,5 +1,6 @@
#include "OutputPower.hpp"
#include "../Compositor.hpp"
+#include "core/Output.hpp"
#define LOGM PROTO::outputPower->protoLog
@@ -61,15 +62,15 @@ void COutputPowerProtocol::destroyOutputPower(COutputPower* power) {
void COutputPowerProtocol::onGetOutputPower(CZwlrOutputPowerManagerV1* pMgr, uint32_t id, wl_resource* output) {
- const auto PMONITOR = g_pCompositor->getMonitorFromOutput(wlr_output_from_resource(output));
+ const auto OUTPUT = CWLOutputResource::fromResource(output);
- if (!PMONITOR) {
+ if (!OUTPUT) {
pMgr->error(0, "Invalid output resource");
return;
}
const auto CLIENT = pMgr->client();
- const auto RESOURCE = m_vOutputPowers.emplace_back(std::make_unique<COutputPower>(makeShared<CZwlrOutputPowerV1>(CLIENT, pMgr->version(), id), PMONITOR)).get();
+ const auto RESOURCE = m_vOutputPowers.emplace_back(std::make_unique<COutputPower>(makeShared<CZwlrOutputPowerV1>(CLIENT, pMgr->version(), id), OUTPUT->monitor.get())).get();
if (!RESOURCE->good()) {
pMgr->noMemory();