Skip to content

Commit

Permalink
Reenabled parts of window_type which would work in Wayland
Browse files Browse the repository at this point in the history
Added documentation for it.

Signed-off-by: Tin Švagelj <[email protected]>
  • Loading branch information
Caellian committed Apr 20, 2024
1 parent 7c4fea5 commit 9a2ec7a
Showing 1 changed file with 40 additions and 3 deletions.
43 changes: 40 additions & 3 deletions src/gui.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,56 @@ constexpr uint8_t operator*(alignment index) {
return static_cast<axis_align>((static_cast<uint8_t>(of) >> 2) & 0b11);
}

#if defined(BUILD_X11) && defined(OWN_WINDOW)
/// @brief Describes how and where a window should be mounted, as well as its
/// behavior.
///
/// We assume the following order of layers:
/// - Background - behind conky and any other windows, contains icons and
/// desktop menus
/// - Background widgets and docks
/// - Windows
/// - Panels - contains content that covers windows
/// - Override windows - input-override windows on X11, custom overlays, lock
/// screens, etc.
///
/// See also:
/// - [wm-spec `_NET_WM_WINDOW_TYPE`](
/// https://specifications.freedesktop.org/wm-spec/1.3/ar01s05.html#idm45684324619328)
/// - [wlr-layer-shell layers](
/// https://wayland.app/protocols/wlr-layer-shell-unstable-v1#zwlr_layer_shell_v1:enum:layer)
/// - [xdg-positioner::anchor](
/// https://wayland.app/protocols/xdg-shell#xdg_positioner:enum:anchor)
enum class window_type : uint8_t {
/// @brief Acts as a normal window - has decorations, above
/// background, widgets and docks, below panels.
NORMAL = 0,
/// @brief Screen background, no decorations, positioned at the very bottom
/// and behind widgets and docks.
DESKTOP,
/// @brief Normal window, always shown above parent window (group).
///
/// See: [Popup](https://wayland.app/protocols/xdg-shell#xdg_popup) XDG shell
/// surface.
UTILITY,
/// @brief No decorations, between windows and background, attached to screen
/// edge.
DOCK,
/// @brief No decorations, above windows, attached to screen edge, reserves
/// space.
PANEL,
DESKTOP,
#ifdef BUILD_X11
/// @brief On top of everything else, not controlled by WM.
OVERRIDE,
UTILITY
#endif /* BUILD_X11 */
};
constexpr uint8_t operator*(window_type index) {
return static_cast<uint8_t>(index);
}

#if defined(BUILD_X11) && defined(OWN_WINDOW)
// Only works in X11 because Wayland doesn't support

///
enum class window_hints : uint16_t {
UNDECORATED = 0,
BELOW,
Expand Down

0 comments on commit 9a2ec7a

Please sign in to comment.