Centered - bakkeby/dusk GitHub Wiki

The Centered flag indicates that a floating window should be placed in the center of the monitor when launched.

This is the case even when viewing multiple workspaces, i.e. the window will still be placed in the center of the monitor as opposed to in the center of the workspace area.

There are, however, two exceptions to this:

1) transient windows are centered within the geometry of the parent window

This means that a "Save As" dialog window, for example, will often be placed within the main window itself rather than in the center of the monitor.

A transient window will have the TRANSIENT_FOR window management hint set by the parent window but keep in mind that not all applications will set this.

It should also be noted that transient windows automatically get the Centered flag set unless the window is subject to client rules.

2) non-swallowed windows launched via a terminal are centered within the geometry of the terminal

If a terminal window has the Terminal flag set then it can be swallowed by X windows started from the command line. If the terminal is not swallowed due to the NoSwallow flag being set in the client rules for the new window (like for Xephyr as an example) and it is floating, then the window will be centered within the geometry of the terminal window provided that the height and width are less than that of the terminal. If the size of the window exceeds that of the terminal then it will be centered in the middle of the screen as normal.

If the above scenarios is undesirable then the window can also be centered using a floatpos rule like this:

.floatpos = "50% 50%"

If a rule includes Centered flag, but does not include the Floating flag (i.e. the window will start as tiled), then the centered position will be saved and will come into effect when floating layout is used or togglefloating is applied.

As per the default configuration the following window types are by default both centered and floating:

  • dialog
  • utility
  • toolbar
  • splash

Back to Features > Flags.

⚠️ **GitHub.com Fallback** ⚠️