diff options
author | sethpollen <seth.pollen@gmail.com> | 2024-01-22 13:34:40 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-22 20:34:40 +0100 |
commit | b660d6a902cf44be22c434101dd2a4e6743e26bc (patch) | |
tree | cffb204c8fdcb31a50021c4b55e2958176f9b284 /include | |
parent | 9aba43119b1d414ecc217201155e97276b696974 (diff) | |
download | i3-b660d6a902cf44be22c434101dd2a4e6743e26bc.tar.gz i3-b660d6a902cf44be22c434101dd2a4e6743e26bc.zip |
Add support for _NET_WM_STATE_MAXIMIZED_{HORZ, VERT} (#5840)
If a window occupies the entirety of its workspace vertically and/or horizontally, pass it the _NET_WM_STATE_MAXIMIZED_{HORZ, VERT} atoms. This helps applications like Google Chrome draw the tab bar correctly and handle tab clicks correctly (see https://crbug.com/1495853).
This change is based on work from @yshui in #2380.
Diffstat (limited to 'include')
-rw-r--r-- | include/con.h | 16 | ||||
-rw-r--r-- | include/i3-atoms_NET_SUPPORTED.xmacro.h | 2 |
2 files changed, 18 insertions, 0 deletions
diff --git a/include/con.h b/include/con.h index e1bb6813..52f588b8 100644 --- a/include/con.h +++ b/include/con.h @@ -84,6 +84,22 @@ bool con_is_split(Con *con); bool con_is_hidden(Con *con); /** + * Returns true if the container is maximized in the given orientation. + * + * If the container is floating or fullscreen, it is not considered maximized. + * Otherwise, it is maximized if it doesn't share space with any other + * container in the given orientation. For example, if a workspace contains + * a single splitv container with three children, none of them are considered + * vertically maximized, but they are all considered horizontally maximized. + * + * Passing "maximized" hints to the application can help it make the right + * choices about how to draw its borders. See discussion in + * https://github.com/i3/i3/pull/2380. + * + */ +bool con_is_maximized(Con *con, orientation_t orientation); + +/** * Returns whether the container or any of its children is sticky. * */ diff --git a/include/i3-atoms_NET_SUPPORTED.xmacro.h b/include/i3-atoms_NET_SUPPORTED.xmacro.h index b491da98..90d03c20 100644 --- a/include/i3-atoms_NET_SUPPORTED.xmacro.h +++ b/include/i3-atoms_NET_SUPPORTED.xmacro.h @@ -11,6 +11,8 @@ xmacro(_NET_WM_STATE_DEMANDS_ATTENTION) \ xmacro(_NET_WM_STATE_MODAL) \ xmacro(_NET_WM_STATE_HIDDEN) \ xmacro(_NET_WM_STATE_FOCUSED) \ +xmacro(_NET_WM_STATE_MAXIMIZED_VERT) \ +xmacro(_NET_WM_STATE_MAXIMIZED_HORZ) \ xmacro(_NET_WM_STATE) \ xmacro(_NET_WM_WINDOW_TYPE) \ xmacro(_NET_WM_WINDOW_TYPE_NORMAL) \ |