phoe / raptor-launcher

A variant launcher for Furcadia written in Common Lisp and CommonQt/Qt4.
https://raptorlauncher.github.io
5 stars 1 forks source link

Spawned windows can be invisible #2

Open phoe opened 7 years ago

phoe commented 7 years ago

Furcadia can be spawned with its main window hidden.

Force https://github.com/sbcl/sbcl/blob/622c9daf9bb41ef9ad4b8a063c62c4baf59a1c1a/src/code/warm-mswin.lisp#L89 to contain 1 to solve it.

phoe commented 7 years ago
(defun sb-win32:mswin-spawn (program argv stdin stdout stderr searchp envp waitp
                             directory)
  (let ((std-handles (multiple-value-list (get-std-handles)))
        (inheritp nil))
    (flet ((maybe-std-handle (arg)
             (let ((default (pop std-handles)))
               (case arg (-1 default) (otherwise (setf inheritp t) arg)))))
      (with-alien ((process-information process-information)
                   (startup-info startup-info))
        (sb-kernel:system-area-ub8-fill
         0 (alien-sap startup-info)
         0 (alien-size startup-info :bytes))
        (setf (slot startup-info 'cb) (alien-size startup-info :bytes)
              (slot startup-info 'stdin) (maybe-std-handle stdin)
              (slot startup-info 'stdout) (maybe-std-handle stdout)
              (slot startup-info 'stderr) (maybe-std-handle stderr)
              (slot startup-info 'reserved1) nil
              (slot startup-info 'reserved2) 0
              (slot startup-info 'reserved3) nil
              (slot startup-info 'show-window) 5
              (slot startup-info 'flags) 1)
        (without-interrupts
            ;; KLUDGE: pass null image file name when searchp is true.
            ;; This way, file extension gets resolved by OS if omitted.
            (if (create-process (if searchp nil program)
                                argv
                                nil nil
                                inheritp 0 envp directory
                                (alien-sap startup-info)
                                (alien-sap process-information))
                (let ((child (slot process-information 'process-handle)))
                  (close-handle (slot process-information 'thread-handle))
                  child)
                -2))))))