Next: , Previous: Window Frames, Up: Top


11 Viewports

It is sometimes useful to have a logical display that is larger than the computer screen. This is most often implemented by displaying only a portion of the logical display at any time. Sawfish does this using “viewports”.

When viewports are enabled, the Sawfish logical display becomes infinitely large in the two directions “across” and “down” (to the maximum representable size of integers). Sawfish divides this logical display into a potentially infinite grid of cells. Each cell of the grid is the same size of the virtual display.

— Variable: viewport-dimensions

The current number of viewports across and down the virtual display. This is a cons cell (across . down). Defaults to (1 . 1).

— Function: set-number-of-viewports width height

Change viewport-dimensions to have the value (width . height).

The user then tells Sawfish to move the physical display from cell to cell. On a cell change, windows in previous cells are removed, and windows in the current cell appear. Windows that span two or more cells will appear in each cell, appropriately displaced.

Note that cell indices start at zero in each dimension. Indices are never negative.

— Function: screen-viewport

Returns the currently displayed viewport as a pair (x, y).

— Function: set-screen-viewport col row

Change the physical display to view cell (col, row).

— Function: move-viewport right down

Move the viewport to see the cell right slots to the right and down slots down. Either argument may be zero or negative.

— Function: set-window-viewport window col row

Move window to the cell at (col, row). The relative position of the window within the cells is preserved.

— Function: move-window-viewport window col-delta row-delta

Move window to the cell col-delta positions across and row-delta positions down from its current cell. The relative position of the window with its cells its preserved.

— Function: move-viewport-to-window window

Move the viewport to a cell that shows window window. For a window that spans multiple cells, this function will pick the cell showing the window's top-left corner.

— Function: move-window-to-current-viewport window

Move window from its existing viewport to the current viewport. The window's relative position in the existing viewport is preserved after the move.

— Function: window-viewport window

Returns a cons cell (col . row) of the viewport holding the top-left corner of window.

— Function: window-outside-viewport-p window
— Function: window-outside-workspace-p window

Returns true if window is completely outside the current viewport in any direction. The window-outside-workspace-p function is an obsolete alias for the first function; the “workspace” term is now used for another concept (see Workspaces).

— Function: window-absolute-position window

Returns a cons cell (x . y) of the position of window in its containing viewport. The containing viewport may or may not be the current viewport.

— Function: set-viewport x y

Change the position of the physical display, such that location (x, y) is at the top-left of the display. The physical display may be showing more than one cell at this point. All windows are redisplayed as appropriate.

— Variable: uniconify-to-current-viewport

When true, windows uniconify to the current viewport, rather than to the viewport they were iconified on. Defaults to true.