Skip to content

Commit

Permalink
Consider fullscreen windows maximized (i3#6153)
Browse files Browse the repository at this point in the history
Fixes i3#6148
  • Loading branch information
orestisfl authored and desmana committed Aug 6, 2024
1 parent 9a4809c commit 34c641a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions release-notes/changes/7-fullscreen-maximized
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mark fullscreen windows as maximized
14 changes: 7 additions & 7 deletions src/con.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,20 +429,20 @@ 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.
* If the container is floating, 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) {
/* Fullscreen containers are not considered maximized. */
/* Fullscreen containers are considered maximized. */
if (con->fullscreen_mode != CF_NONE) {
return false;
return true;
}

/* Look up the container layout which corresponds to the given
Expand Down
4 changes: 2 additions & 2 deletions testcases/t/551-net-wm-state-maximized.t
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ subtest 'two windows in default layout', sub {
};

cmd 'fullscreen enable';
ok(maximized_neither($winA), 'fullscreen windows are not maximized');
ok(maximized_both($winA), 'fullscreen windows are maximized');

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';
ok(maximized_neither($winA), 'floating windows are not maximized');
Expand Down

0 comments on commit 34c641a

Please sign in to comment.