summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-08-21 07:04:01 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-08-21 07:56:44 +0100
commit726f1a38a572a8a6121e5194269fb549c363d9f6 (patch)
treee4c173b227cb417b4e34092cb820bbc05320e160
parentf5469681b620d9d6ccaf53e92ed31f931cb03b0d (diff)
sna: Only send the bl change notification if the randr_output exists
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_display.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index ebda05ec..710f938f 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -510,15 +510,17 @@ sna_backlight_uevent(int fd, void *closure)
sna_output->backlight_active_level = val;
- DBG(("%s(%s): sending change notification\n", __FUNCTION__, output->name));
- RRChangeOutputProperty(output->randr_output,
- backlight_atom, XA_INTEGER,
- 32, PropModeReplace, 1, &val,
- TRUE, FALSE);
- RRChangeOutputProperty(output->randr_output,
- backlight_deprecated_atom, XA_INTEGER,
- 32, PropModeReplace, 1, &val,
- TRUE, FALSE);
+ if (output->randr_output) {
+ DBG(("%s(%s): sending change notification\n", __FUNCTION__, output->name));
+ RRChangeOutputProperty(output->randr_output,
+ backlight_atom, XA_INTEGER,
+ 32, PropModeReplace, 1, &val,
+ TRUE, FALSE);
+ RRChangeOutputProperty(output->randr_output,
+ backlight_deprecated_atom, XA_INTEGER,
+ 32, PropModeReplace, 1, &val,
+ TRUE, FALSE);
+ }
}
}