Previous: , Up: Window Stacking   [Contents][Index]


8.9.3 Raising and Lowering Windows

Over time, Sawfish has accumulated several subtle variations of functions for raising and lowering windows. One set of functions operates on single windows. Notice how the function name and command name for each pair differs slightly.

Function: lower-window window
Command: lower-single-window window

Lower window to the bottom of its stacking depth.

Function: raise-window window
Command: raise-single-window window

Raise window to the top of its stacking depth.

Function: raise-lower-window window
Command: raise-lower-single-window window

If window is the highest in its stacking level, lower it to the bottom of this level, otherwise raise it to the top of its level.

Function: x-raise-window win ref
Function: x-lower-window win ref

Raise / lower window win so that it is above / below window ref. If ref is undefined, win is put at the top / bottom of the stacking order.

Another set of functions supports operating on multiple windows simultaneously. You have to import sawfish.wm.util.stacking to use them. Again, the function name and command name for each pair is different.

Function: lower-window* window
Command: lower-window window

Lower window and possibly associated windows to the bottom of their stacking depths.

Function: raise-window* window
Command: raise-window window

Raise window and possibly associated windows to the top of their stacking depth.

Function: raise-lower-window* window
Command: raise-lower-window window

If window is the highest in its stacking level, lower it and possibly associated windows to the bottom of their level, otherwise raise them to the top of their level.

Customizable: user-raise-type

This user option indicates which windows the lower-window*, raise-window* and raise-lower-window* functions affect. This variable can be

none

Only the specific argument window is affected.

transients

The specific argument window and all of its transients are affected. This is the default.

group

The specific argument window and all windows in its group are affected.

Sawfish has more general operations that raising a window to the top or lowering it to the bottom. It can place a window relative to one or more other managed windows.

Function: raise-windows w order
Function: lower-windows w order
Function: raise-lower-windows w order

Raise (or lower) all windows in order, such that items earlier in the list are higher (or lower) than later items. The window w is special, always being the highest or lowest window, even if appears in the middle of order.

For raise-lower-windows, if w would be raised or lowered, then all the other windows are also raised or lowered.

There are also functions (and associated commands) to change a window’s depth.

Function: lower-window-depth window
Command: lower-window-depth window

Decrement the stacking depth of window.

Function: raise-window-depth window
Command: raise-window-depth window

Increment the stacking depth of window.

Sawfish provides special support for “click-to-focus” mode, where you may or may not want to raise the window or pass the click to the underlying application.

Function: raise-and-pass-through-click w

Raise the window that received the current event with maybe-raise-window. Then replay any pointer events that invoked the command.

Function: raise-and-pass-through-click-if-focused w

Raise the window that received the current event (if it’s focused) with maybe-raise-window. Then replay any pointer events that invoked the command.

Function: raise-or-pass-through-click w

If the window that received the current event is not on top, raise it with maybe-raise-window. Otherwise replay any pointer events that invoked the command, sending them to the window.

When the above commands are called interactively, Sawfish will try to invoke them on the window that received the current event. Failing that, Sawfish will invoke them on the currently focused window.


Previous: , Up: Window Stacking   [Contents][Index]