summaryrefslogtreecommitdiff
path: root/randr/rrproperty.c
diff options
context:
space:
mode:
Diffstat (limited to 'randr/rrproperty.c')
-rw-r--r--randr/rrproperty.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/randr/rrproperty.c b/randr/rrproperty.c
index 6ffe91a47..6598f6259 100644
--- a/randr/rrproperty.c
+++ b/randr/rrproperty.c
@@ -23,6 +23,7 @@
#include "randrstr.h"
#include "propertyst.h"
#include "swaprep.h"
+#include <X11/Xatom.h>
static int
DeliverPropertyEvent(WindowPtr pWin, void *value)
@@ -132,6 +133,29 @@ RRDeleteOutputProperty(RROutputPtr output, Atom property)
}
}
+static void
+RRNoticePropertyChange(RROutputPtr output, Atom property, RRPropertyValuePtr value)
+{
+ const char *non_desktop_str = RR_PROPERTY_NON_DESKTOP;
+ Atom non_desktop_prop = MakeAtom(non_desktop_str, strlen(non_desktop_str), FALSE);
+
+ if (property == non_desktop_prop) {
+ if (value->type == XA_INTEGER && value->format == 32 && value->size >= 1) {
+ uint32_t nonDesktopData;
+ Bool nonDesktop;
+
+ memcpy(&nonDesktopData, value->data, sizeof (nonDesktopData));
+ nonDesktop = nonDesktopData != 0;
+
+ if (nonDesktop != output->nonDesktop) {
+ output->nonDesktop = nonDesktop;
+ RROutputChanged(output, 0);
+ RRTellChanged(output->pScreen);
+ }
+ }
+ }
+}
+
int
RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type,
int format, int mode, unsigned long len,
@@ -235,6 +259,9 @@ RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type,
if (pending && prop->is_pending)
output->pendingProperties = TRUE;
+ if (!(pending && prop->is_pending))
+ RRNoticePropertyChange(output, prop->propertyName, prop_value);
+
if (sendevent) {
xRROutputPropertyNotifyEvent event = {
.type = RREventBase + RRNotify,