mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-04 14:11:59 -07:00
gammactrl: guard pMonitor in setGamma
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user