Consider fullscreen windows maximized (#6153)

Fixes #6148
This commit is contained in:
Orestis Floros
2024-07-12 09:17:25 +02:00
committed by GitHub
parent 45d8f98fd5
commit d05eed3c01
3 changed files with 10 additions and 9 deletions

View File

@ -0,0 +1 @@
mark fullscreen windows as maximized

View File

@ -429,20 +429,20 @@ bool con_is_hidden(Con *con) {
/* /*
* Returns true if the container is maximized in the given orientation. * Returns true if the container is maximized in the given orientation.
* *
* If the container is floating or fullscreen, it is not considered maximized. * If the container is floating, it is not considered maximized. Otherwise, it
* Otherwise, it is maximized if it doesn't share space with any other * is maximized if it doesn't share space with any other container in the given
* container in the given orientation. For example, if a workspace contains * orientation. For example, if a workspace contains a single splitv container
* a single splitv container with three children, none of them are considered * with three children, none of them are considered vertically maximized, but
* vertically maximized, but they are all considered horizontally maximized. * they are all considered horizontally maximized.
* *
* Passing "maximized" hints to the application can help it make the right * Passing "maximized" hints to the application can help it make the right
* choices about how to draw its borders. See discussion in * choices about how to draw its borders. See discussion in
* https://github.com/i3/i3/pull/2380. * https://github.com/i3/i3/pull/2380.
*/ */
bool con_is_maximized(Con *con, orientation_t orientation) { bool con_is_maximized(Con *con, orientation_t orientation) {
/* Fullscreen containers are not considered maximized. */ /* Fullscreen containers are considered maximized. */
if (con->fullscreen_mode != CF_NONE) { if (con->fullscreen_mode != CF_NONE) {
return false; return true;
} }
/* Look up the container layout which corresponds to the given /* Look up the container layout which corresponds to the given

View File

@ -57,10 +57,10 @@ subtest 'two windows in default layout', sub {
}; };
cmd 'fullscreen enable'; cmd 'fullscreen enable';
ok(maximized_neither($winA), 'fullscreen windows are not maximized'); ok(maximized_both($winA), 'fullscreen windows are maximized');
cmd 'fullscreen disable'; cmd 'fullscreen disable';
ok(maximized_both($winA), 'disabling fullscreen sets maximized to true again'); ok(maximized_both($winA), 'disabling fullscreen retains maximized');
cmd 'floating enable'; cmd 'floating enable';
ok(maximized_neither($winA), 'floating windows are not maximized'); ok(maximized_neither($winA), 'floating windows are not maximized');