Sets the geometry of a top level interface.
capi
set-top-level-interface-geometry interface &key x y width height
interface⇩ |
A CAPI interface. |
Integers specifying the new geometry. |
The generic function set-top-level-interface-geometry
sets the geometry of a top level interface.
The coordinates of interface are modified according to x, y, width and height. interface should be a top level interface. If a keyword is omitted then that part of the coordinates is not changed.
x and y are measured from the top-left of the screen rectangle representing the area of the primary monitor (the primary screen rectangle).
When displaying with GTK+ on Wayland, the desktop does not allow the application to access or control the position of top level windows. so the values of x and y are ignored. width and height are still used.
You can check if the display is on Wayland by screen-display-type.
On Cocoa set-top-level-interface-geometry
behaves as if an interface toolbar is not present, even if interface does contain an interface toolbar.
(setf ii (capi:element-interface (capi:contain (make-instance 'capi:text-input-pane)))) (capi:execute-with-interface ii (lambda () (multiple-value-bind (x y width height) (capi:top-level-interface-geometry ii) (capi:set-top-level-interface-geometry ii :x (round (+ x (/ width 4))) :y y :width (round (* 0.75 width)) :height height))))
top-level-interface-p
top-level-interface-geometry
top-level-interface-display-state
interface
7 Programming with CAPI Windows
CAPI User Guide and Reference Manual (Macintosh version) - 18 Feb 2025 15:33:09