Add new rule consequence: border

This commit is contained in:
Bastien Dejean 2014-08-14 18:14:25 +02:00
parent 549507db24
commit 6f32affb5d
5 changed files with 8 additions and 6 deletions

View file

@ -2,12 +2,12 @@
.\" Title: bspwm
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\" Date: 07/23/2014
.\" Date: 08/14/2014
.\" Manual: Bspwm Manual
.\" Source: Bspwm 0.8.9
.\" Language: English
.\"
.TH "BSPWM" "1" "07/23/2014" "Bspwm 0\&.8\&.9" "Bspwm Manual"
.TH "BSPWM" "1" "08/14/2014" "Bspwm 0\&.8\&.9" "Bspwm Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@ -895,7 +895,7 @@ rule \fIOPTIONS\fR
\fBOptions\fR
.RS 4
.PP
\fB\-a\fR, \fB\-\-add\fR <class_name>|<instance_name>|* [\fB\-o\fR|\fB\-\-one\-shot\fR] [monitor=MONITOR_SEL|desktop=DESKTOP_SEL|window=WINDOW_SEL] [(floating|fullscreen|pseudo_tiled|locked|sticky|private|center|follow|manage|focus)=(on|off)] [split_dir=DIR]
\fB\-a\fR, \fB\-\-add\fR <class_name>|<instance_name>|* [\fB\-o\fR|\fB\-\-one\-shot\fR] [monitor=MONITOR_SEL|desktop=DESKTOP_SEL|window=WINDOW_SEL] [(floating|fullscreen|pseudo_tiled|locked|sticky|private|center|follow|manage|focus|border)=(on|off)] [split_dir=DIR]
.RS 4
Create a new rule\&.
.RE

View file

@ -549,7 +549,7 @@ rule 'OPTIONS'
Options
^^^^^^^
*-a*, *--add* <class_name>|<instance_name>|* [*-o*|*--one-shot*] [monitor=MONITOR_SEL|desktop=DESKTOP_SEL|window=WINDOW_SEL] [(floating|fullscreen|pseudo_tiled|locked|sticky|private|center|follow|manage|focus)=(on|off)] [split_dir=DIR]::
*-a*, *--add* <class_name>|<instance_name>|* [*-o*|*--one-shot*] [monitor=MONITOR_SEL|desktop=DESKTOP_SEL|window=WINDOW_SEL] [(floating|fullscreen|pseudo_tiled|locked|sticky|private|center|follow|manage|focus|border)=(on|off)] [split_dir=DIR]::
Create a new rule.
*-r*, *--remove* ^<n>|head|tail|<class_name>|<instance_name>|*...::

3
rule.c
View file

@ -97,7 +97,7 @@ bool remove_rule_by_index(int idx)
rule_consequence_t *make_rule_conquence(void)
{
rule_consequence_t *rc = calloc(1, sizeof(rule_consequence_t));
rc->manage = rc->focus = true;
rc->manage = rc->focus = rc->border = true;
return rc;
}
@ -299,6 +299,7 @@ void parse_key_value(char *key, char *value, rule_consequence_t *csq)
SETCSQ(follow)
SETCSQ(manage)
SETCSQ(focus)
SETCSQ(border)
#undef SETCSQ
}
}

View file

@ -285,6 +285,7 @@ typedef struct {
bool follow;
bool manage;
bool focus;
bool border;
} rule_consequence_t;
typedef struct pending_rule_t pending_rule_t;

View file

@ -122,7 +122,7 @@ void manage_window(xcb_window_t win, rule_consequence_t *csq, int fd)
}
}
client_t *c = make_client(win, d->border_width);
client_t *c = make_client(win, csq->border ? d->border_width : 0);
update_floating_rectangle(c);
if (c->floating_rectangle.x == 0 && c->floating_rectangle.y == 0)
csq->center = true;