monitor: wrap usage of wlr_output_state

for better control and convenience in usage.

fixes #4546
This commit is contained in:
Vaxry 2024-01-28 01:57:13 +00:00
parent 9002657bcc
commit bfcc2adbda
8 changed files with 124 additions and 101 deletions

View file

@ -183,9 +183,9 @@ void Events::listener_powerMgrSetMode(wl_listener* listener, void* data) {
return;
}
wlr_output_state_set_enabled(&PMONITOR->outputState, EVENT->mode == 1);
wlr_output_state_set_enabled(PMONITOR->state.wlr(), EVENT->mode == 1);
if (!wlr_output_commit_state(EVENT->output, &PMONITOR->outputState))
if (!PMONITOR->state.commit())
Debug::log(ERR, "Couldn't set power mode");
}

View file

@ -209,10 +209,10 @@ void Events::listener_monitorDestroy(void* owner, void* data) {
}
void Events::listener_monitorStateRequest(void* owner, void* data) {
const auto PMONITOR = (CMonitor*)owner;
const auto E = (wlr_output_event_request_state*)data;
//const auto PMONITOR = (CMonitor*)owner;
//const auto E = (wlr_output_event_request_state*)data;
wlr_output_commit_state(PMONITOR->output, E->state);
// TODO: maybe don't ignore?
}
void Events::listener_monitorDamage(void* owner, void* data) {