From: Matt Birkholz <puck@birchwood-abbey.net>
Date: Fri, 13 Jan 2017 23:33:45 +0000 (-0700)
Subject: x11 plugin: Fix handling of property-notify events from unknown win.
X-Git-Tag: mit-scheme-pucked-9.2.12~247
X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=cf08520042224a438470bf3b6f0ce11733a6cadc;p=mit-scheme.git

x11 plugin: Fix handling of property-notify events from unknown win.
---

diff --git a/src/x11/x11-base.scm b/src/x11/x11-base.scm
index 151a52c33..cde2bcfb9 100644
--- a/src/x11/x11-base.scm
+++ b/src/x11/x11-base.scm
@@ -105,7 +105,7 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 	(xw (malloc (C-sizeof "* struct xwindow") '(* (struct |xwindow|)))))
     (let* ((done-p (C-call "x_display_process_events"
 			   display event xw))
-	   (window (C-> xw "* xwindow" (make-alien '(struct |xwindow|))))
+	   (window (C-> xw "* struct xwindow" (make-alien '(struct |xwindow|))))
 	   (obj (if (= done-p 1)
 		    #f
 		    (or (make-event-object window event)
@@ -161,8 +161,9 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 
     (and
      (not (eq? #f scmtype))
-     (not (zero? (bitwise-and (bit scmtype)
-			      (C-call "x_window_event_mask" window))))
+     (or (alien-null? window)
+	 (not (zero? (bitwise-and (bit scmtype)
+				  (C-call "x_window_event_mask" window)))))
      (cond
 
       ((eq? scmtype event-type:key-press)		; xtype = KeyPress