mirror of
https://github.com/hyprwm/Hyprland.git
synced 2024-10-30 05:51:44 +00:00
gammactrl: guard pMonitor in setGamma
This commit is contained in:
parent
6ae89940c7
commit
c4eb194033
@ -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 New Issue
Block a user