How to create a window in Xlib that gets positioned by a window manager? (Lisp, CLX, StumpWM)

162 views Asked by At

I have the following code. It draws a 200x200 white square in the top-left-most corner of my screen.

What changes need to be made to the code so that the square is picked up by StumpWM and drawn in the top-left-most corner of the current StumpWM "frame".

(in-package :stumpwm-user)

(defun make-window-example ()
  (let* ((display *display*)
         (screen (first (xlib:display-roots display)))
         (white (xlib:screen-white-pixel screen))
         (root-window (xlib:screen-root screen))
         (my-window (xlib:create-window
                     :parent root-window
                     :x 0
                     :y 0
                     :width 200
                     :height 200
                     :background white)))
    (xlib:map-window my-window)
    (xlib:display-finish-output display)
    (sleep 2)
    (xlib:destroy-window my-window)))
0

There are 0 answers