Skip to content

Commit 54f2996

Browse files
committed
xwindow.l: check within :colormap methods
1 parent 23361bb commit 54f2996

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

lisp/xwindow/Xeus.l

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -535,11 +535,7 @@
535535
(setf (SetWindowAttributes-win_gravity swa) (gravity-to-value gravity))
536536
(unless color-map
537537
(cond ((= vi *visual*) ;use parent's colormap for the default
538-
(setq color-map (send parent :colormap))
539-
(unless (derivedp color-map colormap)
540-
(warning-message 2 "~s's parent ~s does not have cmap; root cmap is used."
541-
self parent)
542-
(setq color-map *color-map*)))
538+
(setq color-map (send parent :colormap)))
543539
(t ;make private cmap
544540
(setq color-map (instance colormap :create :visual vi))
545541
(send color-map :copy-colors *color-map* 0 32)) ))
@@ -635,8 +631,13 @@
635631
(integer-vector (send attr :get 'width) (send attr :get 'height)))
636632
(:depth () (send (send self :attributes) :get 'depth))
637633
(:screen () (send (send self :attributes) :get 'screen))
638-
(:ColorMap () (gethash (send (send self :attributes) :get 'colormap)
639-
*xwindows-hash-tab*))
634+
(:ColorMap () (let ((color-map (gethash (send (send self :attributes) :get 'colormap)
635+
*xwindows-hash-tab*)))
636+
(unless (derivedp color-map colormap)
637+
(warning-message 2 "~s's parent ~s does not have cmap; root cmap is used.~%"
638+
self parent)
639+
(setq color-map *color-map*))
640+
color-map))
640641
(:root () (send (send self :attributes) :get 'root)) ;drawable id of the root
641642
(:title (title)
642643
;(send self :unmap)

0 commit comments

Comments
 (0)