Commit f502d6f1 authored by c.rhodes's avatar c.rhodes
Browse files

equality comparison for new uncached IDs

Patch from Shawn <>

parent 4472ac28
......@@ -66,14 +66,14 @@
(defmacro state-geometry-changes (state) `(fifth ,state))
(defmacro drawable-equal-function ()
(if (member 'drawable +clx-cached-types+)
''eq ;; Allows the compiler to use the microcoded ASSQ primitive on LISPM's
;; Since drawables are not always cached, we must use drawable-equal
;; to determine equality.
(defmacro window-equal-function ()
(if (member 'window +clx-cached-types+)
;; Since windows are not always cached, we must use window-equal
;; to determine equality.
(defmacro with-state ((drawable) &body body)
;; Allows a consistent view to be obtained of data returned by GetWindowAttributes
......@@ -826,19 +826,16 @@
(getf (font-properties font) name))
(macrolet ((make-mumble-equal (type)
;; When cached, EQ works fine, otherwise test resource id's and displays
;; Since caching is only done for objects created by the
;; client, we must always compare ID and display
(let ((predicate (xintern type '-equal))
(id (xintern type '-id))
(dpy (xintern type '-display)))
(if (member type +clx-cached-types+)
`(within-definition (,type make-mumble-equal)
(declaim (inline ,predicate))
(defun ,predicate (a b) (eq a b)))
`(within-definition (,type make-mumble-equal)
(defun ,predicate (a b)
(declare (type ,type a b))
(and (= (,id a) (,id b))
(eq (,dpy a) (,dpy b)))))))))
`(within-definition (,type make-mumble-equal)
(defun ,predicate (a b)
(declare (type ,type a b))
(and (= (,id a) (,id b))
(eq (,dpy a) (,dpy b))))))))
(make-mumble-equal window)
(make-mumble-equal pixmap)
(make-mumble-equal cursor)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment