Fixes #815.
dir=(north west south east) \
cycle_dir=(next prev)
local -a jump=($dir first second brother parent 1 2) \
- node_desc=($dir $cycle_dir any last newest older newer focused pointed biggest) \
+ node_desc=($dir $cycle_dir any last newest older newer focused pointed biggest smallest) \
node_mod=($node_state $flag $layer focused automatic local \
active leaf window same_class descendant_of ancestor_of) \
desktop_desc=($cycle_dir any last newest older newer focused) \
.\" Title: bspwm
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 04/25/2018
+.\" Date: 06/19/2018
.\" Manual: Bspwm Manual
-.\" Source: Bspwm 0.9.5
+.\" Source: Bspwm 0.9.5-3-gdb5b0cd
.\" Language: English
.\"
-.TH "BSPWM" "1" "04/25/2018" "Bspwm 0\&.9\&.5" "Bspwm Manual"
+.TH "BSPWM" "1" "06/19/2018" "Bspwm 0\&.9\&.5\-3\-gdb5b0cd" "Bspwm Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\}
.nf
NODE_SEL := [NODE_SEL#](DIR|CYCLE_DIR|PATH|any|last|newest|
- older|newer|focused|pointed|
- biggest|<node_id>)[\&.[!]focused][\&.[!]automatic][\&.[!]local][\&.[!]active]
- [\&.[!]leaf][\&.[!]window][\&.[!]STATE][\&.[!]FLAG][\&.[!]LAYER]
- [\&.[!]same_class][\&.[!]descendant_of][\&.[!]ancestor_of]
+ older|newer|focused|pointed|biggest|smallest
+ <node_id>)[\&.[!]focused][\&.[!]automatic][\&.[!]local][\&.[!]active]
+ [\&.[!]leaf][\&.[!]window][\&.[!]STATE][\&.[!]FLAG][\&.[!]LAYER]
+ [\&.[!]same_class][\&.[!]descendant_of][\&.[!]ancestor_of]
STATE := tiled|pseudo_tiled|floating|fullscreen
Selects the biggest window\&.
.RE
.PP
+smallest
+.RS 4
+Selects the smallest window\&.
+.RE
+.PP
<node_id>
.RS 4
Selects the node with the given ID\&.
----
NODE_SEL := [NODE_SEL#](DIR|CYCLE_DIR|PATH|any|last|newest|
- older|newer|focused|pointed|
- biggest|<node_id>)[.[!]focused][.[!]automatic][.[!]local][.[!]active]
- [.[!]leaf][.[!]window][.[!]STATE][.[!]FLAG][.[!]LAYER]
- [.[!]same_class][.[!]descendant_of][.[!]ancestor_of]
+ older|newer|focused|pointed|biggest|smallest
+ <node_id>)[.[!]focused][.[!]automatic][.[!]local][.[!]active]
+ [.[!]leaf][.[!]window][.[!]STATE][.[!]FLAG][.[!]LAYER]
+ [.[!]same_class][.[!]descendant_of][.[!]ancestor_of]
STATE := tiled|pseudo_tiled|floating|fullscreen
biggest::
Selects the biggest window.
+smallest::
+ Selects the smallest window.
+
<node_id>::
Selects the node with the given ID.
} else if (streq("newest", desc)) {
history_find_newest_node(ref, dst, &sel);
} else if (streq("biggest", desc)) {
- find_biggest(ref, dst, &sel);
+ find_by_area(AREA_BIGGEST, ref, dst, &sel);
+ } else if (streq("smallest", desc)) {
+ find_by_area(AREA_SMALLEST, ref, dst, &sel);
} else if (streq("pointed", desc)) {
xcb_window_t win = XCB_NONE;
query_pointer(&win, NULL);
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
+#include <limits.h>
#include "bspwm.h"
#include "desktop.h"
#include "ewmh.h"
return cnt;
}
-void find_biggest(coordinates_t *ref, coordinates_t *dst, node_select_t *sel)
+void find_by_area(area_peak_t ap, coordinates_t *ref, coordinates_t *dst, node_select_t *sel)
{
- unsigned int b_area = 0;
+ unsigned int p_area;
+ if (ap == AREA_BIGGEST) {
+ p_area = 0;
+ } else {
+ p_area = UINT_MAX;
+ }
for (monitor_t *m = mon_head; m != NULL; m = m->next) {
for (desktop_t *d = m->desk_head; d != NULL; d = d->next) {
continue;
}
unsigned int f_area = node_area(d, f);
- if (f_area > b_area) {
+ if ((ap == AREA_BIGGEST && f_area > p_area) || (ap == AREA_SMALLEST && f_area < p_area)) {
*dst = loc;
- b_area = f_area;
+ p_area = f_area;
}
}
}
void find_nearest_neighbor(coordinates_t *ref, coordinates_t *dst, direction_t dir, node_select_t *sel);
unsigned int node_area(desktop_t *d, node_t *n);
int tiled_count(node_t *n);
-void find_biggest(coordinates_t *ref, coordinates_t *dst, node_select_t *sel);
+void find_by_area(area_peak_t ap, coordinates_t *ref, coordinates_t *dst, node_select_t *sel);
void rotate_tree(node_t *n, int deg);
void rotate_tree_rec(node_t *n, int deg);
void rotate_brother(node_t *n);
TIGHTNESS_HIGH,
} tightness_t;
+typedef enum {
+ AREA_BIGGEST,
+ AREA_SMALLEST,
+} area_peak_t;
+
typedef enum {
STATE_TRANSITION_ENTER = 1 << 0,
STATE_TRANSITION_EXIT = 1 << 1,