mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-05 06:31:57 -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->setOnDestroy([this](CZwlrGammaControlV1* gamma) { PROTO::gamma->destroyGammaControl(this); });
|
||||||
|
|
||||||
resource->setSetGamma([this](CZwlrGammaControlV1* gamma, int32_t fd) {
|
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);
|
LOGM(LOG, "setGamma for {}", pMonitor->szName);
|
||||||
|
|
||||||
int fdFlags = fcntl(fd, F_GETFL, 0);
|
int fdFlags = fcntl(fd, F_GETFL, 0);
|
||||||
|
Reference in New Issue
Block a user