summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2011-03-31 14:54:09 +0200
committerHans de Goede <hdegoede@redhat.com>2011-03-31 14:54:09 +0200
commitab98e1667e7cd8b673563ff22fdbaf41524d51d9 (patch)
tree9e5e3196379911e34cba09ca38afec80859421a9
parente7c5f45256497ba0227e9c52b42831e19c8965a3 (diff)
vdagent-x11: Fixup NewValue Property Notify event filtering
When we received a NewValue Property Notify event for a property we are not interested in, we would see this as an error, instead we should just ignore the event. In addition this patch also adds a check that the NewValue Property Notify event is send from the window which we are actually interested in.
-rw-r--r--vdagent-x11.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/vdagent-x11.c b/vdagent-x11.c
index 6a3094e..5068bc9 100644
--- a/vdagent-x11.c
+++ b/vdagent-x11.c
@@ -571,12 +571,7 @@ static int vdagent_x11_get_selection(struct vdagent_x11 *x11, XEvent *event,
*data_ret = NULL;
- if (incr) {
- if (event->xproperty.atom != prop) {
- fprintf(x11->errfile, "PropertyNotify parameters mismatch\n");
- goto exit;
- }
- } else {
+ if (!incr) {
if (event->xselection.property == None) {
if (x11->verbose)
fprintf(x11->errfile,
@@ -776,7 +771,12 @@ static void vdagent_x11_handle_selection_notify(struct vdagent_x11 *x11,
}
vdagent_x11_get_clipboard_atom(x11, x11->conversion_req->selection, &clip);
- if (!incr) {
+ if (incr) {
+ if (event->xproperty.atom != clip ||
+ event->xproperty.window != x11->selection_window) {
+ return;
+ }
+ } else {
if (vdagent_x11_get_clipboard_selection(x11, event, &selection)) {
len = -1;
} else if (selection != x11->conversion_req->selection) {