Skip to content

Window states management

yshui edited this page Oct 24, 2020 · 13 revisions

Types of window states in picom

Raw window states

These are window states tracked by the X server. They might or might not be stored directly in struct managed_win.

Name Description Availability in events
Properties Window properties, the ones you can view with xprop PropertyNotify, only tells us if the property is changed or deleted, new property value not included
Geometry Window size and position ConfigureNotify, fully available
Shape Shape of a non-rectangular window ShapeNotify, only tells us if the shape is changed, new shape not included
Viewability Whether a window is mapped, is viewable MapNotify and UnmapNotify, fully available. But all of the other states of a newly mapped window won't be available
Focus Whether a window has input focus FocusIn and FocusOut, fully available. But also affected by the _NET_ACTIVE_WINDOW property, so can't update in the event handler

There are also states concerning relationships between windows

Name Description Availability in events
Stacking order The order of how windows are stacked on top of each other ConfigureNotify and CirculateNotify, fully available
Hierarchy The tree structure formed by X windows. picom only really cares about toplevel windows, but we still need to keep track of hierarchy changes ReparentNotify, fully available. But if a previously non-toplevel window becomes toplevel, all of its other states won't be available

Mirrored raw states

Each of these states almost directly corresponds to a raw window state. They are stored in the struct manage_win.

Name Description Source
name ICCCM/EWMH window name Property, _NET_WM_NAME and WM_NAME
stacking_rank Number of windows above current window Stacking order
bounding_shape Shape
bounding_shaped Whether the current window is Shaped Shape
window_type EWMH window types Property, _NET_WM_WINDOW_TYPE
leader ICCCM window group leader Property, WM_CLIENT_LEADER and WM_TRANSIENT_FOR
focused Focus
class_instance, class_general ICCCM window classes Property, WM_CLASS
role ICCCM window role Property, WM_WINDOW_ROLE
opacity_prop Desired opacity of window Property, _NET_WM_WINDOW_OPACITY (not in EWMH)
Clone this wiki locally