mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-15 09:46:00 +01:00
gammactrl: guard pMonitor in setGamma
This commit is contained in:
parent
6ae89940c7
commit
c4eb194033
1 changed files with 7 additions and 0 deletions
|
@ -46,6 +46,13 @@ CGammaControl::CGammaControl(SP<CZwlrGammaControlV1> resource_, wl_resource* out
|
|||
resource->setOnDestroy([this](CZwlrGammaControlV1* gamma) { PROTO::gamma->destroyGammaControl(this); });
|
||||
|
||||
resource->setSetGamma([this](CZwlrGammaControlV1* gamma, int32_t fd) {
|
||||
if (!pMonitor) {
|
||||
LOGM(ERR, "setGamma for a dead monitor");
|
||||
resource->sendFailed();
|
||||
close(fd);
|
||||
return;
|
||||
}
|
||||
|
||||
LOGM(LOG, "setGamma for {}", pMonitor->szName);
|
||||
|
||||
int fdFlags = fcntl(fd, F_GETFL, 0);
|
||||
|
|
Loading…
Reference in a new issue