]> git.lizzy.rs Git - bspwm.git/commitdiff
Automatically shrink pseudo-tiled windows
authorBastien Dejean <nihilhill@gmail.com>
Tue, 29 Jan 2019 16:52:02 +0000 (17:52 +0100)
committerBastien Dejean <nihilhill@gmail.com>
Tue, 29 Jan 2019 16:52:02 +0000 (17:52 +0100)
Fixes #914.

doc/bspwm.1
doc/bspwm.1.asciidoc
src/tree.c

index f7a99942243ffb85dd58b83104311502ee539573..107d3067353fac5494109fca07a0657815197baa 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: bspwm
 .\"    Author: [see the "Author" section]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 01/24/2019
+.\"      Date: 01/29/2019
 .\"    Manual: Bspwm Manual
-.\"    Source: Bspwm 0.9.5-31-ga8b40f5
+.\"    Source: Bspwm 0.9.5-35-g32ff624
 .\"  Language: English
 .\"
-.TH "BSPWM" "1" "01/24/2019" "Bspwm 0\&.9\&.5\-31\-ga8b40f5" "Bspwm Manual"
+.TH "BSPWM" "1" "01/29/2019" "Bspwm 0\&.9\&.5\-35\-g32ff624" "Bspwm Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -527,22 +527,22 @@ Only consider monitors where the focused desktop is occupied\&.
 .PP
 tiled
 .RS 4
-Its size and position are determined by the splitting type and ratio of each node of its path in the window tree\&.
+Its size and position are determined by the window tree\&.
 .RE
 .PP
 pseudo_tiled
 .RS 4
-Has an unrestricted size while being centered in its tiling space\&.
+A tiled window that automatically shrinks but doesn\(cqt stretch beyond its floating size\&.
 .RE
 .PP
 floating
 .RS 4
-Can be moved/resized freely\&. Although it doesn\(cqt occupy any tiling space, it is still part of the window tree\&.
+Can be moved/resized freely\&. Although it doesn\(cqt use any tiling space, it is still part of the window tree\&.
 .RE
 .PP
 fullscreen
 .RS 4
-Fills its monitor rectangle and has no borders\&. It is send in the ABOVE layer by default\&.
+Fills its monitor rectangle and has no borders\&.
 .RE
 .SH "NODE FLAGS"
 .PP
index 823c67789df0d843e8a8c363b8d905aceebc8022..e95839984602fdcb342c95de02e1c601bdf405f6 100644 (file)
@@ -156,8 +156,6 @@ parent::
 Modifiers
 ^^^^^^^^^
 
-
-
 [!]focused::
        Only consider the focused node.
 
@@ -326,16 +324,16 @@ Window States
 -------------
 
 tiled::
-       Its size and position are determined by the splitting type and ratio of each node of its path in the window tree.
+       Its size and position are determined by the window tree.
 
 pseudo_tiled::
-       Has an unrestricted size while being centered in its tiling space.
+       A tiled window that automatically shrinks but doesn't stretch beyond its floating size.
 
 floating::
-       Can be moved/resized freely. Although it doesn't occupy any tiling space, it is still part of the window tree.
+       Can be moved/resized freely. Although it doesn't use any tiling space, it is still part of the window tree.
 
 fullscreen::
-       Fills its monitor rectangle and has no borders. It is send in the ABOVE layer by default.
+       Fills its monitor rectangle and has no borders.
 
 
 Node Flags
index dbd1594499c68cdac097034c15b397e1bec3efae..fa79a1b985b8fb212661315009d0e3de0ec83244 100644 (file)
@@ -101,23 +101,21 @@ void apply_layout(monitor_t *m, desktop_t *d, node_t *n, layout_t l, xcb_rectang
                xcb_rectangle_t r;
                xcb_rectangle_t cr = get_window_rectangle(n);
                client_state_t s = n->client->state;
+               /* tiled and pseudo-tiled clients */
                if (s == STATE_TILED || s == STATE_PSEUDO_TILED) {
                        int wg = (gapless_monocle && l == LAYOUT_MONOCLE ? 0 : d->window_gap);
-                       /* tiled clients */
-                       if (s == STATE_TILED) {
-                               r = rect;
-                               int bleed = wg + 2 * bw;
-                               r.width = (bleed < r.width ? r.width - bleed : 1);
-                               r.height = (bleed < r.height ? r.height - bleed : 1);
+                       r = rect;
+                       int bleed = wg + 2 * bw;
+                       r.width = (bleed < r.width ? r.width - bleed : 1);
+                       r.height = (bleed < r.height ? r.height - bleed : 1);
                        /* pseudo-tiled clients */
-                       } else {
-                               r = n->client->floating_rectangle;
+                       if (s == STATE_PSEUDO_TILED) {
+                               xcb_rectangle_t f = n->client->floating_rectangle;
+                               r.width = MIN(r.width, f.width);
+                               r.height = MIN(r.height, f.height);
                                if (center_pseudo_tiled) {
                                        r.x = rect.x - bw + (rect.width - wg - r.width) / 2;
                                        r.y = rect.y - bw + (rect.height - wg - r.height) / 2;
-                               } else {
-                                       r.x = rect.x;
-                                       r.y = rect.y;
                                }
                        }
                        n->client->tiled_rectangle = r;