renderer: accept custom state requests for fake outputs
This commit is contained in:
parent
d5950f7719
commit
305b1419c8
3 changed files with 90 additions and 75 deletions
|
|
@ -209,10 +209,20 @@ 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;
|
||||
|
||||
// TODO: maybe don't ignore?
|
||||
if (!PMONITOR->createdByUser)
|
||||
return;
|
||||
|
||||
const auto SIZE = E->state->mode ? Vector2D{E->state->mode->width, E->state->mode->height} : Vector2D{E->state->custom_mode.width, E->state->custom_mode.height};
|
||||
|
||||
PMONITOR->forceSize = SIZE;
|
||||
|
||||
SMonitorRule rule = PMONITOR->activeMonitorRule;
|
||||
rule.resolution = SIZE;
|
||||
|
||||
g_pHyprRenderer->applyMonitorRule(PMONITOR, &rule);
|
||||
}
|
||||
|
||||
void Events::listener_monitorDamage(void* owner, void* data) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue