Skip to content
Bakkeby edited this page Feb 27, 2024 · 8 revisions

Extended Window Manager Hints (EWMH) is a standard for the X window system with regards to communication between window managers and application windows.

The standard formulate protocols where an application can give hints as to how it wishes to be presented to the user or ask the window manager to take certain actions such as going into fullscreen. The window manager can grant, deny or ignore such requests.

The communication takes place via X properties as well as client messages.

It is important to note that these protocols are specifically designed around the needs of desktop environments and do not always translate well for how workspaces are managed in tiling window managers.

Properties for X windows as well as the root window can be inspected using the xprop command on the terminal.

EWMH is what allows external tools such as xdo and xdotool to manipulate X windows.

The dusk window manager has partial EWMH support which is outlined below.

WM_DELETE_WINDOW

This a property that is sent as an event by the window manager (in the killclient function) to a window telling it to cease and desist.

WM_TAKE_FOCUS

This a property that is sent as an event by the window manager (in the focus function) to a window telling it to take focus.

WM_PROTOCOLS

The WM_PROTOCOLS property (atom) of a window contains a list of atoms each identifying a communication protocol between the client and the window manager that the client is willing to participate in.

This is read by the window manager in relation to sending events to the window when the WM_DELETE_WINDOW or WM_TAKE_FOCUS properties are sent.

WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, _NET_WM_PING

WM_STATE

The window manager will place a WM_STATE property (of type WM_STATE) on each top-level client window that is not in the Withdrawn state. This is used in the internal setclientstate function which is used to set the three window states of NormalState, IconicState and WithdrawnState depending on context.

WM_STATE(WM_STATE):

WM_WINDOW_ROLE

This is a property that indicates what role a window has and this is usually used to be able to differentiate between an applications primary window and other windows that has their own purpose.

A window could have a role of "browser", "pop-up", "GtkFileChooserDialog" naming a few.

This is used as a filter for client rules and is often used to make some windows belonging to an application floating and others not.

WM_WINDOW_ROLE(STRING) = "browser"

WM_CHANGE_STATE

This atom is sent as a client message asking for the state of the window to be changed.

The window manager will allow the window to go into the following states:

  • NormalState - the expected state for most windows
  • IconicState - state when windows are minimized or hidden
  • WithdrawnState - the window is withdrawn (inactive)

There is no special handling in the window manager for windows that are in the withdrawn state.

If an application requests that a window is to go into IconicState when it is already in that state then the window will go back to NormalState. As such it acts as a toggle. This feature may be changed or removed in the future.

STEAM_GAME

This bespoke atom is a property that the Steam client sets for Steam games and it holds a value that refers to the steam application ID.

This property is used internally in the window manager as part of client rules to determine whether a window is a Steam game or not. The reason for this is that the Steam client may set both the title and the class hint of the window to be the name of the game, which makes it impossible to add client rules that apply to all Steam games collectively.

If the new window is found to have the STEAM_GAME atom, but the class hint of the window does not start with "steam_app_", then the client rule matching will treat the class hint of the window to be "steam_app_" instead of what the class hint actually is.

This allows for the corresponding client rule to match steam game windows.

{ .class = "steam_app_", .flags = SteamGame|Floating|Centered },

Also refer to the SteamGame flag set above which is used to work around some issues concerning Steam games.

_NET_ACTIVE_WINDOW

This atom property is set on the root window with the reference to the window receiving focus.

The property is removed from the root window when a window is unfocused.

_NET_ACTIVE_WINDOW(WINDOW): window id # 0xb200002

When the atom is received via a client message then:

  • if the client window is hidden then it will be shown
  • if the FocusOnNetActive functionality is enabled and the client do not explicitly have the NoFocusOnNetActive flags set then the client will receive focus, more so if the client is on a workspace that is not currently shown then the view will change to the client's workspace
  • otherwise the client will be marked as urgent which will result the workspace icon and the window border to change colour scheme

_NET_CLIENT_LIST

This is a property of type XA_WINDOW that is set on the root window and contains a list of the window IDs for the windows that the window manager is currently managing.

Some programs relies on this information to know which other windows are present.

_NET_CLIENT_LIST(WINDOW): window id # 0x4000002, 0x800002, 0x5c00002

_NET_CLIENT_LIST_STACKING

This is for all intensive purposes the exact same as _NET_CLIENT_LIST just that the ordering is intended to match that of the current stacking order of said windows.

The window manager does not actively maintain the ordering in this list hence the stacking order listed here is not exact. The list is refreshed whenever a client window is closed.

The reason for including this property is that some applications reads solely from this instead of _NET_CLIENT_LIST and as such it is required to offer better support for such applications. A practical example was the Zoom video conferencing application which was found to rely on the _NET_CLIENT_LIST_STACKING property for application sharing.

_NET_CLIENT_LIST_STACKING(WINDOW): window id # 0x800002, 0x4000002, 0x5c00002

_NET_CLOSE_WINDOW

If this atom is received via a client message then the killclient function will be triggered for the window the message was for.

This is what allows the [X] button in GTK applications to close the window.

_NET_CURRENT_DESKTOP

This is a property that is set on the root window indicating which workspace is currently active.

_NET_CURRENT_DESKTOP(CARDINAL) = 6

If this atom is received via a client message for the root window then the view will change to the workspace the message refers to.

_NET_DESKTOP_NAMES

This is a property that is set on the root window and contains the workspace icons for all the available workspaces.

_NET_DESKTOP_NAMES(UTF8_STRING) = "𝟣", "𝟤", "𝟥", "𝟦", "𝟧", "𝟨", "𝟩", "𝟪", "𝟫"

_NET_DESKTOP_VIEWPORT

This is a property that is set on the root window which contains the current viewport.

_NET_DESKTOP_VIEWPORT(CARDINAL) = 1080, 305, 0, 0

The viewport consists of the x and y coordinates for each monitor in the X space. This exists because some window managers change their viewport when they change workspaces, or more precisely, their virtual desktops. As such each virtual desktop would have their own area in the X space and the viewport would change depending on which desktop the user is currently viewing.

This window manager does not change viewport when changing workspaces, instead client windows are moved into and out of view as needed.

The property is there as some programs may depend on it.

_NET_NUMBER_OF_DESKTOPS

This is a property that is set on the root window which contains the number of workspaces.

_NET_NUMBER_OF_DESKTOPS(CARDINAL) = 9

The number of workspaces can not be changed during runtime.

_NET_SUPPORTED

This is a property that is set on the root window which advertises the EWMH atoms that the window manager supports.

_NET_SUPPORTED(ATOM) = _NET_ACTIVE_WINDOW, _NET_CLIENT_LIST, _NET_CLIENT_LIST_STACKING, _NET_CLOSE_WINDOW,
_NET_CURRENT_DESKTOP, _NET_DESKTOP_NAMES, _NET_DESKTOP_VIEWPORT, _NET_NUMBER_OF_DESKTOPS, _NET_SUPPORTED,
_NET_SYSTEM_TRAY_S0, _NET_SYSTEM_TRAY_OPCODE, _NET_SYSTEM_TRAY_ORIENTATION, _NET_SYSTEM_TRAY_ORIENTATION_HORZ,
_NET_SYSTEM_TRAY_VISUAL, _NET_WM_ALLOWED_ACTIONS, _NET_SUPPORTING_WM_CHECK, _NET_WM_STATE_DEMANDS_ATTENTION,
_NET_WM_STATE_HIDDEN, _NET_WM_DESKTOP, _NET_WM_FULL_PLACEMENT, _NET_WM_STATE_FULLSCREEN, _NET_WM_ICON,
_NET_WM_NAME, _NET_WM_STATE, WM_COLORMAP_WINDOWS, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MAXIMIZED_HORZ,
_NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_STICKY, _NET_WM_WINDOW_OPACITY, _NET_WM_WINDOW_TYPE,
_NET_WM_WINDOW_TYPE_DOCK, _NET_WM_MOVERESIZE, _NET_WM_USER_TIME

_NET_SYSTEM_TRAY_S0

This is an atom that is used in relation to creating a system tray and is used to set the systray window as the managing systray windows.

_NET_SYSTEM_TRAY_OPCODE

This is an atom that indicates that a window wants to be added as a systray icon and this is received and handled via a client message.

_NET_SYSTEM_TRAY_ORIENTATION

This is an atom that is used in relation to creating a system tray and and it indicates how it is oriented (i.e. is it a vertical or horizontal system tray).

The property is set on the systray window itself.

_NET_SYSTEM_TRAY_ORIENTATION_HORZ

This is an atom that is used when setting the system tray orientation above. There are at the time of writing no support for a system tray that has vertical orientation.

_NET_SYSTEM_TRAY_VISUAL

This is an atom of type XA_VISUALID that is used in relation to creating a system tray and it contains a reference to the visual ID used for the display.

The property is set on the systray window itself.

_NET_WM_ALLOWED_ACTIONS

This is a property that is set on the client window indicating what actions the window is allowed to perform.

_NET_WM_ALLOWED_ACTIONS(ATOM) = _NET_WM_ACTION_MOVE, _NET_WM_ACTION_RESIZE, _NET_WM_ACTION_MINIMIZE,
_NET_WM_ACTION_SHADE, _NET_WM_ACTION_STICK, _NET_WM_ACTION_MAXIMIZE_HORZ, _NET_WM_ACTION_MAXIMIZE_VERT,
_NET_WM_ACTION_FULLSCREEN, _NET_WM_ACTION_CHANGE_DESKTOP, _NET_WM_ACTION_CLOSE, _NET_WM_ACTION_ABOVE,
_NET_WM_ACTION_BELOW

_NET_SUPPORTING_WM_CHECK

This is a property that the window manager is required to set on the root window to be the ID of a child window created by the window manager itself. This is in order to indicate that a compliant window manager is active.

The child window must also have the same property set referring to the ID of the window itself. The child window must also have the _NET_WM_NAME property set to the name of the window manager.

In practice this is used by client windows to determine whether a conforming window manager is present or not.

_NET_SUPPORTING_WM_CHECK(WINDOW): window id # 0x60002b

Refer to https://specifications.freedesktop.org/wm-spec/1.4/ar01s03.html.

_NET_WM_DESKTOP

This is a property that the window manager sets on client windows to indicate which workspace they are on.

_NET_WM_DESKTOP(CARDINAL) = 8

If this received as a client message then the client window will be moved to the desired workspace.

_NET_WM_FULL_PLACEMENT

This atom is a hint in the _NET_SUPPORTED list that announces that the window manager performs reasonable window placement for all window types it supports. This is meant as an indication for client windows to desist trying to manage windows on their own.

Refer to https://specifications.freedesktop.org/wm-spec/latest/ar01s07.html.

_NET_WM_STATE_FULLSCREEN

This atom state handled when a client message of type _NET_WM_STATE is received for a client window.

A client receiving this will go into or out of fullscreen.

_NET_WM_ICON

This is property that windows use to provide the desired icon for display purposes.

If the atom is received via a property notification then the icon for the client will be updated.

Refer to the FlexWinTitle bar module for more details.

_NET_WM_STATE_DEMANDS_ATTENTION

This atom state handled when a client message of type _NET_WM_STATE is received for a client window.

A client receiving this will be marked as urgent.

_NET_WM_STATE_HIDDEN

This atom state handled when a client message of type _NET_WM_STATE is received for a client window.

A client receiving this will be marked as hidden.

_NET_WM_STATE_MAXIMIZED_VERT

This atom state handled when a client message of type _NET_WM_STATE is received for a client window.

A client receiving this will become floating and be maximised vertically.

This is typically used in combination with _NET_WM_STATE_MAXIMIZED_HORZ to maximise a window to span the entire workspace.

This is what makes the maximise button in GTK applications work.

If the client window is already in a maximized state when receiving this message then the window will revert back to what it was previous to being maximised.

_NET_WM_STATE_MAXIMIZED_HORZ

This atom state handled when a client message of type _NET_WM_STATE is received for a client window.

A client receiving this will become floating and be maximised horizontally.

This is typically used in combination with _NET_WM_STATE_MAXIMIZED_VERT to maximise a window to span the entire workspace.

This is what makes the maximise button in GTK applications work.

If the client window is already in a maximized state when receiving this message then the window will revert back to what it was previous to being maximised.

_NET_WM_STATE_SKIP_TASKBAR

This atom state handled when a client message of type _NET_WM_STATE is received for a client window.

A client receiving this will get the SkipTaskbar flag set which prevents the client window title from being shown in the bar.

_NET_WM_STATE_STAYS_ON_TOP

This atom state handled when a client message of type _NET_WM_STATE is received for a client window.

This message will set, remove or toggle the AlwaysOnTop flag for the client.

_NET_WM_STATE_STICKY

This atom state handled when a client message of type _NET_WM_STATE is received for a client window.

This message will set, remove or toggle the Sticky flag for the client.

_NET_WM_MOVERESIZE

If this atom is received via a client message then the resizemouse function will be triggered for the window the message was for.

This is used by some applications when clicking close to the window border.

_NET_WM_USER_TIME

This is an atom that is typically sent via a property notification when focusing on or typing in windows.

This property is ignored by the window manager.

_NET_WM_NAME

The property is primarily used to retrieve the window title of client windows.

This property is used for the root window to set the name of the window manager.

If the atom is received as part of a property notification then the window title of the client will be updated.

_NET_WM_STATE

This atom is used via client messages to change the state of a client window.

The state change is determined by the atom the client message refers to, see:

  • _NET_WM_STATE_FULLSCREEN
  • _NET_WM_DEMANDS_ATTENTION
  • _NET_WM_STATE_STAYS_ON_TOP
  • _NET_WM_STATE_STICKY
  • _NET_WM_STATE_MAXIMIZED_VERT
  • _NET_WM_STATE_MAXIMIZED_HORZ

_NET_WM_WINDOW_OPACITY

This is a property that indicates the window's desired opacity. This depends on a compositor that takes the property into account.

Refer to the changeopacity function.

_NET_WM_WINDOW_TYPE

This property indicates the window type for a client window.

This is used as a filter for client rules and is often used to make dialog, utility, toolbar, splash and popup menus floating by default.

This is also used to ensure that dock and desktop windows are not managed by the window manager.

_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_DIALOG

_NET_WM_WINDOW_TYPE_DOCK

This is a property that indicates that the window is a dock.

This property is set on the systray window.

_NET_WM_ACTION_MOVE

This atom is used for the _NET_WM_ALLOWED_ACTIONS list to indicate that applications are allowed to request the window to be moved.

_NET_WM_ACTION_RESIZE

This atom is used for the _NET_WM_ALLOWED_ACTIONS list to indicate that applications are allowed to request the window to be resized.

_NET_WM_ACTION_MINIMIZE

This atom is used for the _NET_WM_ALLOWED_ACTIONS list to indicate that applications are allowed to request the window to be minimised.

_NET_WM_ACTION_SHADE

This atom is used for the _NET_WM_ALLOWED_ACTIONS list to indicate that applications are allowed to request the window to be shaded.

_NET_WM_ACTION_STICK

This atom is used for the _NET_WM_ALLOWED_ACTIONS list to indicate that applications are allowed to request the window to be made sticky.

_NET_WM_ACTION_MAXIMIZE_HORZ

This atom is used for the _NET_WM_ALLOWED_ACTIONS list to indicate that applications are allowed to request the window to be maximised horizontally.

_NET_WM_ACTION_MAXIMIZE_VERT

This atom is used for the _NET_WM_ALLOWED_ACTIONS list to indicate that applications are allowed to request the window to be maximized vertically.

_NET_WM_ACTION_FULLSCREEN

This atom is used for the _NET_WM_ALLOWED_ACTIONS list to indicate that applications are allowed to request the window to go into fullscreen mode.

_NET_WM_ACTION_CHANGE_DESKTOP

This atom is used for the _NET_WM_ALLOWED_ACTIONS list to indicate that applications are allowed to request the window to change workspace.

_NET_WM_ACTION_CLOSE

This atom is used for the _NET_WM_ALLOWED_ACTIONS list to indicate that applications are allowed to request the window to be closed.

_NET_WM_ACTION_ABOVE

This atom is used for the _NET_WM_ALLOWED_ACTIONS list to indicate that applications are allowed to request the window to be placed above other windows.

_NET_WM_ACTION_BELOW

This atom is used for the _NET_WM_ALLOWED_ACTIONS list to indicate that applications are allowed to request the window to be placed below other windows.

_MOTIF_WM_HINTS

If this atom is received via property notifications then the motif hints for the client window will be updated.

The atom is used to indicate to the window manager how window decorations should be handled. As this is not a reparenting window manager the motif hints will only have an effect on whether the window border is drawn or not.

MANAGER

This is an atom that is used internally when creating a system tray.

_XEMBED

This is an atom that is used to notify an application that their systray icon has now been embedded into the systray.

_XEMBED_INFO

This is a property containing Xembed information that is set on a system tray icon window.

_XEMBED_INFO(_XEMBED_INFO) = 0x0, 0x1

_IS_FLOATING

This is a custom property that is set on all windows managed by the window manager and it has a value indicating whether or not the window is floating.

_IS_FLOATING(CARDINAL) = 1

This can be used by compositors to only draw shadows on floating windows as an example.

Refer to the Floating topic.


Furthermore there are a series of custom properties that are set on client windows and the root window to allow for a seamless experience when doing a live restart of the window manager.

Refer to the restart function for more details on this.

_DUSK_CLIENT_FLAGS

Custom property that is set on a client window so that it can retain client flags set across restarts. The first value contains the lower 32 bits while the second value contains the upper 32 bits of the 64 bit unsigned long value that stores client flags.

_DUSK_CLIENT_FLAGS(CARDINAL) = 8454144 536870912

_DUSK_CLIENT_FIELDS

Cusom property that is set on a client window so that it can retain additional data such as which workspace it belongs to, which scratchkey it has if any and the window's order number relative to other client windows on the same workspace.

_DUSK_CLIENT_FIELDS(CARDINAL) = 70

_DUSK_WORKSPACE

Custom properties that are set on the root window to persist workspace information across restarts.

This atom contains one item per workspace and each item contains a 32 bit value that has a binary representation on the following form:

000|1|0|0000|0000|0001|0001|000|000|001|0|1
   | | |    |    |    |    |   |   |   | |-- ws->visible
   | | |    |    |    |    |   |   |   |-- ws->pinned
   | | |    |    |    |    |   |   |-- ws->nmaster
   | | |    |    |    |    |   |-- ws->nstack
   | | |    |    |    |    |-- ws->mon
   | | |    |    |    |-- ws->ltaxis[LAYOUT] (i.e. split)
   | | |    |    |-- ws->ltaxis[MASTER]
   | | |    |-- ws->ltaxis[STACK]
   | | |-- ws->ltaxis[STACK2]
   | |-- mirror layout (indicated by negative ws->ltaxis[LAYOUT])
   |-- ws->enablegaps

This means that the following will be retained following a restart:

  • the layout and all aspects pertaining to that
  • which monitor the workspace was on
  • whether the workspace was being viewed or not
  • whether the workspace was pinned to the monitor or not
_DUSK_WORKSPACE(CARDINAL) = 275810308 270536710 275120132 270536708 268992516 268992516 268474374 268992519 268992516

_DUSK_FLOATPOS_#

Custom atom that stores the client window's floating position on a per monitor basis.

Refer to the Save Floats page for more information.

_DUSK_FLOATPOS_0(CARDINAL) = 57610748

_DUSK_FLOATSIZE_#

Custom atom that stores the client window's floating size on a per monitor basis.

Refer to the Save Floats page for more information.

_DUSK_FLOATSIZE_0(CARDINAL) = 43517470

Back to Features.

Clone this wiki locally