;; Simple list of windows menu for the standard profile

(defun my-raise-window (win)
  (if (and (wob-is-valid win)
           (not (= win root-window)))
      (with (wob win)
        (if (boundp 'virtual-make-window-visible)
            (virtual-make-window-visible))
        (if (not window-is-mapped)
            (if (window-icon?)
                (with (wob (window-icon))
                  (iconify-window))
              (map-window)))
        (raise-window))))

(defun show-win-menu ()
  (std-pop-menu (menu-make-from-list
		 (+ (list (list 'pop-label-make "Windows"))
		    (mapfor wob (list-of-windows 'window)
		      (if (= window-client-class 'Gwm)
                          ()
                        (list 'item-make (window-name) 
                              (list 'my-raise-window window-window))))))))
