Window Avoidance
 
The free Common Lisp software is provided strictly on an as-is basis. It is completely unsupported. NoteHeads neither assumes any responsibility for this free software, nor for any results of the use of this free software, be they direct or indirect. The free software remains, at all times, the intellectual property of NoteHeads
     Download the Utility in text format

  Description
This utility defines a mixin CLOS class which can be used to prevent the overlapping of windows belonging to different classes. It is very useful when working with a mixture of tool palette windoids and ordinary windows.

Documentation
WINDOW-AVOIDANCE-MIXIN, when mixed in with a window class, affects the zoomed size and position of a window in such a way that the window will not be overlapped by other window classes, provided certain conditions are met. This is very useful when working with tool palette windoids.An instance of a given window/windoid class (AWCI) will be avoided if
  1. at least part of the AWCI is outside of the window's area
  2. the AWCI is close to an edge of the screen
  3. the *longest* side of the AWCI is the one closest to the edge
This allows the user to position any AWCIs along the edges of the screen, then zoom a window to occupy the free space between them. Any AWCIs in the middle of this free area (i.e. not near to any edge) will be treated as "free" AWCIs. Rule (1) makes it possible to use the full size of the screen, if the user so wishes.WINDOW-AVOIDANCE-MIXIN takes an :AVOID initarg which should be a list of window/windoid classnames to avoid. See the source for more information.The user can customise the behaviour by specializing VIEW-AVOIDANCE-BOUNDARIES.AVOID-WINDOIDS-MIXIN is a specialization of WINDOW-AVOIDANCE-MIXIN which is used to avoid windoids.

Acknowledgements
Special thanks to Adam Alpern who contributed to the code.