Skip to content

Commit

Permalink
xwindow.l: check within :colormap methods
Browse files Browse the repository at this point in the history
  • Loading branch information
k-okada committed Jan 5, 2017
1 parent 23361bb commit 54f2996
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions lisp/xwindow/Xeus.l
Original file line number Diff line number Diff line change
Expand Up @@ -535,11 +535,7 @@
(setf (SetWindowAttributes-win_gravity swa) (gravity-to-value gravity))
(unless color-map
(cond ((= vi *visual*) ;use parent's colormap for the default
(setq color-map (send parent :colormap))
(unless (derivedp color-map colormap)
(warning-message 2 "~s's parent ~s does not have cmap; root cmap is used."
self parent)
(setq color-map *color-map*)))
(setq color-map (send parent :colormap)))
(t ;make private cmap
(setq color-map (instance colormap :create :visual vi))
(send color-map :copy-colors *color-map* 0 32)) ))
Expand Down Expand Up @@ -635,8 +631,13 @@
(integer-vector (send attr :get 'width) (send attr :get 'height)))
(:depth () (send (send self :attributes) :get 'depth))
(:screen () (send (send self :attributes) :get 'screen))
(:ColorMap () (gethash (send (send self :attributes) :get 'colormap)
*xwindows-hash-tab*))
(:ColorMap () (let ((color-map (gethash (send (send self :attributes) :get 'colormap)
*xwindows-hash-tab*)))
(unless (derivedp color-map colormap)
(warning-message 2 "~s's parent ~s does not have cmap; root cmap is used.~%"
self parent)
(setq color-map *color-map*))
color-map))
(:root () (send (send self :attributes) :get 'root)) ;drawable id of the root
(:title (title)
;(send self :unmap)
Expand Down

0 comments on commit 54f2996

Please sign in to comment.